API reference
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 on GET /v1/calls and 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

MethodPathScopePurpose
GET/v1—Self-describing endpoint catalog.
GET/v1/me—Tenant + key the bearer maps to.
POST/v1/callscalls:writeInitiate an outbound call.
GET/v1/callscalls:readList calls with filters + cursor.
GET/v1/calls/:idcalls:readFetch a call by platform UUID or carrier call_sid.
GET/v1/voice-agentscalls:readList voice agents available to this tenant.
GET/v1/conversation-flowscalls:readList active conversation flows.
POST/v1/webhookscalls:writeRegister a webhook subscription. Returns secret once.
GET/v1/webhookscalls:readList webhook subscriptions.
GET/v1/webhooks/:idcalls:readSingle subscription.
PATCH/v1/webhooks/:idcalls:writeUpdate url / events / headers / active state.
DELETE/v1/webhooks/:idcalls:writeRemove a subscription.
GET/v1/webhooks/:id/deliveriescalls:readRecent 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 id and the carrier-assigned call_sid are returned; either one can be passed as :id in GET /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 an issues array.
  • variables and metadata are 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"
    }
  }'
FieldTypeNotes
tostringRequired. Phone number to dial. E.164 format (e.g. +919876543210).
voice_agent_idUUIDRequired. Voice + STT + LLM + system prompt to run the call. Must belong to your tenant — list with GET /v1/voice-agents.
conversation_flow_idUUIDRequired. The flow to execute. Must belong to your tenant — list with GET /v1/conversation-flows.
to_namestring | nullOptional friendly label, snapshotted on the call (e.g. for the dashboard). Free-form, no FK.
variablesobject | nullOptional. Caller-supplied dict the flow’s templates substitute against. ≤ 4 KB serialized.
metadataobject | nullOptional. 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

HTTPcodeCause
400invalid_requestBody failed schema validation. issues[] lists per-field errors.
400invalid_phoneThe to value isn’t a callable phone number.
404voice_agent_not_foundvoice_agent_id doesn’t exist in this tenant.
404conversation_flow_not_foundconversation_flow_id doesn’t exist in this tenant.
413variables_too_largevariables exceeded 4 KB serialized.
413metadata_too_largemetadata exceeded 4 KB serialized.
502dial_failedCarrier 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 paramTypeNotes
fromISO datetimeInclusive lower bound on initiated_at.
toISO datetimeInclusive upper bound on initiated_at.
statusenumOne of the call statuses.
voice_agent_idUUIDFilter to a single voice agent.
conversation_flow_idUUIDFilter to a single flow.
cursoropaqueFrom the previous page’s next_cursor.
limitint (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"
  }'
FieldTypeNotes
urlURLRequired. Where to POST events.
eventsstring[]Subset of supported events. Default ["call.completed", "call.failed"].
headersobjectOptional. Sent verbatim on every delivery. Use to tag environment, route inside your app, etc.
descriptionstringOptional, ≤ 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" }
  ]
}
codeHTTPMeaning
missing_authorization401No Authorization header.
invalid_authorization401Header present but not Bearer <token>.
invalid_api_key401Token didn’t match any active key.
tenant_suspended403Key belongs to a suspended tenant.
insufficient_scope403Key lacks the scope the endpoint requires.
invalid_request400Body failed schema validation. See issues[].
invalid_phone400to was not a callable number.
variables_too_large413variables exceeded 4 KB serialized.
metadata_too_large413metadata exceeded 4 KB serialized.
voice_agent_not_found404Referenced agent doesn’t exist in this tenant.
conversation_flow_not_found404Referenced flow doesn’t exist in this tenant.
not_found404Generic “no such resource in this tenant.”
dial_failed502Carrier 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).