Skip to main content

Agents

Agents are the core entity in VOCALS. Each agent defines a conversational AI persona with its own STT, LLM, and TTS provider configuration, system prompt, voice settings, and phone number assignments.

List Agents

GET /agents

Returns all agents for the current tenant, ordered by name.

Response

[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Support Agent",
"active_stt_provider_id": "...",
"active_llm_provider_id": "...",
"active_tts_provider_id": "...",
"is_active": true,
"phone_count": 2,
"has_webhook": true,
"created_at": "2026-01-15T10:30:00Z",
"updated_at": "2026-02-20T14:00:00Z"
}
]

Response Fields (List)

FieldTypeDescription
iduuidAgent ID
namestringAgent display name
active_stt_provider_iduuid | nullAssigned STT provider
active_llm_provider_iduuid | nullAssigned LLM provider
active_tts_provider_iduuid | nullAssigned TTS provider
is_activebooleanWhether the agent is active
phone_countintegerNumber of assigned phone numbers
has_webhookbooleanWhether a webhook URL is configured
created_atdatetimeCreation timestamp
updated_atdatetimeLast update timestamp

Get Agent

GET /agents/{agent_id}

Returns full agent detail including phone number assignments.

Response

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Support Agent",
"active_stt_provider_id": "...",
"active_llm_provider_id": "...",
"active_tts_provider_id": "...",
"system_prompt": "You are a helpful support agent...",
"welcome_message": "Hello! How can I help you today?",
"voice_id": "rachel",
"language": "en",
"silence_threshold": 0.5,
"max_call_duration": 300,
"barge_in_sensitivity": "medium",
"interruptible": true,
"welcome_interruptible": false,
"amd_enabled": false,
"tts_config": { "speed": 1.0 },
"webhook_url": "https://example.com/webhook",
"webhook_secret": "whsec_...",
"is_active": true,
"phone_numbers": [
{
"id": "...",
"phone_number": "+15551234567",
"sip_config_id": "..."
}
],
"created_at": "2026-01-15T10:30:00Z",
"updated_at": "2026-02-20T14:00:00Z"
}

Response Fields (Detail)

FieldTypeDescription
iduuidAgent ID
namestringAgent display name
active_stt_provider_iduuid | nullAssigned STT provider
active_llm_provider_iduuid | nullAssigned LLM provider
active_tts_provider_iduuid | nullAssigned TTS provider
system_promptstring | nullSystem prompt sent to the LLM
welcome_messagestring | nullMessage spoken at call start
voice_idstring | nullTTS voice identifier
languagestringLanguage code (e.g. en, es)
silence_thresholdfloatSeconds of silence before end-of-turn detection
max_call_durationintegerMax call length in seconds (0 = unlimited)
barge_in_sensitivitystringlow, medium, or high
interruptiblebooleanWhether the agent can be interrupted mid-speech
welcome_interruptiblebooleanWhether the welcome message can be interrupted
amd_enabledbooleanAnswering machine detection for outbound calls
tts_configobject | nullProvider-specific TTS settings
webhook_urlstring | nullURL for call event webhooks
webhook_secretstring | nullSecret for webhook signature verification
is_activebooleanWhether the agent is active
phone_numbersarrayAssigned phone numbers with SIP config references
created_atdatetimeCreation timestamp
updated_atdatetimeLast update timestamp

Create Agent

POST /agents

Request Body

{
"name": "Sales Agent",
"active_stt_provider_id": "uuid-of-stt-provider",
"active_llm_provider_id": "uuid-of-llm-provider",
"active_tts_provider_id": "uuid-of-tts-provider",
"system_prompt": "You are a sales representative...",
"welcome_message": "Hi there! Thanks for calling.",
"voice_id": "rachel",
"language": "en",
"silence_threshold": 0.5,
"max_call_duration": 600,
"barge_in_sensitivity": "medium",
"interruptible": true,
"welcome_interruptible": false,
"amd_enabled": false,
"tts_config": { "speed": 1.0 },
"webhook_url": "https://example.com/webhook",
"is_active": true,
"phone_numbers": [
{
"phone_number": "+15551234567",
"sip_config_id": "uuid-of-sip-config"
}
]
}

Request Fields

FieldTypeRequiredDefaultDescription
namestringYes--Agent display name
active_stt_provider_iduuidNonullSTT provider to use
active_llm_provider_iduuidNonullLLM provider to use
active_tts_provider_iduuidNonullTTS provider to use
system_promptstringNonullSystem prompt for the LLM
welcome_messagestringNonullMessage spoken when call starts
voice_idstringNonullTTS voice identifier
languagestringNo"en"Language code
silence_thresholdfloatNo0.5Silence detection threshold (seconds)
max_call_durationintegerNo0Max call duration (0 = unlimited)
barge_in_sensitivitystringNo"medium"Barge-in sensitivity level
interruptiblebooleanNotrueAllow mid-speech interruption
welcome_interruptiblebooleanNofalseAllow welcome message interruption
amd_enabledbooleanNofalseEnable answering machine detection
tts_configobjectNonullExtra TTS provider config
webhook_urlstringNonullWebhook endpoint URL
webhook_secretstringNonullWebhook signing secret
is_activebooleanNotrueWhether agent is active
phone_numbersarrayNonullPhone number assignments

Response

201 Created -- Returns the full AgentResponse object.

Provider IDs are validated against your tenant's configured providers. If a provider ID is invalid or belongs to the wrong type (e.g. passing an LLM provider ID as the STT provider), the API returns 400 Bad Request.

Update Agent

PUT /agents/{agent_id}

Partial updates are supported. Only include the fields you want to change.

Request Body

{
"name": "Updated Agent Name",
"system_prompt": "New system prompt...",
"is_active": false
}

All fields from the create schema are accepted, but none are required.

Response

200 OK -- Returns the updated AgentResponse object.

Delete Agent

DELETE /agents/{agent_id}

Permanently deletes an agent and its phone number assignments.

Response

204 No Content -- No response body.

Get Agent by Phone Number

GET /agents/by-phone/{phone}

Look up the agent assigned to a specific phone number. Useful for routing logic.

Path Parameters

ParameterTypeDescription
phonestringPhone number in E.164 format (e.g. +15551234567)

Response

Returns the full AgentResponse object, or 404 if no agent is assigned to that number.