Update an existing rule. Version number increments automatically.
organization_id string required
Organization ID (org_ prefixed string) where the rule belongs.
rule_id string required
Rule ID with rule_ prefix.
All fields are optional. Only provided fields will be updated.
name string optional
Updated name for the rule.
description string optional
Updated description.
content string optional
Updated rule content. Recommended to keep below 10,000 characters for optimal performance.
category string optional
Updated category.
rule_type string optional
Updated rule type.
is_active boolean optional
Updated active status.
scope string optional
Updated scope.
apply_mode string optional
Updated apply mode.
is_public boolean optional
Updated public visibility status.
Returns the updated Rule object with incremented version number.
Requires edit or owner access to the rule.
Version number increments automatically on each update. Previous versions are not stored.
- Bash
- Python
- JavaScript
curl -X PUT https://api.aitronos.com/v1/rules/rule_abc123 \
-H "X-API-Key: $FREDDY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Updated rule content with new guidelines."
}'Response:
{
"success": true,
"data": {
"id": "rule_abc123",
"name": "Updated Customer Support Guidelines",
"description": "Updated description",
"content": "Always be polite and professional...",
"content_preview": "Always be polite and professional...",
"category": "communication",
"rule_type": "guideline",
"scope": "organization",
"organization_id": "org_xyz789",
"created_by": "usr_456",
"is_public": false,
"is_active": true,
"version": 2,
"metadata": {
"version": "2.0",
"updated_by": "admin"
},
"created_at": "2025-11-23T10:00:00Z",
"updated_at": "2025-11-23T11:00:00Z"
}
}