Create Agent
Create a new AI agent with voice, language, model, and behavior configuration.
POST
Create Agent
Create a new AI voice agent with a single API call. Configure the voice, language model, call behavior, voicemail handling, and webhook notifications.
Endpoint
POST https://crmwebhook.com/functions/v1/crm-api/create-agent
Headers
| Header | Value | Required |
|---|---|---|
x-api-key | cfy_your_api_key | Yes |
Content-Type | application/json | Yes |
Request Body
{
"name": "Sales Bot",
"voice_id": "Sulafat",
"max_duration": 30,
"temperature": 0.7,
"silence_timeout": 5,
"voice_activity_timeout": 1000,
"llm_model": "gpt-4o-mini",
"language": "en-US",
"background_noise": true,
"background_type": "call_center",
"voicemail_detection": true,
"voicemail_type": "leave_message",
"voicemail_message": "Hi, please call us back.",
"backcchanneling": true,
"is_active": true,
"organization_id": "88e7bb59-42b2-4f8f-b818-83dfc129dd1b",
"sub_account_id": "d457c95d-de9e-42f3-9e21-530c5cd4caa1",
"webhook": true,
"webhook_url": "https://example.com/webhook",
"recording": true
}
Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Required | Agent display name |
voice_id | string | Required | Voice model (“Sulafat”, “Aria”, “Ravi”, etc.) |
max_duration | number | Required | Max call length in minutes |
temperature | number | Required | LLM creativity (0.0 = precise, 1.0 = creative) |
silence_timeout | number | Required | Seconds of silence before AI speaks |
voice_activity_timeout | number | Required | Voice detection threshold in ms |
llm_model | string | Required | AI model to use (see table below) |
language | string | Required | Language code (e.g., “en-US”) |
background_noise | boolean | Required | Enable ambient background audio |
background_type | string | Conditional | Background audio type. Required when background_noise=true |
voicemail_detection | boolean | Required | Auto-detect voicemail |
voicemail_type | string | Conditional | Action on voicemail (“leave_message” or “hangup”). Required when voicemail_detection=true |
voicemail_message | string | Conditional | Voicemail message text. Required when voicemail_type=leave_message |
backcchanneling | boolean | Required | Verbal acknowledgments during calls (“mmhm”, “right”) |
is_active | boolean | Optional | Make agent live immediately. Defaults to true |
organization_id | string | Required | Your organization UUID |
sub_account_id | string | Required | Target sub-account UUID |
webhook | boolean | Required | Enable post-call webhook |
webhook_url | string | Conditional | Webhook URL for call data. Required when webhook=true |
recording | boolean | Required | Record calls |
Example Request
curl -X POST \
https://crmwebhook.com/functions/v1/crm-api/create-agent \
-H "x-api-key: cfy_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Sales Bot",
"voice_id": "Sulafat",
"max_duration": 30,
"temperature": 0.7,
"silence_timeout": 5,
"voice_activity_timeout": 1000,
"llm_model": "gpt-4o-mini",
"language": "en-US",
"background_noise": false,
"voicemail_detection": false,
"backcchanneling": true,
"organization_id": "88e7bb59-42b2-4f8f-b818-83dfc129dd1b",
"sub_account_id": "d457c95d-de9e-42f3-9e21-530c5cd4caa1",
"webhook": false,
"recording": true
}'
Response Shape
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Sales Bot",
"is_active": true,
"created_at": "2026-04-17T10:00:00Z"
}
Response Codes
| Status | Meaning |
|---|---|
201 | Agent created successfully |
400 | Validation error — missing or invalid fields |
401 | Unauthorized — invalid or missing API key |
403 | Organization/sub-account mismatch with API key scope |
Available LLM Models
Models are available based on which providers are connected in Settings > Integrations > LLM Providers.
OpenAI:
| Model ID | Name |
|---|---|
gpt-5.1 | GPT-5.1 |
gpt-5 | GPT-5 |
gpt-4.1 | GPT-4.1 |
gpt-4.1-mini | GPT-4.1 Mini |
gpt-4.1-nano | GPT-4.1 Nano |
gpt-4o | GPT-4o |
gpt-4o-mini | GPT-4o Mini |
Anthropic:
| Model ID | Name |
|---|---|
claude-opus-4.5 | Claude Opus 4.5 |
claude-opus-4 | Claude Opus 4 |
claude-sonnet-4 | Claude Sonnet 4 |
claude-3.5-sonnet | Claude 3.5 Sonnet |
claude-3.5-haiku | Claude 3.5 Haiku |
claude-3-opus | Claude 3 Opus |
claude-3-haiku | Claude 3 Haiku |
Google:
| Model ID | Name |
|---|---|
gemini-2.5-pro | Gemini 2.5 Pro |
gemini-2.5-flash | Gemini 2.5 Flash |
gemini-2.5-flash-lite | Gemini 2.5 Flash Lite |
gemini-2.0-flash | Gemini 2.0 Flash |
gemini-1.5-pro | Gemini 1.5 Pro |
gemini-1.5-flash | Gemini 1.5 Flash |
DeepSeek:
| Model ID | Name |
|---|---|
deepseek-chat | DeepSeek V3 |
deepseek-reasoner | DeepSeek R1 |
deepseek-coder | DeepSeek Coder |
Grok:
| Model ID | Name |
|---|---|
grok-3 | Grok 3 |
grok-3-mini | Grok 3 Mini |
grok-2 | Grok 2 |
grok-2-vision | Grok 2 Vision |
Can I create an agent without making it active?
Yes. Set "is_active": false and the agent will be created but won’t accept calls until you activate it via the Update Agent endpoint.
What are the minimum required fields?
All fields marked Required in the table above must be provided. The only optional field is is_active (defaults to true). Conditional fields must be included when their condition is met.