API Reference

Complete guide for managing leads, initiating AI-powered calls, and configuring webhooks

Environment Setup

Quick Start

Set these environment variables before making API calls

Base URL

https://voice-ai-admin-api-762279639608.asia-south1.run.app/api/v1

API Key

your-api-key-here

Authentication

API Key Authentication

All API requests must be authenticated using an API key. The API key should be included in the request header.

X-API-Key: <your-api-key>

Getting Your API Key

For existing accounts and new accounts, retrieve your API key from the admin panel dashboard → profile settings. Can be used for all API calls.

Lead Management

Add Lead

POST/api/v1/leads/🔒 Auth Required

Create a new lead associated with an AI agent. The lead will be available for calling once created.

Request Body

NameTypeDescription
agent_idrequired
uuidUUID of the agent that will call this lead
first_namerequired
stringLead's full name
phone_e164required
stringPhone number in E.164 format (e.g., +14155552671 for US, +919412792855 for India)
custom_fields
objectAdditional custom data (email, company, etc.)

Response (200 OK)

NameTypeDescription
id
uuidUnique lead identifier
agent_id
uuidAssociated agent ID
status
stringLead status (new, contacted, scheduled, etc.)
is_verified
booleanWhether the phone number is verified
created_at
datetimeTimestamp when lead was created

Important Note

  • Phone numbers must be in E.164 format
  • Ensure the trailing slash in the endpoint: /api/v1/leads/
  • Indian numbers are auto-verified with "company_verified" method
Request Example
curl -X POST "https://voice-ai-admin-api-762279639608.asia-south1.run.app/api/v1/leads/" \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "b0b52c8c-b5c8-474a-a9fb-109473f436b4",
    "first_name": "John Doe",
    "phone_e164": "+14155552671",
    "custom_fields": {
      "email": "john@example.com",
      "company": "ABC Corp"
    }
  }'

Get Lead

GET/api/v1/leads/{lead_id}🔒 Auth Required

Retrieve detailed information about a specific lead by its UUID.

Path Parameters

NameTypeDescription
lead_idrequired
uuidUUID of the lead to retrieve

Response (200 OK)

NameTypeDescription
id
uuidUnique lead identifier
agent_id
uuidAssociated agent ID
first_name
stringLead's full name
phone_e164
stringPhone number in E.164 format
status
stringLead status (new, in_progress, done, stopped)
custom_fields
objectCustom data associated with the lead
schedule_at
datetimeScheduled call time
attempts_count
numberNumber of call attempts
disposition
stringCall disposition
created_at
datetimeTimestamp when lead was created
updated_at
datetimeTimestamp when lead was last updated
Request Example
curl -X GET "https://voice-ai-admin-api-762279639608.asia-south1.run.app/api/v1/leads/{lead_id}" \
  -H "X-API-Key: your-api-key"

List Leads

GET/api/v1/leads🔒 Auth Required

Retrieve a paginated list of leads with optional filtering by agent, status, or search term.

Query Parameters

NameTypeDescription
agent_id
uuidFilter by agent UUID
status_filter
stringFilter by status (new, in_progress, done, stopped)
search
stringSearch by name or phone number
page
numberPage number (default: 1)
per_page
numberItems per page (default: 10, max: 100)

Response (200 OK)

NameTypeDescription
leads
arrayArray of lead objects
total
numberTotal number of leads matching filters
page
numberCurrent page number
per_page
numberItems per page
Request Example
curl -X GET "https://voice-ai-admin-api-762279639608.asia-south1.run.app/api/v1/leads?agent_id=your-agent-uuid&status_filter=new&page=1&per_page=20" \
  -H "X-API-Key: your-api-key"

Update Lead

PUT/api/v1/leads/{lead_id}🔒 Auth Required

Update an existing lead's information. All fields are optional - only include fields you want to update.

Path Parameters

NameTypeDescription
lead_idrequired
uuidUUID of the lead to update

Request Body (all fields optional)

NameTypeDescription
first_name
stringLead's full name
phone_e164
stringPhone number in E.164 format
status
stringLead status (new, in_progress, done, stopped)
custom_fields
objectCustom data (email, company, etc.)
schedule_at
datetimeScheduled call time (ISO 8601 format)
disposition
stringCall disposition (not_interested, hung_up, completed, no_answer)

Response (200 OK)

