Skip to main content

Voicebot API

The Voicebot API lets you programmatically create bots from natural language, manage bot versions, and retrieve conversation data with transcripts, insights, and analytics.

Availability

This API is chargeable and not accessible to all Exotel customers by default. Contact your account manager to enable it.

Base URL

https://voicebot.in.exotel.com/voicebot/api/v2

Authentication

Authentication is handled at the gateway level (internal service authentication). Account context is passed via the {accountId} path parameter.

Error Codes

HTTP CodeMeaning
200Success
201Accepted / Created
400Invalid request
401Unauthorized
404Resource not found
429Rate limit exceeded
500Internal error

1. Build Bot via Text (Async)

Generate a voicebot from a natural language description. This is an asynchronous operation — you create a generation job and poll for completion.

Create Bot Generation Job

POST /accounts/{accountId}/bot-generation

Creates an async bot generation job from a text description or script.

Headers

HeaderValue
Content-Typemultipart/form-data

Parameters

ParameterTypeRequiredDescription
text_contentstringYesNatural language description or script for bot creation

Example Request

curl -X POST 'https://voicebot.in.exotel.com/voicebot/api/v2/accounts/{accountId}/bot-generation' \
-H 'Content-Type: multipart/form-data' \
-F 'text_content=Create a customer support bot that handles order inquiries and returns'

Example Response 201 Created

{
"id": "gen_abc123",
"content": {
"text_content": "Create a customer support bot that handles order inquiries and returns"
},
"status": "pending",
"account_id": "Exotel"
}

Get Bot Generation Status

GET /accounts/{accountId}/bot-generation/{generation_id}

Poll the status of a bot generation job.

Path Parameters

ParameterTypeRequiredDescription
accountIdstringYesYour Exotel account ID
generation_idstringYesThe generation job ID returned from the create call

Status Values

StatusDescription
pendingJob is queued
in_progressBot generation is underway
completedBot is ready — response includes bot_id
failedGeneration failed

Example Request

curl -X GET 'https://voicebot.in.exotel.com/voicebot/api/v2/accounts/{accountId}/bot-generation/{generation_id}'

Example Response 200 OK (completed)

{
"id": "gen_abc123",
"status": "completed",
"bot_id": "bot_xyz789",
"account_id": "Exotel"
}

2. Update Voicebot (Create New Version)

POST /accounts/{accountId}/voicebots/{botId}/versions

Create a new version of an existing voicebot. Supports partial updates — send only the fields you want to change.

Path Parameters

ParameterTypeRequiredDescription
accountIdstringYesYour Exotel account ID
botIdstringYesThe bot ID to update

Body Parameters

ParameterTypeRequiredDescription
source_versionstringYesBase version to create from (e.g., "v1")
dataobjectYesPartial or full bot configuration
version_descriptionstringNoDescription of changes in this version

Supported data fields:

FieldTypeDescription
namestringBot display name
enable_greeting_interruptionbooleanAllow users to interrupt the greeting
supported_languagesarrayList of supported language codes

Example Request

curl -X POST 'https://voicebot.in.exotel.com/voicebot/api/v2/accounts/{accountId}/voicebots/{botId}/versions' \
-H 'Content-Type: application/json' \
-d '{
"source_version": "v1",
"version_description": "Added Hindi support",
"data": {
"name": "Customer Support Bot",
"enable_greeting_interruption": true,
"supported_languages": ["en", "hi"]
}
}'

Example Response 200 OK

{
"bot_id": "bot_xyz789",
"version": "v2",
"date_created": "2026-04-08T10:30:00Z",
"name": "Customer Support Bot"
}

3. Get Voicebots

List All Bots

GET /accounts/{accountId}/voicebots

Retrieve a paginated list of all voicebots in your account.

Query Parameters

ParameterTypeDefaultDescription
limitinteger10Number of results per page (max 100)
offsetinteger0Pagination offset
startDatestringFilter by creation date (ISO 8601)
endDatestringFilter by creation date (ISO 8601)

Example Request

curl -X GET 'https://voicebot.in.exotel.com/voicebot/api/v2/accounts/{accountId}/voicebots?limit=20&offset=0'

Example Response 200 OK

