title: Update a rule keywords:
- update a rule
- put
- update
- rule
Update an existing rule. Requires edit or owner access.
org_id string required
The org id parameter.
rule_id string required
The rule id parameter.
name string optional
The name parameter.
content string optional
The content parameter.
description string optional
The description parameter.
category RuleCategory optional
The category parameter.
rule_type RuleType optional
The rule type parameter.
scope RuleScopeAPI optional
Rule scope (global scope restricted - admin only)
apply_mode ApplyMode optional
The apply mode parameter.
is_public boolean optional
The is public parameter.
is_active boolean optional
The is active parameter.
id string
Rule ID with rule_ prefix
name string
Rule name
description string or null
Rule description
content string
Full rule content
content_length integer
Total character count of content
category string or null
Rule category
rule_type string or null
Rule type
scope string or null
Rule scope
apply_mode string or null
Rule apply mode
organization_id string
Organization ID
created_by string
User ID who created the rule
is_public boolean
Whether rule is public
is_active boolean
Whether rule is active
version integer
Rule version number
usage_count integer
Number of active attachments
can_edit boolean
Whether current user can edit this rule
created_at string
Creation timestamp
updated_at string
Last update timestamp
attached_entities array of object or null
List of attached entities
- Bash
- Python
- Python
- JavaScript
curl -X PUT "https://api.aitronos.com/v1/organizations/{org_id}/rules/{rule_id}" \
-H "X-API-Key: $FREDDY_API_KEY" \
-H "Content-Type: application/json"Response:
{
"id": "rule_abc123def456",
"name": "My Resource",
"description": "A description of the resource",
"content": "Response content",
"content_length": 1,
"category": "general",
"rule_type": "default",
"scope": "organization",
"apply_mode": "default",
"organization_id": "org_abc123def456",
"created_by": "example_created_by",
"is_public": true,
"is_active": true,
"version": 1,
"usage_count": 42,
"can_edit": false,
"created_at": "2025-11-15T10:30:00Z",
"updated_at": "2025-11-15T10:30:00Z",
"attached_entities": [
{
"id": "abc123def456",
"entity_type": "default",
"entity_id": "abc123def456",
"priority": 1,
"is_active": true
}
]
}