Skip to content
PUThttps://api.aitronos.com/v1/organizations/{org_id}/rules-stack

Atomically replace the organisation's rule stack. Entries are processed in list order — index 0 compiles first. At most one entry may carry is_entity_default=true. Every assistant in the organisation has its rule cache invalidated after the operation.

Path parameters

org_id string required

Organisation ID (prefixed with org_).

Body parameters

entries array optional

List of stack entries (max 50). Omitting or sending an empty list clears the stack. Each entry is an object with:

  • rule_id string required — Rule ID to include in the stack (prefixed with rule_).
  • priority integer optional — Attachment priority (0–100). When omitted, priorities are auto-assigned from list order (index × 10).
  • is_entity_default boolean optional — Mark as the org's default rule. At most one entry may be true. Default: false.

Returns

Returns the full updated stack as an array of stack items.

Bash
curl -X PUT https://api.aitronos.com/v1/organizations/org_abc123/rules-stack \
  -H "X-API-Key: $FREDDY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "entries": [
      {"rule_id": "rule_xyz", "priority": 0, "is_entity_default": true},
      {"rule_id": "rule_abc", "priority": 10}
    ]
  }'