curl --silent --show-error --fail-with-body --request POST \
--url 'https://response.stateset.com/api/v1/agents' \
--header "Authorization: Bearer $RESPONSECX_API_KEY" \
--header "Idempotency-Key: ${IDEMPOTENCY_KEY:?Set a unique key for this operation; preserve it on retries}" \
--header 'Content-Type: application/json' \
--data '{
"name": "Quickstart Support",
"type": "customer_service",
"description": "Answers order and return questions",
"role": "Customer Support Specialist",
"instructions": "Help customers with orders and returns. Ask for missing information and escalate when you cannot verify an answer.",
"activated": false
}'
{
"object": "agent",
"id": "3f9c2a10-7b4e-4d8a-9c1e-5a2b8d7f6e01",
"name": "Quickstart Support",
"type": "customer_service",
"description": "Answers order and return questions",
"activated": false,
"goal": "",
"role": "Customer Support Specialist",
"updated_at": "2026-09-20T12:00:00Z",
"instructions": "Help customers with orders and returns. Ask for missing information and escalate when you cannot verify an answer."
}
Create an agent
The created agent
POST
/
api
/
v1
/
agents
curl --silent --show-error --fail-with-body --request POST \
--url 'https://response.stateset.com/api/v1/agents' \
--header "Authorization: Bearer $RESPONSECX_API_KEY" \
--header "Idempotency-Key: ${IDEMPOTENCY_KEY:?Set a unique key for this operation; preserve it on retries}" \
--header 'Content-Type: application/json' \
--data '{
"name": "Quickstart Support",
"type": "customer_service",
"description": "Answers order and return questions",
"role": "Customer Support Specialist",
"instructions": "Help customers with orders and returns. Ask for missing information and escalate when you cannot verify an answer.",
"activated": false
}'
{
"object": "agent",
"id": "3f9c2a10-7b4e-4d8a-9c1e-5a2b8d7f6e01",
"name": "Quickstart Support",
"type": "customer_service",
"description": "Answers order and return questions",
"activated": false,
"goal": "",
"role": "Customer Support Specialist",
"updated_at": "2026-09-20T12:00:00Z",
"instructions": "Help customers with orders and returns. Ask for missing information and escalate when you cannot verify an answer."
}
Headers
string
Optional client-generated key that makes the POST safe to retry: a repeat with the same key and body replays the original response instead of creating a duplicate.
Request body
CreateAgent
string
required
Minimum length:
1. Maximum length: 200.string
required
One of: assistant, customer_service, sales. Minimum length:
1. Maximum length: 100.string
Maximum length:
5000.string
The system prompt / persona. Maximum length:
50000.string
Maximum length:
2000.string
Maximum length:
2000.boolean
Response
Agent
string
Fixed value:
'agent'.string
string,null
string,null
string,null
boolean
string,null
string,null
string,null
string,null
Present on single-agent reads and writes only.
AgentSettingsOut
Status codes
| Code | Meaning |
|---|---|
201 | The created agent |
400 | Invalid request. issues names the offending field(s). |
401 | Missing, invalid, or expired API key. |
403 | The key lacks a required scope. |
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 |
Using this contract
Read the source OpenAPI document for declared schemas and alternatives. This page also includes documented corrections from the spec overlays. Example IDs and values are illustrative; replace them with records from your workspace.curl --silent --show-error --fail-with-body --request POST \
--url 'https://response.stateset.com/api/v1/agents' \
--header "Authorization: Bearer $RESPONSECX_API_KEY" \
--header "Idempotency-Key: ${IDEMPOTENCY_KEY:?Set a unique key for this operation; preserve it on retries}" \
--header 'Content-Type: application/json' \
--data '{
"name": "Quickstart Support",
"type": "customer_service",
"description": "Answers order and return questions",
"role": "Customer Support Specialist",
"instructions": "Help customers with orders and returns. Ask for missing information and escalate when you cannot verify an answer.",
"activated": false
}'
{
"object": "agent",
"id": "3f9c2a10-7b4e-4d8a-9c1e-5a2b8d7f6e01",
"name": "Quickstart Support",
"type": "customer_service",
"description": "Answers order and return questions",
"activated": false,
"goal": "",
"role": "Customer Support Specialist",
"updated_at": "2026-09-20T12:00:00Z",
"instructions": "Help customers with orders and returns. Ask for missing information and escalate when you cannot verify an answer."
}
Last modified on September 21, 2026