# Create Agent

POST https://services.leadconnectorhq.com/voice-ai/agents

Create a new voice AI agent configuration and settings

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `voice-ai-agents.write`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "LeadConnector API",
    "version": "v3"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/voice-ai/agents": {
      "post": {
        "summary": "Create Agent",
        "operationId": "createAgent",
        "description": "Create a new voice AI agent configuration and settings",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentCreationRequestDTO"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Agent created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAgentResponseDTO"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "voice-ai-agents.write"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "AgentCreationRequestDTO": {
        "type": "object",
        "properties": {
          "locationId": {
            "type": "string",
            "description": "Unique identifier for the location where this agent will operate",
            "example": "LOC123456789ABCDEF"
          },
          "agentName": {
            "type": "string",
            "description": "Display name for the voice AI agent, between 1-40 characters. Default: \"My Agent {random 3 digit number}\"",
            "example": "Customer Support Agent",
            "maxLength": 40,
            "minLength": 1
          },
          "businessName": {
            "type": "string",
            "description": "Name of the business this agent represents. Default: Uses location name",
            "example": "Acme Corporation",
            "minLength": 1
          },
          "welcomeMessage": {
            "type": "string",
            "description": "Initial greeting spoken when the agent answers calls. Default: Auto generated",
            "example": "Hello! Thank you for calling Acme Corporation. How can I assist you today?",
            "maxLength": 190,
            "minLength": 1
          },
          "agentPrompt": {
            "type": "string",
            "description": "Custom instructions defining the agent's behavior and personality. Default: Basic prompt generated automatically",
            "example": "You are a helpful customer service representative. Always be polite and professional."
          },
          "voiceId": {
            "type": "string",
            "description": "Identifier for the speech synthesis voice from available voice options. Default: Auto generated",
            "example": "507f1f77bcf86cd799439011"
          },
          "language": {
            "example": "en-US",
            "type": "string",
            "description": "Language code for the agent's speech and understanding. Default: \"en-US\"",
            "enum": [
              "en-US",
              "pt-BR",
              "es",
              "fr",
              "de",
              "it",
              "nl-NL",
              "multi"
            ],
            "title": "VoiceAILanguage"
          },
          "patienceLevel": {
            "example": "low",
            "type": "string",
            "description": "Tolerance level for caller response delays. Default: \"high\"",
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "title": "PatienceLevel"
          },
          "maxCallDuration": {
            "type": "number",
            "description": "Maximum call duration in seconds, between 180-900 (3-15 minutes). Default: 300 seconds (5 minutes)",
            "example": 600,
            "minimum": 180,
            "maximum": 900
          },
          "sendUserIdleReminders": {
            "type": "boolean",
            "description": "Enables automatic reminders when callers are silent. Default: true",
            "example": true
          },
          "reminderAfterIdleTimeSeconds": {
            "type": "number",
            "description": "Seconds to wait before sending idle reminders, between 1-20. Default: 8 seconds",
            "example": 5,
            "minimum": 1,
            "maximum": 20
          },
          "inboundNumber": {
            "type": "string",
            "description": "Phone number for receiving inbound calls to this agent. Default: null",
            "example": "+1234567890"
          },
          "numberPoolId": {
            "type": "string",
            "description": "Identifier for the number pool managing phone number allocation. Default: null",
            "example": "pool_507f1f77bcf86cd799439011"
          },
          "callEndWorkflowIds": {
            "description": "Array of workflow IDs to trigger automatically when calls end. Default: []",
            "example": [
              "wf_507f1f77bcf86cd799439011",
              "wf_507f1f77bcf86cd799439012"
            ],
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sendPostCallNotificationTo": {
            "description": "Configuration for post-call email notifications to various recipients. Default: []",
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "admins": {
                    "type": "boolean",
                    "description": "Enables post-call notifications to all admin users in the location. Default: true",
                    "example": true
                  },
                  "allUsers": {
                    "type": "boolean",
                    "description": "Enables post-call notifications to all users in the location. Default: false",
                    "example": false
                  },
                  "contactAssignedUser": {
                    "type": "boolean",
                    "description": "Enables post-call notifications to the user assigned to the contact. Default: false",
                    "example": false
                  },
                  "specificUsers": {
                    "description": "Array of specific user IDs to receive post-call notifications. Default: []",
                    "example": [
                      "user_507f1f77bcf86cd799439011"
                    ],
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "customEmails": {
                    "description": "Array of custom email addresses to receive post-call notifications. Default: []",
                    "example": [
                      "manager@company.com"
                    ],
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "admins",
                  "allUsers",
                  "contactAssignedUser",
                  "specificUsers",
                  "customEmails"
                ],
                "title": "SendPostCallNotificationDTO"
              }
            ]
          },
          "agentWorkingHours": {
            "description": "Time intervals defining when the agent accepts calls, organized by day of week. Default: [] (available 24/7)",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "dayOfTheWeek": {
                  "type": "number",
                  "enum": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7
                  ],
                  "description": "Day of the week for this working hours configuration (Monday=1 to Sunday=7)",
                  "example": 1
                },
                "intervals": {
                  "description": "Array of time intervals when the agent is available on this day",
                  "example": [
                    {
                      "startHour": 9,
                      "startMinute": 0,
                      "endHour": 17,
                      "endMinute": 30
                    }
                  ],
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "startHour": {
                        "type": "number",
                        "description": "Starting hour of the working interval in 24-hour format (0-23)",
                        "example": 9,
                        "minimum": 0,
                        "maximum": 23
                      },
                      "endHour": {
                        "type": "number",
                        "description": "Ending hour of the working interval in 24-hour format (0-23)",
                        "example": 17,
                        "minimum": 0,
                        "maximum": 23
                      },
                      "startMinute": {
                        "type": "number",
                        "description": "Starting minute of the working interval (0-59)",
                        "example": 0,
                        "minimum": 0,
                        "maximum": 59
                      },
                      "endMinute": {
                        "type": "number",
                        "description": "Ending minute of the working interval (0-59)",
                        "example": 30,
                        "minimum": 0,
                        "maximum": 59
                      }
                    },
                    "required": [
                      "startHour",
                      "endHour",
                      "startMinute",
                      "endMinute"
                    ],
                    "title": "IntervalDTO"
                  }
                }
              },
              "required": [
                "dayOfTheWeek",
                "intervals"
              ],
              "title": "AgentWorkingHoursDTO"
            }
          },
          "timezone": {
            "type": "string",
            "description": "IANA timezone identifier affecting working hours and scheduling. Default: Location timezone",
            "example": "America/New_York",
            "pattern": "^[A-Za-z_]+/[A-Za-z_]+$"
          },
          "isAgentAsBackupDisabled": {
            "type": "boolean",
            "description": "Prevents this agent from being used as a fallback option. Default: false (Available as backup agent)",
            "example": false
          },
          "translation": {
            "description": "Language translation settings including enablement flag and target language code. Rules: (1) translation.enabled can only be true if the agent's language is not en-US; (2) when enabled, translation.language must be either the agent's language or en-US; (3) when enabled, translation.language is required.",
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": "Enables language translation for agent conversations. Default: false",
                    "example": false
                  },
                  "language": {
                    "type": "string",
                    "description": "Target language code for translation (e.g., \"es\" for Spanish, \"fr\" for French).",
                    "example": "es"
                  }
                },
                "required": [
                  "enabled"
                ],
                "title": "TranslationDTO"
              }
            ]
          }
        },
        "required": [
          "locationId"
        ],
        "title": "AgentCreationRequestDTO"
      },
      "CreateAgentResponseDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the created agent",
            "example": "507f1f77bcf86cd799439011"
          },
          "locationId": {
            "type": "string",
            "description": "Unique identifier for the location where this agent operates",
            "example": "LOC123456789ABCDEF"
          },
          "agentName": {
            "type": "string",
            "description": "Display name of the voice AI agent",
            "example": "Customer Support Agent"
          },
          "businessName": {
            "type": "string",
            "description": "Name of the business this agent represents",
            "example": "Acme Corporation"
          },
          "welcomeMessage": {
            "type": "string",
            "description": "Greeting message spoken when the agent answers calls",
            "example": "Hello! Thank you for calling. How can I assist you today?"
          },
          "agentPrompt": {
            "type": "string",
            "description": "Custom instructions defining the agent's behavior",
            "example": "You are a helpful customer service representative."
          },
          "voiceId": {
            "type": "string",
            "description": "Identifier for the speech synthesis voice being used",
            "example": "507f1f77bcf86cd799439011"
          },
          "language": {
            "type": "string",
            "description": "Language code for the agent's speech and understanding",
            "example": "en-US"
          },
          "patienceLevel": {
            "type": "string",
            "description": "Current tolerance level for caller response delays",
            "example": "medium"
          },
          "maxCallDuration": {
            "type": "number",
            "description": "Maximum call duration in seconds, between 180-900",
            "example": 600,
            "minimum": 180,
            "maximum": 900
          },
          "sendUserIdleReminders": {
            "type": "boolean",
            "description": "Indicates whether automatic idle reminders are enabled",
            "example": true
          },
          "reminderAfterIdleTimeSeconds": {
            "type": "number",
            "description": "Seconds to wait before sending idle reminders, between 1-20",
            "example": 5,
            "minimum": 1,
            "maximum": 20
          },
          "inboundNumber": {
            "type": "string",
            "description": "Phone number for receiving inbound calls",
            "example": "+1234567890"
          },
          "numberPoolId": {
            "type": "string",
            "description": "Identifier for the number pool managing this agent's phone allocation",
            "example": "pool_507f1f77bcf86cd799439011"
          },
          "callEndWorkflowIds": {
            "description": "Array of workflow IDs triggered automatically when calls end",
            "example": [],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sendPostCallNotificationTo": {
            "description": "Current post-call notification settings including recipient configuration",
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "admins": {
                    "type": "boolean",
                    "description": "Send notifications to admins",
                    "example": true
                  },
                  "allUsers": {
                    "type": "boolean",
                    "description": "Send notifications to all users",
                    "example": false
                  },
                  "contactAssignedUser": {
                    "type": "boolean",
                    "description": "Send notifications to contact assigned user",
                    "example": false
                  },
                  "specificUsers": {
                    "description": "Specific user IDs to notify",
                    "example": [],
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "customEmails": {
                    "description": "Custom email addresses to notify",
                    "example": [],
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "title": "SendPostCallNotificationSchema"
              }
            ]
          },
          "agentWorkingHours": {
            "description": "Time intervals when the agent accepts calls, organized by day of week",
            "example": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "dayOfTheWeek": {
                  "type": "number",
                  "enum": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7
                  ],
                  "description": "Day of the week for this working hours configuration (Monday=1 to Sunday=7)",
                  "example": 1
                },
                "intervals": {
                  "description": "Array of time intervals when the agent is available on this day",
                  "example": [
                    {
                      "startHour": 9,
                      "startMinute": 0,
                      "endHour": 17,
                      "endMinute": 30
                    }
                  ],
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "startHour": {
                        "type": "number",
                        "description": "Starting hour of the working interval in 24-hour format (0-23)",
                        "example": 9,
                        "minimum": 0,
                        "maximum": 23
                      },
                      "endHour": {
                        "type": "number",
                        "description": "Ending hour of the working interval in 24-hour format (0-23)",
                        "example": 17,
                        "minimum": 0,
                        "maximum": 23
                      },
                      "startMinute": {
                        "type": "number",
                        "description": "Starting minute of the working interval (0-59)",
                        "example": 0,
                        "minimum": 0,
                        "maximum": 59
                      },
                      "endMinute": {
                        "type": "number",
                        "description": "Ending minute of the working interval (0-59)",
                        "example": 30,
                        "minimum": 0,
                        "maximum": 59
                      }
                    },
                    "required": [
                      "startHour",
                      "endHour",
                      "startMinute",
                      "endMinute"
                    ],
                    "title": "IntervalDTO"
                  }
                }
              },
              "required": [
                "dayOfTheWeek",
                "intervals"
              ],
              "title": "AgentWorkingHoursDTO"
            }
          },
          "timezone": {
            "type": "string",
            "description": "IANA timezone identifier for working hours and scheduling",
            "example": "America/New_York"
          },
          "isAgentAsBackupDisabled": {
            "type": "boolean",
            "description": "Indicates whether this agent is excluded from backup scenarios",
            "example": false
          },
          "translation": {
            "description": "Current language translation settings including enablement status and target language",
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": "Whether translation is enabled",
                    "example": false
                  },
                  "language": {
                    "type": "string",
                    "description": "Translation language code",
                    "example": "es"
                  }
                },
                "title": "TranslationSchema"
              }
            ]
          }
        },
        "required": [
          "id",
          "locationId",
          "agentName",
          "businessName",
          "welcomeMessage",
          "agentPrompt",
          "voiceId",
          "language",
          "patienceLevel",
          "maxCallDuration",
          "sendUserIdleReminders",
          "reminderAfterIdleTimeSeconds",
          "timezone",
          "isAgentAsBackupDisabled"
        ],
        "title": "CreateAgentResponseDTO"
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X POST 'https://services.leadconnectorhq.com/voice-ai/agents' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "locationId": "LOC123456789ABCDEF",
  "agentName": "Customer Support Agent",
  "businessName": "Acme Corporation",
  "welcomeMessage": "Hello! Thank you for calling Acme Corporation. How can I assist you today?",
  "agentPrompt": "You are a helpful customer service representative. Always be polite and professional.",
  "voiceId": "507f1f77bcf86cd799439011",
  "language": "en-US",
  "patienceLevel": "low",
  "maxCallDuration": 600,
  "sendUserIdleReminders": true,
  "reminderAfterIdleTimeSeconds": 5,
  "inboundNumber": "+1234567890",
  "numberPoolId": "pool_507f1f77bcf86cd799439011",
  "callEndWorkflowIds": [
    "wf_507f1f77bcf86cd799439011",
    "wf_507f1f77bcf86cd799439012"
  ],
  "sendPostCallNotificationTo": {
    "admins": true,
    "allUsers": false,
    "contactAssignedUser": false,
    "specificUsers": [
      "user_507f1f77bcf86cd799439011"
    ],
    "customEmails": [
      "manager@company.com"
    ]
  },
  "agentWorkingHours": [
    {
      "dayOfTheWeek": 1,
      "intervals": [
        {
          "startHour": 9,
          "startMinute": 0,
          "endHour": 17,
          "endMinute": 30
        }
      ]
    }
  ],
  "timezone": "America/New_York",
  "isAgentAsBackupDisabled": false,
  "translation": {
    "enabled": false,
    "language": "es"
  }
}'
```

**Node.js**

```javascript
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v3',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "locationId": "LOC123456789ABCDEF",
      "agentName": "Customer Support Agent",
      "businessName": "Acme Corporation",
      "welcomeMessage": "Hello! Thank you for calling Acme Corporation. How can I assist you today?",
      "agentPrompt": "You are a helpful customer service representative. Always be polite and professional.",
      "voiceId": "507f1f77bcf86cd799439011",
      "language": "en-US",
      "patienceLevel": "low",
      "maxCallDuration": 600,
      "sendUserIdleReminders": true,
      "reminderAfterIdleTimeSeconds": 5,
      "inboundNumber": "+1234567890",
      "numberPoolId": "pool_507f1f77bcf86cd799439011",
      "callEndWorkflowIds": [
        "wf_507f1f77bcf86cd799439011",
        "wf_507f1f77bcf86cd799439012"
      ],
      "sendPostCallNotificationTo": {
        "admins": true,
        "allUsers": false,
        "contactAssignedUser": false,
        "specificUsers": [
          "user_507f1f77bcf86cd799439011"
        ],
        "customEmails": [
          "manager@company.com"
        ]
      },
      "agentWorkingHours": [
        {
          "dayOfTheWeek": 1,
          "intervals": [
            {
              "startHour": 9,
              "startMinute": 0,
              "endHour": 17,
              "endMinute": 30
            }
          ]
        }
      ],
      "timezone": "America/New_York",
      "isAgentAsBackupDisabled": false,
      "translation": {
        "enabled": false,
        "language": "es"
      }
  })
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/voice-ai/agents', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/voice-ai/agents"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "v3"
}

