title: Delete a rule
keywords:

- delete a rule
- delete
- rule


# Delete a rule

Soft delete a rule. Requires owner access.

#### Path Parameters

**`org_id`** string required

The org id parameter.

**`rule_id`** string required

The rule id parameter.

#### Query Parameters

**`force`** boolean optional · Defaults to `false`

Force delete even if rule has active attachments

## Returns

A JSON object with the operation result.

Example

```bash cURL
curl -X DELETE "https://api.aitronos.com/v1/organizations/{org_id}/rules/{rule_id}" \
  -H "X-API-Key: $FREDDY_API_KEY"
```


```python Python SDK
from aitronos import Aitronos

client = Aitronos(api_key="your-api-key")

client.rule_operations.delete_rule("org_abc123", "rule_abc123")
print("Rule deleted successfully")
```


```python Python
import os
import requests

api_key = os.environ["FREDDY_API_KEY"]

response = requests.delete(
    "https://api.aitronos.com/v1/organizations/{org_id}/rules/{rule_id}",
    headers={"X-API-Key": api_key}
)

print(response.json())
```


```javascript JavaScript
const apiKey = process.env.FREDDY_API_KEY;

const response = await fetch('https://api.aitronos.com/v1/organizations/{org_id}/rules/{rule_id}', {
  method: 'DELETE',
  headers: {
    'X-API-Key': apiKey
  }
});

const data = await response.json();
console.log(data);
```

**Response:**

*204 No Content - No response body*

Errors

```json 401 Unauthorized
{
  "success": false,
  "error": {
    "code": "AUTHENTICATION_REQUIRED",
    "message": "Authentication required. Please provide a valid API key.",
    "system_message": "Missing or invalid authorization header",
    "type": "authentication_error",
    "status": 401,
    "trace_id": "req_abc123xyz",
    "timestamp": "2025-11-11T10:30:00Z",
    "details": {}
  }
}
```


```json 403 Forbidden
{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "You do not have permission to access this resource.",
    "system_message": "Insufficient permissions for this operation",
    "type": "authorization_error",
    "status": 403,
    "trace_id": "req_def456uvw",
    "timestamp": "2025-11-11T10:30:00Z",
    "details": {}
  }
}
```

## Related Resources

- [Create Rule](/docs/api-reference/rules/create)
- [List Rules](/docs/api-reference/rules/list)