{
"metadata": {
"total": 45,
"count": 20,
"offset": 0,
"limit": 20
},
"data": [
{
"bot_id": "bot_xyz789",
"name": "Customer Support Bot",
"version": "v2",
"date_created": "2026-04-08T10:30:00Z"
}
]
}

Get Single Bot

GET /accounts/{accountId}/voicebots/{botId}

Retrieve the latest active version of a specific bot.

Path Parameters

ParameterTypeRequiredDescription
accountIdstringYesYour Exotel account ID
botIdstringYesThe bot ID

Example Request

curl -X GET 'https://voicebot.in.exotel.com/voicebot/api/v2/accounts/{accountId}/voicebots/{botId}'

Example Response 200 OK

{
"bot_id": "bot_xyz789",
"name": "Customer Support Bot",
"version": "v2",
"enable_greeting_interruption": true,
"supported_languages": ["en", "hi"],
"date_created": "2026-04-08T10:30:00Z"
}

4. Bot Conversations & Analytics

List Conversations

GET /accounts/{accountId}/voicebot-conversations

Retrieve a list of all voicebot conversations. Transcripts and insights are only returned when explicitly requested via the fields parameter.

Query Parameters

ParameterTypeDescription
fieldsstringComma-separated list. Supports: transcript, insights
limitintegerNumber of results per page
offsetintegerPagination offset

Example Request

# Basic list (no transcripts)
curl -X GET 'https://voicebot.in.exotel.com/voicebot/api/v2/accounts/{accountId}/voicebot-conversations'

# With transcripts and insights
curl -X GET 'https://voicebot.in.exotel.com/voicebot/api/v2/accounts/{accountId}/voicebot-conversations?fields=transcript,insights'

Get Conversation by ID

GET /accounts/{accountId}/voicebot-conversations/{conversation_id}

Retrieve full details of a specific conversation, including call metadata, speaker-segmented transcript, AI-generated insights, recording URL, and outcome.

Path Parameters

ParameterTypeRequiredDescription
accountIdstringYesYour Exotel account ID
conversation_idstringYesThe conversation ID

Example Request

curl -X GET 'https://voicebot.in.exotel.com/voicebot/api/v2/accounts/{accountId}/voicebot-conversations/{conversation_id}'

Example Response 200 OK

{
"conversation_id": "conv_abc123",
"bot_id": "bot_xyz789",
"call_metadata": {
"from": "+919876543210",
"to": "+911234567890",
"duration_seconds": 180,
"recording_url": "https://..."
},
"transcript": [
{
"speaker": "bot",
"text": "Hello! How can I help you today?",
"timestamp": "00:00:01"
},
{
"speaker": "user",
"text": "I want to check my order status",
"timestamp": "00:00:04"
}
],
"insights": {
"sentiment": "neutral",
"intent": "order_status_inquiry",
"outcome": "resolved"
}
}

5. Assistant Versioning API

POST /api/v2/accounts/{tenant_id}/assistants/{assistant_id}/versions

Advanced versioning endpoint for assistants — supports instruction updates, LLM configuration, multi-agent definitions, and persona association.

Path Parameters

ParameterTypeRequiredDescription
tenant_idstringYesYour tenant/account ID
assistant_idstringYesThe assistant ID

Body Parameters

ParameterTypeRequiredDescription
source_versionstringYesBase version to branch from
mark_as_stablebooleanNoMark this version as the stable/active version
instructionstringNoSystem prompt for the assistant
llm_configobjectNoModel and inference configuration
agentsarrayNoSub-agent definitions with roles

Example Request

curl -X POST 'https://voicebot.in.exotel.com/api/v2/accounts/{tenant_id}/assistants/{assistant_id}/versions' \
-H 'Content-Type: application/json' \
-d '{
"source_version": "v1",
"mark_as_stable": true,
"instruction": "You are a helpful customer support assistant for Acme Corp.",
"llm_config": {
"model": "gpt-4",
"temperature": 0.7,
"max_tokens": 1024
},
"agents": [
{
"role": "order_handler",
"instruction": "Handle order-related queries"
},
{
"role": "returns_handler",
"instruction": "Process return and refund requests"
}
]
}'

Example Response 200 OK

{
"assistant_id": "asst_abc123",
"version": "v2",
"mark_as_stable": true,
"date_created": "2026-04-08T12:00:00Z"
}