payload = {
    "locationId": "LOC123456789ABCDEF",
    "agentName": "Customer Support Agent",
    "businessName": "Acme Corporation",
    "welcomeMessage": "Hello! Thank you for calling Acme Corporation. How can I assist you today?",
    "agentPrompt": "You are a helpful customer service representative. Always be polite and professional.",
    "voiceId": "507f1f77bcf86cd799439011",
    "language": "en-US",
    "patienceLevel": "low",
    "maxCallDuration": 600,
    "sendUserIdleReminders": true,
    "reminderAfterIdleTimeSeconds": 5,
    "inboundNumber": "+1234567890",
    "numberPoolId": "pool_507f1f77bcf86cd799439011",
    "callEndWorkflowIds": [
        "wf_507f1f77bcf86cd799439011",
        "wf_507f1f77bcf86cd799439012"
    ],
    "sendPostCallNotificationTo": {
        "admins": true,
        "allUsers": false,
        "contactAssignedUser": false,
        "specificUsers": [
            "user_507f1f77bcf86cd799439011"
        ],
        "customEmails": [
            "manager@company.com"
        ]
    },
    "agentWorkingHours": [
        {
            "dayOfTheWeek": 1,
            "intervals": [
                {
                    "startHour": 9,
                    "startMinute": 0,
                    "endHour": 17,
                    "endMinute": 30
                }
            ]
        }
    ],
    "timezone": "America/New_York",
    "isAgentAsBackupDisabled": false,
    "translation": {
        "enabled": false,
        "language": "es"
    }
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/voice-ai/agents',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => '{
  "locationId": "LOC123456789ABCDEF",
  "agentName": "Customer Support Agent",
  "businessName": "Acme Corporation",
  "welcomeMessage": "Hello! Thank you for calling Acme Corporation. How can I assist you today?",
  "agentPrompt": "You are a helpful customer service representative. Always be polite and professional.",
  "voiceId": "507f1f77bcf86cd799439011",
  "language": "en-US",
  "patienceLevel": "low",
  "maxCallDuration": 600,
  "sendUserIdleReminders": true,
  "reminderAfterIdleTimeSeconds": 5,
  "inboundNumber": "+1234567890",
  "numberPoolId": "pool_507f1f77bcf86cd799439011",
  "callEndWorkflowIds": [
    "wf_507f1f77bcf86cd799439011",
    "wf_507f1f77bcf86cd799439012"
  ],
  "sendPostCallNotificationTo": {
    "admins": true,
    "allUsers": false,
    "contactAssignedUser": false,
    "specificUsers": [
      "user_507f1f77bcf86cd799439011"
    ],
    "customEmails": [
      "manager@company.com"
    ]
  },
  "agentWorkingHours": [
    {
      "dayOfTheWeek": 1,
      "intervals": [
        {
          "startHour": 9,
          "startMinute": 0,
          "endHour": 17,
          "endMinute": 30
        }
      ]
    }
  ],
  "timezone": "America/New_York",
  "isAgentAsBackupDisabled": false,
  "translation": {
    "enabled": false,
    "language": "es"
  }
}',
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .post("https://services.leadconnectorhq.com/voice-ai/agents")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .header("Content-Type", "application/json")
  .body("{\"locationId\":\"LOC123456789ABCDEF\",\"agentName\":\"Customer Support Agent\",\"businessName\":\"Acme Corporation\",\"welcomeMessage\":\"Hello! Thank you for calling Acme Corporation. How can I assist you today?\",\"agentPrompt\":\"You are a helpful customer service representative. Always be polite and professional.\",\"voiceId\":\"507f1f77bcf86cd799439011\",\"language\":\"en-US\",\"patienceLevel\":\"low\",\"maxCallDuration\":600,\"sendUserIdleReminders\":true,\"reminderAfterIdleTimeSeconds\":5,\"inboundNumber\":\"+1234567890\",\"numberPoolId\":\"pool_507f1f77bcf86cd799439011\",\"callEndWorkflowIds\":[\"wf_507f1f77bcf86cd799439011\",\"wf_507f1f77bcf86cd799439012\"],\"sendPostCallNotificationTo\":{\"admins\":true,\"allUsers\":false,\"contactAssignedUser\":false,\"specificUsers\":[\"user_507f1f77bcf86cd799439011\"],\"customEmails\":[\"manager@company.com\"]},\"agentWorkingHours\":[{\"dayOfTheWeek\":1,\"intervals\":[{\"startHour\":9,\"startMinute\":0,\"endHour\":17,\"endMinute\":30}]}],\"timezone\":\"America/New_York\",\"isAgentAsBackupDisabled\":false,\"translation\":{\"enabled\":false,\"language\":\"es\"}}")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
  "strings"
)

