Activate or deactivate a rule regardless of its scope. The rule's creator, any org Owner/Admin of the rule's organization (for organization- and assistant-scoped rules), or an Aitronos Employee (for platform-scoped rules) may call this endpoint.

## Path parameters

**`rule_id`** string required

Rule ID (prefixed with `rule_`).

## Request body

**`is_active`** boolean required

Set to `true` to activate the rule, `false` to deactivate it.

**`org_id`** string optional

Organization context for the operation, when it cannot be inferred automatically.

## Returns

Returns the rule's `id`, the resulting `is_active` state, and an optional `override_context`.

Request

```bash cURL
curl -X PATCH "https://api.aitronos.com/v1/rules/rule_abc123/active" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "is_active": false }'
```


```python Python SDK
# A first-class SDK method for this endpoint is coming soon.
# In the meantime, call the endpoint directly with the SDK's HTTP client:
from aitronos import Aitronos

client = Aitronos(api_key="your-api-key")
response = client._client_wrapper.httpx_client.request(
    "rules/rule_abc123/active",
    method="PATCH",
    json={"is_active": False},
)
print(response.json())
```


```python Python
import os, requests

response = requests.patch(
    "https://api.aitronos.com/v1/rules/rule_abc123/active",
    headers={
        "Authorization": f"Bearer {os.environ['ACCESS_TOKEN']}",
        "Content-Type": "application/json",
    },
    json={"is_active": False},
)
print(response.json())
```


```javascript JavaScript
await fetch("https://api.aitronos.com/v1/rules/rule_abc123/active", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.ACCESS_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ is_active: false }),
});
```

Response

```json 200 OK
{
  "id": "rule_abc123",
  "is_active": false,
  "override_context": null
}
```


```json 404 Not Found
{
  "success": false,
  "error": {
    "code": "RULE_NOT_FOUND",
    "message": "The requested rule could not be found.",
    "system_message": "Rule not found",
    "type": "client_error",
    "status": 404,
    "details": { "rule_id": "rule_abc123" },
    "trace_id": "req_abc123xyz",
    "timestamp": "2026-04-15T10:00:00Z"
  }
}
```

## Related Resources

- [Update a rule (by ID)](/docs/api-reference/rules/update-by-id)
- [List rules (query param)](/docs/api-reference/rules/list-query)
- [List rule permissions](/docs/api-reference/rules/permissions-list)