Docs menuAPI reference
API reference
REST endpoints to start outbound calls, list them, manage webhooks, and fetch engine catalogs. Bearer-token auth.
The public API is REST + JSON, mounted at /v1. Authenticate with a bearer token issued from Settings → API keys in the dashboard. Tokens are tenant-scoped; every request is constrained to the tenant the key belongs to.
export VOICEAGENT_API_KEY="vasvk_live_..."
export VOICEAGENT_BASE="https://api.voice.octew.com"
Octew Voice AI is domain-agnostic. The API has no first-class concept of contacts, campaigns, leads, properties, or any other CRM shape. Every call carries two opaque caller-supplied JSON blobs:
variables— values the conversation flow’s{{path.to.value}}templates substitute against. Shape is whatever the flow author and the API caller agree on.metadata— opaque pass-through. Echoed back onGET /v1/callsand webhook deliveries. Use it to round-trip your own ids (lead id, campaign id, customer id) without registering them with Octew Voice AI.
Endpoint catalog
| Method | Path | Scope | Purpose |
|---|---|---|---|
GET | /v1 | — | Self-describing endpoint catalog. |
GET | /v1/me | — | Tenant + key the bearer maps to. |
POST | /v1/calls | calls:write | Initiate an outbound call. |
GET | /v1/calls | calls:read | List calls with filters + cursor. |
GET | /v1/calls/:id | calls:read | Fetch a call by platform UUID or carrier call_sid. |
GET | /v1/voice-agents | calls:read | List voice agents available to this tenant. |
GET | /v1/conversation-flows | calls:read | List active conversation flows. |
POST | /v1/webhooks | calls:write | Register a webhook subscription. Returns secret once. |
GET | /v1/webhooks | calls:read | List webhook subscriptions. |
GET | /v1/webhooks/:id | calls:read | Single subscription. |
PATCH | /v1/webhooks/:id | calls:write | Update url / events / headers / active state. |
DELETE | /v1/webhooks/:id | calls:write | Remove a subscription. |
GET | /v1/webhooks/:id/deliveries | calls:read | Recent delivery attempts (audit log). |
Conventions
- Requests and responses are JSON. Send
Content-Type: application/json. - All identifiers are plain UUIDs (no prefixes). Both the platform
idand the carrier-assignedcall_sidare returned; either one can be passed as:idinGET /v1/calls/:id. - All wire field names are snake_case.
- Money is in paise (1 INR = 100 paise) as integers.
- Timestamps are ISO 8601 strings.
- Errors return
{ error: "Human message", code: "machine_code" }with a 4xx/5xx status. Validation failures additionally include anissuesarray. variablesandmetadataare each capped at 4 KB when JSON-serialized.
Authentication
API keys look like:
vasvk_live_3X8nQpL2vE7mTwZc9YfJk1RbHa6PsD0o
The vasvk_ prefix tags the service, live is the environment (also test for sandbox keys), and the trailing 32 base64url characters are the secret. Send it as a Bearer token:
curl -H "Authorization: Bearer $VOICEAGENT_API_KEY" "$VOICEAGENT_BASE/v1/me"
Keys carry scopes; today every key is issued with ["calls:read", "calls:write"]. Scope-gated endpoints return 403 insufficient_scope if the bearer lacks the required permission.
POST /v1/calls
Place an outbound call. Requires calls:write.
curl -X POST "$VOICEAGENT_BASE/v1/calls" \
-H "Authorization: Bearer $VOICEAGENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"voice_agent_id": "f1a83b22-...UUID",
"conversation_flow_id": "9c2e0f1a-...UUID",
"to_name": "Aarav Mehta",
"variables": {
"contact": { "name": "Aarav Mehta", "phone": "+919876543210" },
"client": { "name": "PropertyHub", "companyName": "PropertyHub Realty" },
"campaign": { "name": "Diwali offer" },
"leadEnrichment": {
"budget": "85 Lakh",
"preferredCity": "Pune",
"preferredPropertyType": "apartment"
}
},
"metadata": {
"lead_id": "c47b3e90-...UUID",
"campaign_id": "1d9f6cde-...UUID"
}
}'
| Field | Type | Notes |
|---|---|---|
to | string | Required. Phone number to dial. E.164 format (e.g. +919876543210). |
voice_agent_id | UUID | Required. Voice + STT + LLM + system prompt to run the call. Must belong to your tenant — list with GET /v1/voice-agents. |
conversation_flow_id | UUID | Required. The flow to execute. Must belong to your tenant — list with GET /v1/conversation-flows. |
to_name | string | null | Optional friendly label, snapshotted on the call (e.g. for the dashboard). Free-form, no FK. |
variables | object | null | Optional. Caller-supplied dict the flow’s templates substitute against. ≤ 4 KB serialized. |
metadata | object | null | Optional. Opaque pass-through, echoed back unchanged. ≤ 4 KB serialized. |
Response — 201 Created
{
"id": "5b8a14f0-...UUID",
"call_sid": "CAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"status": "initiating",
"created_at": "2026-04-27T10:14:25.014Z"
}
Failure modes
| HTTP | code | Cause |
|---|---|---|
| 400 | invalid_request | Body failed schema validation. issues[] lists per-field errors. |
| 400 | invalid_phone | The to value isn’t a callable phone number. |
| 404 | voice_agent_not_found | voice_agent_id doesn’t exist in this tenant. |
| 404 | conversation_flow_not_found | conversation_flow_id doesn’t exist in this tenant. |
| 413 | variables_too_large | variables exceeded 4 KB serialized. |
| 413 | metadata_too_large | metadata exceeded 4 KB serialized. |
| 502 | dial_failed | Carrier rejected the dial (no balance, region blocked, bad number). |
GET /v1/calls
List calls (most recent first) with filters and cursor pagination. Requires calls:read.
curl "$VOICEAGENT_BASE/v1/calls?status=completed&from=2026-04-20T00:00:00Z&limit=50" \
-H "Authorization: Bearer $VOICEAGENT_API_KEY"
| Query param | Type | Notes |
|---|---|---|
from | ISO datetime | Inclusive lower bound on initiated_at. |
to | ISO datetime | Inclusive upper bound on initiated_at. |
status | enum | One of the call statuses. |
voice_agent_id | UUID | Filter to a single voice agent. |
conversation_flow_id | UUID | Filter to a single flow. |
cursor | opaque | From the previous page’s next_cursor. |
limit | int (1..200) | Default 50. |
Response — 200 OK
{
"data": [
{ "id": "5b8a14f0-...", "call_sid": "CA...", "status": "completed", ... }
],
"next_cursor": "MjAyNi0wNC0yN1QxMDoxNToxMS4xMTha"
}
next_cursor is null when there are no more pages.
GET /v1/calls/:id
Fetch the current state of a call. The :id accepts either the platform UUID returned from POST /v1/calls, or the carrier-assigned call_sid — auto-detected by format. Requires calls:read.
curl "$VOICEAGENT_BASE/v1/calls/5b8a14f0-...UUID" \
-H "Authorization: Bearer $VOICEAGENT_API_KEY"
Response — 200 OK
{
"id": "5b8a14f0-...UUID",
"call_sid": "CAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"voice_agent_id": "f1a83b22-...UUID",
"conversation_flow_id": "9c2e0f1a-...UUID",
"to_name": "Aarav Mehta",
"to_number": "+919876543210",
"from_number": "+918888888888",
"direction": "outbound",
"status": "completed",
"initiated_at": "2026-04-27T10:14:25.014Z",
"started_at": "2026-04-27T10:14:32.402Z",
"ended_at": "2026-04-27T10:15:11.118Z",
"duration_ms": 38716,
"outcome": "qualified",
"lead_score": "warm",
"recording_url": "https://...recording.mp3",
"transcript": "...",
"cost_paise": 1240,
"telephony_provider": "twilio",
"turn_count": 7,
"error_count": 0,
"variables": { "contact": { "name": "Aarav Mehta" }, "...": "..." },
"metadata": { "lead_id": "c47b3e90-...", "campaign_id": "1d9f6cde-..." }
}
status is one of initiating, ringing, in_progress, completed, failed, no_answer, voicemail, dnc. Poll until you see a terminal value, or — better — register a webhook (see below) and let Octew Voice AI push the result.
GET /v1/voice-agents
Catalog of voice agents in this tenant. Use the returned id as voice_agent_id when calling POST /v1/calls.
{
"data": [
{ "id": "f1a83b22-...", "name": "Priya (Hindi)", "description": null, "language": "hi", "is_default": true }
]
}
GET /v1/conversation-flows
Catalog of active conversation flows in this tenant.
{
"data": [
{ "id": "9c2e0f1a-...", "name": "Real-estate qualifier v3", "description": null, "version": 7 }
]
}
Webhooks
Octew Voice AI posts call lifecycle events to URLs you register. Each delivery is HMAC-signed; consumers verify the signature using the secret returned at registration.
POST /v1/webhooks
curl -X POST "$VOICEAGENT_BASE/v1/webhooks" \
-H "Authorization: Bearer $VOICEAGENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourapp.example.com/voiceagent-events",
"events": ["call.completed", "call.failed"],
"headers": { "X-Tenant-Id": "your-internal-id" },
"description": "Production event sink"
}'
| Field | Type | Notes |
|---|---|---|
url | URL | Required. Where to POST events. |
events | string[] | Subset of supported events. Default ["call.completed", "call.failed"]. |
headers | object | Optional. Sent verbatim on every delivery. Use to tag environment, route inside your app, etc. |
description | string | Optional, ≤ 500 chars. |
Response — 201 Created (the only time you see the secret)
{
"id": "1d9f6cde-...UUID",
"url": "https://yourapp.example.com/voiceagent-events",
"events": ["call.completed", "call.failed"],
"headers": { "X-Tenant-Id": "your-internal-id" },
"description": "Production event sink",
"active": true,
"secret": "0da7b9714041c66895780041b709401488f9004d263e2a2ee62f697044438ef5",
"created_at": "...",
"last_delivery_at": null,
"last_delivery_status": null,
"consecutive_failures": 0
}
Save the secret. Subsequent reads only return the metadata.
Delivery wire format
POST <url>
Content-Type: application/json
X-VoiceAgent-Signature: <hex sha256 hmac>
X-VoiceAgent-Event: call.completed
X-VoiceAgent-Delivery: <delivery row id>
<...your custom headers...>
{
"event": "call.completed",
"delivered_at": "2026-04-27T10:15:11.612Z",
"call": { /* identical shape to GET /v1/calls/:id */ }
}
Verifying the signature
Compute HMAC-SHA256 over the raw request body with your subscription secret:
import crypto from "crypto";
const expected = crypto
.createHmac("sha256", subscriptionSecret)
.update(rawBody)
.digest("hex");
if (!crypto.timingSafeEqual(
Buffer.from(req.header("X-VoiceAgent-Signature") ?? "", "utf8"),
Buffer.from(expected, "utf8"),
)) {
return res.status(401).end();
}
Retry policy
Each delivery is attempted up to 4 times with exponential backoff (1s, 4s, 16s) on any non-2xx response, network error, or 8s timeout. After 5 consecutive failed deliveries, the subscription is auto-disabled — re-enable via PATCH /v1/webhooks/:id with { "active": true }.
Every attempt is recorded in GET /v1/webhooks/:id/deliveries:
{
"data": [
{
"id": 12345,
"event": "call.completed",
"call_id": "5b8a14f0-...",
"attempt": 1,
"response_status": 200,
"response_body": "OK",
"error": null,
"duration_ms": 87,
"attempted_at": "2026-04-27T10:15:11.701Z"
}
]
}
Errors
Every error response uses this envelope:
{ "error": "Human-readable message", "code": "machine_readable_code" }
Validation errors additionally include issues:
{
"error": "Invalid request body",
"code": "invalid_request",
"issues": [
{ "path": "voice_agent_id", "message": "voice_agent_id must be a UUID" }
]
}
code | HTTP | Meaning |
|---|---|---|
missing_authorization | 401 | No Authorization header. |
invalid_authorization | 401 | Header present but not Bearer <token>. |
invalid_api_key | 401 | Token didn’t match any active key. |
tenant_suspended | 403 | Key belongs to a suspended tenant. |
insufficient_scope | 403 | Key lacks the scope the endpoint requires. |
invalid_request | 400 | Body failed schema validation. See issues[]. |
invalid_phone | 400 | to was not a callable number. |
variables_too_large | 413 | variables exceeded 4 KB serialized. |
metadata_too_large | 413 | metadata exceeded 4 KB serialized. |
voice_agent_not_found | 404 | Referenced agent doesn’t exist in this tenant. |
conversation_flow_not_found | 404 | Referenced flow doesn’t exist in this tenant. |
not_found | 404 | Generic “no such resource in this tenant.” |
dial_failed | 502 | Carrier refused the call. |
Limits
There are no published rate limits on /v1 today. Don’t hammer it; expect that to change as the public API surface grows. Keys can be revoked from the dashboard at any time, and a revoked key starts returning invalid_api_key immediately (no propagation delay).