func main() {
  url := "https://services.leadconnectorhq.com/voice-ai/agents"
  payload := strings.NewReader(`{
  "locationId": "LOC123456789ABCDEF",
  "agentName": "Customer Support Agent",
  "businessName": "Acme Corporation",
  "welcomeMessage": "Hello! Thank you for calling Acme Corporation. How can I assist you today?",
  "agentPrompt": "You are a helpful customer service representative. Always be polite and professional.",
  "voiceId": "507f1f77bcf86cd799439011",
  "language": "en-US",
  "patienceLevel": "low",
  "maxCallDuration": 600,
  "sendUserIdleReminders": true,
  "reminderAfterIdleTimeSeconds": 5,
  "inboundNumber": "+1234567890",
  "numberPoolId": "pool_507f1f77bcf86cd799439011",
  "callEndWorkflowIds": [
    "wf_507f1f77bcf86cd799439011",
    "wf_507f1f77bcf86cd799439012"
  ],
  "sendPostCallNotificationTo": {
    "admins": true,
    "allUsers": false,
    "contactAssignedUser": false,
    "specificUsers": [
      "user_507f1f77bcf86cd799439011"
    ],
    "customEmails": [
      "manager@company.com"
    ]
  },
  "agentWorkingHours": [
    {
      "dayOfTheWeek": 1,
      "intervals": [
        {
          "startHour": 9,
          "startMinute": 0,
          "endHour": 17,
          "endMinute": 30
        }
      ]
    }
  ],
  "timezone": "America/New_York",
  "isAgentAsBackupDisabled": false,
  "translation": {
    "enabled": false,
    "language": "es"
  }
}`)
  req, _ := http.NewRequest("POST", url, payload)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "v3")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/voice-ai/agents")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v3"
