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

HeaderValueRequired
x-api-keycfy_your_api_keyYes
Content-Typeapplication/jsonYes

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

FieldTypeRequiredDescription
namestringRequiredAgent display name
voice_idstringRequiredVoice model (“Sulafat”, “Aria”, “Ravi”, etc.)
max_durationnumberRequiredMax call length in minutes
temperaturenumberRequiredLLM creativity (0.0 = precise, 1.0 = creative)
silence_timeoutnumberRequiredSeconds of silence before AI speaks
voice_activity_timeoutnumberRequiredVoice detection threshold in ms
llm_modelstringRequiredAI model to use (see table below)
languagestringRequiredLanguage code (e.g., “en-US”)
background_noisebooleanRequiredEnable ambient background audio
background_typestringConditionalBackground audio type. Required when background_noise=true
voicemail_detectionbooleanRequiredAuto-detect voicemail
voicemail_typestringConditionalAction on voicemail (“leave_message” or “hangup”). Required when voicemail_detection=true
voicemail_messagestringConditionalVoicemail message text. Required when voicemail_type=leave_message
backcchannelingbooleanRequiredVerbal acknowledgments during calls (“mmhm”, “right”)
is_activebooleanOptionalMake agent live immediately. Defaults to true
organization_idstringRequiredYour organization UUID
sub_account_idstringRequiredTarget sub-account UUID
webhookbooleanRequiredEnable post-call webhook
webhook_urlstringConditionalWebhook URL for call data. Required when webhook=true
recordingbooleanRequiredRecord 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

StatusMeaning
201Agent created successfully
400Validation error — missing or invalid fields
401Unauthorized — invalid or missing API key
403Organization/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 IDName
gpt-5.1GPT-5.1
gpt-5GPT-5
gpt-4.1GPT-4.1
gpt-4.1-miniGPT-4.1 Mini
gpt-4.1-nanoGPT-4.1 Nano
gpt-4oGPT-4o
gpt-4o-miniGPT-4o Mini

Anthropic:

Model IDName
claude-opus-4.5Claude Opus 4.5
claude-opus-4Claude Opus 4
claude-sonnet-4Claude Sonnet 4
claude-3.5-sonnetClaude 3.5 Sonnet
claude-3.5-haikuClaude 3.5 Haiku
claude-3-opusClaude 3 Opus
claude-3-haikuClaude 3 Haiku

Google:

Model IDName
gemini-2.5-proGemini 2.5 Pro
gemini-2.5-flashGemini 2.5 Flash
gemini-2.5-flash-liteGemini 2.5 Flash Lite
gemini-2.0-flashGemini 2.0 Flash
gemini-1.5-proGemini 1.5 Pro
gemini-1.5-flashGemini 1.5 Flash

DeepSeek:

Model IDName
deepseek-chatDeepSeek V3
deepseek-reasonerDeepSeek R1
deepseek-coderDeepSeek Coder

Grok:

Model IDName
grok-3Grok 3
grok-3-miniGrok 3 Mini
grok-2Grok 2
grok-2-visionGrok 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.

© 2026 Centerfy AI. All rights reserved.