Overview
The Vaani Backend API provides endpoints for managing outbound calls and accessing call-related data. This API requires API key authentication via the X-API-Key header.
Authentication
All endpoints require API key authentication. Include your API key in the request header:
X-API-Key: your-api-key-here
Keep your API key secure and never expose it in client-side code or public repositories.
Base URL
All endpoints are prefixed with /api/. The base URL is:
https://api.vaaniresearch.com
API Version
Current API version: 2.0.0
Endpoint Examples
Create Dispatch
Create an outbound call.
curl -X POST 'https://api.vaaniresearch.com/api/trigger-call/' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"agent_name": "sales-agent",
"contact_number": "+919876543210",
"name": "John Doe",
"voice": "",
"metadata": {}
}'
Whether the operation succeeded
Status message. Default: “Command processed”
Command output (typically the call ID)
Error message if the operation failed
{
"success": true,
"message": "Command processed",
"output": "call_id_12345",
"error": null
}
Get Call History
Get call history for a client. Shows all calls for the client if user belongs to that client. Super-admin can see all calls.
curl -X GET 'https://api.vaaniresearch.com/api/call-history/my-client' \
-H 'X-API-Key: YOUR_API_KEY'
{
"calls": [
{
"call_id": "call_123",
"client_name": "my-client",
"contact_number": "+919876543210",
"timestamp": "2024-01-15T10:30:00Z",
"status": "completed"
}
]
}
Get Transcript
Retrieve the transcript for a call.
curl -X GET 'https://api.vaaniresearch.com/api/transcript/call_123?client_name=my-client' \
-H 'X-API-Key: YOUR_API_KEY'
{
"call_id": "call_123",
"transcript": "Hello, this is John. How can I help you today?",
"timestamp": "2024-01-15T10:30:00Z"
}
Stream Audio
Stream audio file from Azure Blob Storage.
curl -X GET 'https://api.vaaniresearch.com/api/stream/call_123' \
-H 'X-API-Key: YOUR_API_KEY' \
--output audio.wav
{
"stream_url": "https://storage.azure.com/audio/call_123.wav",
"content_type": "audio/wav"
}
Get Call Details
Get detailed call information including transcript, entities, and evaluation.
curl -X GET 'https://api.vaaniresearch.com/api/call_details/my-client/call_123' \
-H 'X-API-Key: YOUR_API_KEY'
{
"call_id": "call_123",
"client": "my-client",
"transcript": "Full conversation transcript...",
"entities": {
"customer_name": "John Doe",
"phone_number": "+919876543210"
},
"evaluation": {
"score": 85,
"sentiment": "positive"
},
"timestamp": "2024-01-15T10:30:00Z"
}
Error Responses
All endpoints may return validation errors with the following format:
{
"detail": [
{
"loc": ["body", "contact_number"],
"msg": "field required",
"type": "value_error.missing"
}
]
}
Rate Limits
Please refer to your API key documentation for rate limit information.