request["Content-Type"] = "application/json"
request.body = '{
  "locationId": "LOC123456789ABCDEF",
  "agentName": "Customer Support Agent",
  "businessName": "Acme Corporation",
  "welcomeMessage": "Hello! Thank you for calling Acme Corporation. How can I assist you today?",
  "agentPrompt": "You are a helpful customer service representative. Always be polite and professional.",
  "voiceId": "507f1f77bcf86cd799439011",
  "language": "en-US",
  "patienceLevel": "low",
  "maxCallDuration": 600,
  "sendUserIdleReminders": true,
  "reminderAfterIdleTimeSeconds": 5,
  "inboundNumber": "+1234567890",
  "numberPoolId": "pool_507f1f77bcf86cd799439011",
  "callEndWorkflowIds": [
    "wf_507f1f77bcf86cd799439011",
    "wf_507f1f77bcf86cd799439012"
  ],
  "sendPostCallNotificationTo": {
    "admins": true,
    "allUsers": false,
    "contactAssignedUser": false,
    "specificUsers": [
      "user_507f1f77bcf86cd799439011"
    ],
    "customEmails": [
      "manager@company.com"
    ]
  },
  "agentWorkingHours": [
    {
      "dayOfTheWeek": 1,
      "intervals": [
        {
          "startHour": 9,
          "startMinute": 0,
          "endHour": 17,
          "endMinute": 30
        }
      ]
    }
  ],
  "timezone": "America/New_York",
  "isAgentAsBackupDisabled": false,
  "translation": {
    "enabled": false,
    "language": "es"
  }
}'

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "v3"
}