NameTypeDescription
id
uuidLead identifier
agent_id
uuidAssociated agent ID
first_name
stringUpdated lead name
status
stringUpdated status
updated_at
datetimeTimestamp of update
Request Example
curl -X PUT "https://voice-ai-admin-api-762279639608.asia-south1.run.app/api/v1/leads/{lead_id}" \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "Jane Doe",
    "status": "in_progress"
  }'

Delete Lead

DELETE/api/v1/leads/{lead_id}🔒 Auth Required

Permanently delete a lead from the system. This action cannot be undone.

Path Parameters

NameTypeDescription
lead_idrequired
uuidUUID of the lead to delete

Response (200 OK)

NameTypeDescription
message
stringSuccess message: "Lead deleted successfully"

Warning

This action is permanent and cannot be undone. Make sure you have the correct lead_id before proceeding.
Request Example
curl -X DELETE "https://voice-ai-admin-api-762279639608.asia-south1.run.app/api/v1/leads/{lead_id}" \
  -H "X-API-Key: your-api-key"

Call Management

Initiate Call

POST/api/v1/calls/schedule🔒 Auth Required

Schedule and initiate an AI-powered voice call to a lead. The call will be executed asynchronously.

Request Body

NameTypeDescription
lead_idrequired
uuidUUID of the lead to call

Response (200 OK)

NameTypeDescription
message
stringSuccess message (e.g., "Lead scheduled successfully")

Call Initiated

The call will be processed asynchronously. Check the calls dashboard or use webhooks to track call status.

Troubleshooting

If you receive "Failed to initiate call", check:
  • Agent configuration is complete with voice settings
  • Lead exists and is in valid state
  • Retell AI integration is properly configured
Request Example
curl -X POST "https://voice-ai-admin-api-762279639608.asia-south1.run.app/api/v1/calls/schedule" \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "lead_id": "b0160b3d-9eb5-45e2-abd6-8b6b785fe941"
  }'

Get Call History

GET/api/v1/calls/history🔒 Auth Required

Retrieve paginated call history with optional filtering by agent, outcome, date range, or search term.

Query Parameters

NameTypeDescription
agent_id
uuidFilter by agent UUID
outcome
stringFilter by outcome (answered, no_answer, failed)
start_date
stringFilter by start date (YYYY-MM-DD)
end_date
stringFilter by end date (YYYY-MM-DD)
search
stringSearch by lead name or phone
page
numberPage number (default: 1)
per_page
numberItems per page (default: 10, max: 100)

Response (200 OK)

NameTypeDescription
calls
arrayArray of call/interaction objects
calls[].id
uuidInteraction UUID
calls[].lead_id
uuidAssociated lead UUID
calls[].agent_id
uuidAgent UUID
calls[].status
stringCall status (completed, in_progress, failed)
calls[].outcome
stringCall outcome (answered, no_answer, failed)
calls[].duration_seconds
numberCall duration in seconds
calls[].transcript_url
stringURL to call transcript
calls[].summary
stringAI-generated call summary
calls[].ai_insights
objectAI analysis and insights
total
numberTotal number of calls
page
numberCurrent page number
per_page
numberItems per page
Request Example
curl -X GET "https://voice-ai-admin-api-762279639608.asia-south1.run.app/api/v1/calls/history?agent_id=your-agent-uuid&outcome=answered&page=1&per_page=20" \
  -H "X-API-Key: your-api-key"

Get Call Metrics

GET/api/v1/calls/metrics🔒 Auth Required

Retrieve aggregated call statistics and metrics with optional filtering by agent and date range.

Query Parameters

NameTypeDescription
agent_id
uuidFilter by agent UUID
start_date
stringFilter by start date (YYYY-MM-DD)
end_date
stringFilter by end date (YYYY-MM-DD)

Response (200 OK)

NameTypeDescription
total_calls
numberTotal number of calls made
answered_calls
numberNumber of answered calls
no_answer_calls
numberNumber of unanswered calls
failed_calls
numberNumber of failed calls
pickup_rate
numberPickup rate percentage (0-100)
average_attempts_per_lead
numberAverage number of attempts per lead
active_agents
numberNumber of active agents

Metrics Calculation

Pickup rate is calculated as (answered_calls / total_calls) × 100. All metrics respect the applied filters.
Request Example
curl -X GET "https://voice-ai-admin-api-762279639608.asia-south1.run.app/api/v1/calls/metrics?agent_id=your-agent-uuid&start_date=2025-01-01&end_date=2025-01-31" \
  -H "X-API-Key: your-api-key"

