Converse Logo
Developers

API Reference

Complete v2 REST API reference. Manage agents, calls, chat sessions, knowledge bases, and webhooks programmatically.

Authentication

Authenticated requests use a Bearer token in the Authorization header. Secret keys (sk_live_* or sk_test_*) are for server-side integrations. Origin-restricted publishable keys (pk_live_* or pk_test_*) may only create voice and chat sessions.

bash
curl https://api.converse.axllabs.in/v2/agents \
  -H "Authorization: Bearer sk_live_..."

Keep secret keys server-side

Secret keys grant scoped workspace access and must never ship in browser or mobile code. Use an origin-restricted publishable key or the server-side token endpoint pattern for client applications.

Base URL

text
https://api.converse.axllabs.in

All paths are relative to this base URL. Current API version: v2.

Agents

Agents are AI voice personas. The v2 API exposes only safe, public fields — system prompts and provider config are never returned.

GET
/v2/agents

List all active agents in your workspace.

GET
/v2/agents/:id

Get a specific agent by ID. Returns language, greeting, status, and timing config.

Agent object

json
{
  "id": "agent_abc123",
  "name": "Support Agent",
  "language": "en-IN",
  "greeting": "Hi! How can I help you today?",
  "status": "active",
  "max_duration_seconds": 600,
  "inactivity_timeout_seconds": 30,
  "created_at": "2025-01-15T10:00:00Z"
}

Calls

Create outbound calls, retrieve history, end active calls, and get voice session tokens for browser-based calls.

GET
/v2/calls

List calls with cursor-based pagination.

limitcursoragent_idstatusdirection
GET
/v2/calls/:id

Get full call details including transcript, sentiment, and duration.

POST
/v2/calls

Initiate an outbound voice call.

agent_id*to*from?metadata.task*
POST
/v2/calls/:id/end

End an active call gracefully.

POST
/v2/calls/web

Get a voice session for browser-based calling.

agent_id*

Create call — request body

json
{
  "agent_id": "agent_abc123",   // Required
  "to": "+919876543210",        // Required: destination phone number
  "from": "+918001234567",      // Optional: your verified number
  "channel": "voice",           // Optional; voice is the only supported value
  "metadata": {
    "task": "Confirm appointment for tomorrow 2pm",
    "customer_id": "cust_456"
  }
}

Always include a task

The required metadata.task field tells the agent the purpose of the outbound call. Requests without it are rejected before dialing. Example: "task": "Follow up on support ticket #1234"

Web call — response

json
{
  "call_id": "call_xyz789",
  "token": "eyJhbGciOiJIUzI1NiJ9...",  // Short-lived session token
  "server_url": "wss://voice.converse.axllabs.in"
}

Call object

json
{
  "id": "call_xyz789",
  "agent_id": "agent_abc123",
  "channel": "voice",
  "direction": "outbound",
  "from_number": "+918001234567",
  "to_number": "+919876543210",
  "status": "completed",
  "duration_ms": 125000,
  "sentiment_score": 0.78,
  "transcript": [
    { "role": "assistant", "content": "Hello! I'm calling to confirm..." },
    { "role": "user", "content": "Yes, that works for me." }
  ],
  "metadata": {
    "task": "Confirm appointment",
    "outcome": "confirmed"
  },
  "created_at": "2025-01-15T14:30:00Z",
  "ended_at": "2025-01-15T14:32:05Z"
}

Knowledge

List the knowledge bases configured for your workspace.

GET
/v2/knowledge

List all knowledge bases in your workspace.

Tools

GET
/v2/tools

List tools available to agents in your workspace. Returns schema only — no URLs or credentials.

Webhooks

Register HTTPS endpoints to receive real-time event notifications. Each endpoint gets a unique signing secret for verification.

GET
/v2/webhooks

List all registered webhook endpoints.

POST
/v2/webhooks

Register a new webhook endpoint. Returns signing_secret once — store it immediately.

url*events*
DELETE
/v2/webhooks/:id

Remove a webhook endpoint.

Create webhook — request body

json
{
  "url": "https://your-server.com/webhooks/converse",
  "events": [
    "call.completed",
    "call.escalated",
    "transcript.ready"
  ]
}

Create webhook — response (signing_secret shown once)

json
{
  "id": "wh_abc123",
  "url": "https://your-server.com/webhooks/converse",
  "events": ["call.completed", "call.escalated", "transcript.ready"],
  "enabled": true,
  "signing_secret": "whsec_a1b2c3...",   // Store this — never shown again
  "created_at": "2025-01-15T10:00:00Z",
  "warning": "Store signing_secret securely. It will not be shown again."
}

Chat

Create durable chat sessions and exchange messages with the same agent and flow runtime used by voice.

POST
/v2/chat/sessions

Create a new chat session.

agent_id*metadata?
GET
/v2/chat/sessions

List chat sessions.

agent_id?status?cursor?limit?
GET
/v2/chat/sessions/:id

Get session details.

GET
/v2/chat/sessions/:id/messages

Get messages in a session.

cursor?limit?
POST
/v2/chat/sessions/:id/messages

Queue a message for the agent.

content*request_id?
GET
/v2/chat/sessions/:id/messages/:request_id

Poll processing state and receive the reply.

POST
/v2/chat/sessions/:id/close

Close a chat session.

Tokens

Generate short-lived tokens for client SDKs. Use these instead of exposing your API key in frontend code.

POST
/v2/tokens/voice

Generate a voice session token for client SDK.

agent_id*metadata?expires_in?

Voice token response

json
{
  "token": "eyJhbGciOiJIUzI1NiJ9...",
  "server_url": "wss://voice.converse.axllabs.in",
  "call_id": "call_xyz789"
}

Pagination

List endpoints use cursor-based pagination. Pass the cursor from the previous response to fetch the next page.

json
// Response shape for list endpoints
{
  "data": [...],
  "has_more": true,
  "cursor": "2025-01-10T09:00:00Z"  // Pass as cursor param in next request
}

Rate Limiting

Publishable session and chat requests are durably rate-limited. A limited request returns 429 Too Many Requests with aRetry-After header; honor it before retrying.

Error Responses

All errors return JSON with a detail field describing the problem.

json
{ "detail": "Agent not found or not active" }
400Bad RequestMissing required field or invalid value
401UnauthorizedMissing or invalid API key
403ForbiddenKey doesn't have the required permission scope
404Not FoundResource not found
429Too Many RequestsRate limit exceeded — check Retry-After header
500Internal ErrorServer error — safe to retry with backoff
503Service UnavailableVoice service temporarily unavailable