$body = '{
  "locationId": "LOC123456789ABCDEF",
  "agentName": "Customer Support Agent",
  "businessName": "Acme Corporation",
  "welcomeMessage": "Hello! Thank you for calling Acme Corporation. How can I assist you today?",
  "agentPrompt": "You are a helpful customer service representative. Always be polite and professional.",
  "voiceId": "507f1f77bcf86cd799439011",
  "language": "en-US",
  "patienceLevel": "low",
  "maxCallDuration": 600,
  "sendUserIdleReminders": true,
  "reminderAfterIdleTimeSeconds": 5,
  "inboundNumber": "+1234567890",
  "numberPoolId": "pool_507f1f77bcf86cd799439011",
  "callEndWorkflowIds": [
    "wf_507f1f77bcf86cd799439011",
    "wf_507f1f77bcf86cd799439012"
  ],
  "sendPostCallNotificationTo": {
    "admins": true,
    "allUsers": false,
    "contactAssignedUser": false,
    "specificUsers": [
      "user_507f1f77bcf86cd799439011"
    ],
    "customEmails": [
      "manager@company.com"
    ]
  },
  "agentWorkingHours": [
    {
      "dayOfTheWeek": 1,
      "intervals": [
        {
          "startHour": 9,
          "startMinute": 0,
          "endHour": 17,
          "endMinute": 30
        }
      ]
    }
  ],
  "timezone": "America/New_York",
  "isAgentAsBackupDisabled": false,
  "translation": {
    "enabled": false,
    "language": "es"
  }
}'

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/voice-ai/agents' -Method 'POST' -Headers $headers -Body $body -ContentType 'application/json'
$response | ConvertTo-Json
```
