curl --request POST \
--url 'https://response.stateset.com/api/v1/agents/{id}/rules' \
--header "Authorization: Bearer $RESPONSECX_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"rule_name": "string",
"rule_type": "string",
"description": "Two-person tent, green — replacement for damaged pole set.",
"activated": true,
"conditions": {
"any": [],
"all": []
},
"actions": []
}'
{
"object": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Two-Person Tent",
"type": "standard",
"description": "Two-person tent, green — replacement for damaged pole set.",
"activated": true,
"conditions": null,
"actions": null,
"agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
Attach a guardrail rule
The rule
POST
/
api
/
v1
/
agents
/
{id}
/
rules
curl --request POST \
--url 'https://response.stateset.com/api/v1/agents/{id}/rules' \
--header "Authorization: Bearer $RESPONSECX_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"rule_name": "string",
"rule_type": "string",
"description": "Two-person tent, green — replacement for damaged pole set.",
"activated": true,
"conditions": {
"any": [],
"all": []
},
"actions": []
}'
{
"object": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Two-Person Tent",
"type": "standard",
"description": "Two-person tent, green — replacement for damaged pole set.",
"activated": true,
"conditions": null,
"actions": null,
"agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
Path parameters
string (uuid)
required
The agent id.
Request body
CreateRule
string
required
string
required
One of: escalation, qualification, response, routing.
string
boolean
object
{any|all: [{field, operator, value}]}. Fields: company_size, confidence, intent, knowledge_sources, latest_message, missing_required_fields, timeline. Operators: contains_any, eq, exists, gte, in, lt, not_empty.
any[]
[{type, …}]. Types: collect_fields, fallback, handoff, include_sources, require_context, require_source_for_claims, require_verification, response_pattern, tag.
Response
Rule
string
string
string,null
string,null
string,null
boolean
any
any
string,null
Status codes
| Code | Meaning |
|---|---|
201 | The rule |
400 | Invalid request. issues names the offending field(s). |
401 | Missing, invalid, or expired API key. |
403 | The key lacks a required scope. |
404 | Not found, or not in the organization that owns the key. |
409 | Conflict — either the creation ceiling was reached for this organization (agent_limit_reached), or a request with the same Idempotency-Key is still in flight (idempotency_in_progress); retry the latter after the first attempt settles. |
422 | The Idempotency-Key was already used with a DIFFERENT request body (idempotency_key_reused). Reuse a key only to retry the identical request. |
429 | Rate limit exceeded. |
Access
| Required scope | agents:write |
| Rate limit | 30 requests per minute |
curl --request POST \
--url 'https://response.stateset.com/api/v1/agents/{id}/rules' \
--header "Authorization: Bearer $RESPONSECX_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"rule_name": "string",
"rule_type": "string",
"description": "Two-person tent, green — replacement for damaged pole set.",
"activated": true,
"conditions": {
"any": [],
"all": []
},
"actions": []
}'
{
"object": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Two-Person Tent",
"type": "standard",
"description": "Two-person tent, green — replacement for damaged pole set.",
"activated": true,
"conditions": null,
"actions": null,
"agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
Last modified on August 31, 2026