Skip to main content
GET
/
agents
curl -X GET https://api.ansa.so/agents \
  -H "Authorization: Bearer your-api-key"
{
  "data": [
    {
      "id": "agent_xxx",
      "name": "Support Bot",
      "slug": "support-bot",
      "model": "claude-sonnet-4-20250514",
      "createdAt": "2024-01-15T10:00:00Z"
    }
  ]
}

List Agents

Get all agents for the authenticated user.
curl -X GET https://api.ansa.so/agents \
  -H "Authorization: Bearer your-api-key"
{
  "data": [
    {
      "id": "agent_xxx",
      "name": "Support Bot",
      "slug": "support-bot",
      "model": "claude-sonnet-4-20250514",
      "createdAt": "2024-01-15T10:00:00Z"
    }
  ]
}

Get Agent

id
string
required
The agent ID
GET /agents/:id
curl -X GET https://api.ansa.so/agents/agent_xxx \
  -H "Authorization: Bearer your-api-key"
{
  "data": {
    "id": "agent_xxx",
    "name": "Support Bot",
    "slug": "support-bot",
    "model": "claude-sonnet-4-20250514",
    "temperature": 50,
    "systemPrompt": "You are a helpful support agent.",
    "createdAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-01-20T14:30:00Z"
  }
}

Create Agent

POST /agents
name
string
required
Agent display name
model
string
AI model ID (default: claude-sonnet-4-20250514)
systemPrompt
string
Instructions for the agent
temperature
number
Response creativity (0-100)
curl -X POST https://api.ansa.so/agents \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Sales Bot",
    "model": "claude-sonnet-4-20250514",
    "systemPrompt": "You are a sales assistant.",
    "temperature": 40
  }'
{
  "data": {
    "id": "agent_yyy",
    "name": "Sales Bot",
    "slug": "sales-bot",
    "model": "claude-sonnet-4-20250514",
    "temperature": 40,
    "systemPrompt": "You are a sales assistant.",
    "createdAt": "2024-01-22T09:00:00Z"
  }
}

Update Agent

PATCH /agents/:id
curl -X PATCH https://api.ansa.so/agents/agent_xxx \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Name",
    "temperature": 60
  }'

Delete Agent

DELETE /agents/:id
This permanently deletes the agent and all associated data including conversations, documents, and tools.
curl -X DELETE https://api.ansa.so/agents/agent_xxx \
  -H "Authorization: Bearer your-api-key"