Create an agent
create an AI agent.
POST
https://api.centerfy.ai/webhooks/inbound/agents Headers
| Header | Required | Value | Description |
|---|---|---|---|
x-api-key | Yes | your sub-account API key (cfy_…) | API key; or Authorization: Bearer <key>. |
Content-Type | Yes | application/json | the request body is JSON. |
Body parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | the agent’s display name (non-empty string, required). |
voice_id | string | Yes | — | the voice — accepts a friendly voice name (e.g. “Marissa”) or a raw voice id (e.g. “Sulafat”). Required, non-empty string. |
llm_model | string | Yes | — | the LLM model to use (non-empty string, required). |
language | string | Yes | — | the agent language code (non-empty string, required). |
max_duration | number | Yes | — | maximum call duration (required number). |
temperature | number | Yes | — | LLM sampling temperature (required number). |
silence_timeout | number | Yes | — | silence timeout (required number). |
voice_activity_timeout | number | Yes | — | voice-activity timeout (required number). The alt spelling ‘voice_activbity_timeout’ is also accepted in its place. |
background_noise | boolean | Yes | — | whether ambient background noise is enabled (required boolean). When true, ‘background_type’ is required and must be one of: call_center, coffee_shop, conventional_hall. |
voicemail_detection | boolean | Yes | — | whether voicemail detection is enabled (required boolean). When true, ‘voicemail_type’ is required (leave_message | hangup); when voicemail_type=‘leave_message’, ‘voicemail_message’ is required. |
webhook | boolean | Yes | — | whether an outbound webhook is enabled (required boolean). When true, ‘webhook_url’ is required. |
recording | boolean | Yes | — | whether call recording is enabled (required boolean). |
backcchanneling | boolean | Yes | — | whether backchanneling is enabled (required boolean). The alt spelling ‘backchanneling’ is also accepted in its place. |
background_type | string | No | — | ambient noise profile; required only when background_noise=true. One of: call_center, coffee_shop, conventional_hall. |
voicemail_type | string | No | — | voicemail action; required only when voicemail_detection=true. One of: leave_message, hangup. |
voicemail_message | string | No | — | the message left on voicemail; required only when voicemail_type=‘leave_message’. |
webhook_url | string | No | — | the outbound webhook URL; required only when webhook=true. |
system_prompt | string | No | — | the agent’s instructions; if omitted, a standard default prompt is applied. |
is_active | boolean | No | — | whether the agent is active; defaults to true when omitted. |
Request body
{
"name": "Front Desk Assistant",
"voice_id": "Marissa",
"llm_model": "gpt-4o",
"language": "en",
"system_prompt": "You are the friendly front-desk assistant for Acme Clinic.",
"max_duration": 600,
"temperature": 0.7,
"silence_timeout": 10,
"voice_activity_timeout": 5,
"background_noise": true,
"background_type": "call_center",
"voicemail_detection": true,
"voicemail_type": "leave_message",
"voicemail_message": "Sorry we missed you — please leave a message and we'll call back.",
"backcchanneling": true,
"webhook": true,
"webhook_url": "https://example.com/agent-events",
"recording": true,
"is_active": true
}Example
curl -X POST "https://api.centerfy.ai/webhooks/inbound/agents" \
-H "x-api-key: $CENTERFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Front Desk Assistant",
"voice_id": "Marissa",
"llm_model": "gpt-4o",
"language": "en",
"system_prompt": "You are the friendly front-desk assistant for Acme Clinic.",
"max_duration": 600,
"temperature": 0.7,
"silence_timeout": 10,
"voice_activity_timeout": 5,
"background_noise": true,
"background_type": "call_center",
"voicemail_detection": true,
"voicemail_type": "leave_message",
"voicemail_message": "Sorry we missed you — please leave a message and we'\''ll call back.",
"backcchanneling": true,
"webhook": true,
"webhook_url": "https://example.com/agent-events",
"recording": true,
"is_active": true
}' import { CenterfyClient } from "@centerfy/sdk";
const centerfy = new CenterfyClient({ apiKey: process.env.CENTERFY_API_KEY! });
const result = await centerfy.agents.create({
"name": "Front Desk Assistant",
"voice_id": "Marissa",
"llm_model": "gpt-4o",
"language": "en",
"system_prompt": "You are the friendly front-desk assistant for Acme Clinic.",
"max_duration": 600,
"temperature": 0.7,
"silence_timeout": 10,
"voice_activity_timeout": 5,
"background_noise": true,
"background_type": "call_center",
"voicemail_detection": true,
"voicemail_type": "leave_message",
"voicemail_message": "Sorry we missed you — please leave a message and we'll call back.",
"backcchanneling": true,
"webhook": true,
"webhook_url": "https://example.com/agent-events",
"recording": true,
"is_active": true
});
console.log(result); centerfy agents create '{"name":"Front Desk Assistant","voice_id":"Marissa","llm_model":"gpt-4o","language":"en","system_prompt":"You are the friendly front-desk assistant for Acme Clinic.","max_duration":600,"temperature":0.7,"silence_timeout":10,"voice_activity_timeout":5,"background_noise":true,"background_type":"call_center","voicemail_detection":true,"voicemail_type":"leave_message","voicemail_message":"Sorry we missed you — please leave a message and we'\''ll call back.","backcchanneling":true,"webhook":true,"webhook_url":"https://example.com/agent-events","recording":true,"is_active":true}' MCP tool: centerfy_agents_create (see MCP server)
Response
{
"status": "success",
"agent": {
"id": "f1e2d3c4-0000-4000-8000-000000000001",
"name": "Front Desk Assistant",
"system_prompt": "You are the friendly front-desk assistant for Acme Clinic.",
"is_active": true,
"created_at": "2026-06-12T10:20:00.000Z"
}
}Notes
Errors: 400 (validation — missing or invalid required fields, or conditional rules not met), 401 (unauthenticated), 500 (insert error). Success is 201.