Skip to main content

Create Agent

Create a new agent for the authenticated user.

Request Body

object
required
Agent object
string
required
Agent name
array
Array of tag strings
object
Agent conversation configuration
object
Platform-specific settings
object
Widget configuration for web integration
curl -X POST "https://api.example.com/api/v1/agents" \
  -H "X-API-Key: your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "agent": {
      "name": "Customer Support Agent",
      "tags": ["support", "voice"],
      "conversation_config": {
        "temperature": 0.7,
        "model": "gpt-4"
      },
      "platform_settings": {},
      "widget_config": {}
    }
  }'

Response

status
object
Response status information
code
integer
HTTP status code (201)
message
string
Status message
data
object
Created agent object (see Agent schema)
{
  "status": {
    "code": 201,
    "message": "Agent created successfully"
  },
  "data": {
    "id": "123",
    "name": "Customer Support Agent",
    "tags": ["support", "voice"],
    "conversation_config": {
      "temperature": 0.7,
      "model": "gpt-4"
    },
    "platform_settings": {},
    "published": false,
    "published_at": null,
    "elevenlabs_agent_id": null,
    "version": 1,
    "phone_numbers": [],
    "user_id": 1,
    "user_email": "[email protected]",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z"
  }
}

Error Responses

401
object
Unauthorized - Invalid or missing authentication
422
object
Validation error - Invalid request body