Webhook Management

Configure Webhook

PUT/api/v1/webhooks/config🔒 Auth Required

Configure webhook URL and event subscriptions for receiving real-time call status updates.

Request Body

NameTypeDescription
webhook_urlrequired
stringYour endpoint URL to receive webhook events
enabled
booleanEnable/disable webhook (default: true)
events
arrayArray of event types to subscribe to (default: all events)

Response (200 OK)

NameTypeDescription
webhook_url
stringConfigured webhook URL
enabled
booleanWebhook enabled status
events
arraySubscribed event types

Available Events

  • call.started - Triggered when a call begins
  • call.completed - Triggered when a call completes successfully
  • call.failed - Triggered when a call fails

Webhook Delivery

Failed deliveries will be retried at 1min, 5min, and 15min intervals (max 4 attempts). Ensure your endpoint returns 2xx status codes.
Request Example
curl -X PUT "https://voice-ai-admin-api-762279639608.asia-south1.run.app/api/v1/webhooks/config" \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "webhook_url": "https://your-domain.com/webhook",
    "enabled": true,
    "events": ["call.started", "call.completed", "call.failed"]
  }'

Get Webhook Configuration

GET/api/v1/webhooks/config🔒 Auth Required

Retrieve the current webhook configuration including URL, enabled status, and subscribed events.

Response (200 OK)

NameTypeDescription
webhook_url
stringConfigured webhook URL
enabled
booleanWhether webhook is enabled
events
arrayArray of subscribed event types
Request Example
curl -X GET "https://voice-ai-admin-api-762279639608.asia-south1.run.app/api/v1/webhooks/config" \
  -H "X-API-Key: your-api-key"

Delete Webhook Configuration

DELETE/api/v1/webhooks/config🔒 Auth Required

Remove the webhook configuration. This will stop all webhook event deliveries.

Response (200 OK)

NameTypeDescription
message
stringSuccess message: "Webhook configuration deleted successfully"
Request Example
curl -X DELETE "https://voice-ai-admin-api-762279639608.asia-south1.run.app/api/v1/webhooks/config" \
  -H "X-API-Key: your-api-key"

Send Test Webhook

POST/api/v1/webhooks/test🔒 Auth Required

Send a test webhook event to verify your webhook endpoint is properly configured and receiving events.

Request Body

NameTypeDescription
event_type
stringEvent type to test (call.started, call.completed, call.failed). Default: call.completed

Response (200 OK)

NameTypeDescription
status
stringTest status (success/failure)
message
stringDescriptive message
response_status
numberHTTP status code from your webhook endpoint

Testing Tip

Use this endpoint to verify your webhook integration before going live. Check that your endpoint returns 200 status code.
Request Example
curl -X POST "https://voice-ai-admin-api-762279639608.asia-south1.run.app/api/v1/webhooks/test" \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"event_type": "call.completed"}'

Get Webhook Logs

GET/api/v1/webhooks/logs🔒 Auth Required

Retrieve webhook delivery logs for debugging and monitoring webhook event deliveries.

Query Parameters

NameTypeDescription
limit
numberNumber of logs to retrieve (default: 50, max: 200)
offset
numberPagination offset (default: 0)
event_type
stringFilter by event type
delivery_status
stringFilter by delivery status (pending, success, failed, retrying)

Response (200 OK)

NameTypeDescription
total
numberTotal number of logs
limit
numberNumber of logs returned
offset
numberPagination offset
logs
arrayArray of webhook log entries
logs[].event_type
stringType of event sent
logs[].call_id
uuidAssociated call/interaction UUID
logs[].delivery_status
stringDelivery status (pending, success, failed, retrying)
logs[].http_status
numberHTTP status code from webhook endpoint
logs[].sent_at
datetimeTimestamp when webhook was sent

Monitoring

Use these logs to debug webhook delivery issues. Check for failed deliveries and verify your endpoint is responding with 2xx status codes.
Request Example
curl -X GET "https://voice-ai-admin-api-762279639608.asia-south1.run.app/api/v1/webhooks/logs?limit=10" \
  -H "X-API-Key: your-api-key"

Additional Information

Prerequisites

  • You need an existing agent_id to create leads
  • Use GET /api/v1/agents with authentication to list agents
  • Phone numbers must be in E.164 format
  • Get API key from admin panel settings

Need Help?

Contact us at connect@conversailabs.com for support or questions about the API.