> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voiceable.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Agent

## Create Agent

Create a new agent for the authenticated user.

## Request Body

<ParamField body name="agent" type="object" required>
  Agent object

  <ParamField body name="name" type="string" required>
    Agent name
  </ParamField>

  <ParamField body name="tags" type="array" optional>
    Array of tag strings
  </ParamField>

  <ParamField body name="conversation_config" type="object" optional>
    Agent conversation configuration
  </ParamField>

  <ParamField body name="platform_settings" type="object" optional>
    Platform-specific settings
  </ParamField>

  <ParamField body name="widget_config" type="object" optional>
    Widget configuration for web integration
  </ParamField>
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  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": {}
      }
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.example.com/api/v1/agents', {
    method: 'POST',
    headers: {
      'X-API-Key': 'your-api-key-here',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      agent: {
        name: 'Customer Support Agent',
        tags: ['support', 'voice'],
        conversation_config: {
          temperature: 0.7,
          model: 'gpt-4'
        },
        platform_settings: {},
        widget_config: {}
      }
    })
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  headers = {
      'X-API-Key': 'your-api-key-here',
      'Content-Type': 'application/json'
  }

  payload = {
      'agent': {
          'name': 'Customer Support Agent',
          'tags': ['support', 'voice'],
          'conversation_config': {
              'temperature': 0.7,
              'model': 'gpt-4'
          },
          'platform_settings': {},
          'widget_config': {}
      }
  }

  response = requests.post(
      'https://api.example.com/api/v1/agents',
      headers=headers,
      json=payload
  )

  data = response.json()
  ```
</RequestExample>

## Response

<ResponseField name="status" type="object">
  Response status information

  <ResponseField name="code" type="integer">
    HTTP status code (201)
  </ResponseField>

  <ResponseField name="message" type="string">
    Status message
  </ResponseField>
</ResponseField>

<ResponseField name="data" type="object">
  Created agent object (see Agent schema)
</ResponseField>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "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": "user@example.com",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  }
  ```
</ResponseExample>

## Error Responses

<ResponseField name="401" type="object">
  Unauthorized - Invalid or missing authentication
</ResponseField>

<ResponseField name="422" type="object">
  Validation error - Invalid request body
</ResponseField>
