Reference
Manage agents and calls programmatically. All endpoints return JSON.
Authenticate requests with a Bearer token using an API key from Settings → API Keys. Keys are scoped to your account — keep them server-side and never expose them in client-side code.
Authorization: Bearer sk_live_••••••••••••••••https://api.samwad.ai/v1The API is versioned via the URL path (/v1). Breaking changes ship under a new version; additive changes (new optional fields, new endpoints) can land in the current version without notice.
| Plan | Requests / minute | Burst |
|---|---|---|
| Starter | 60 | 100 |
| Growth | 300 | 500 |
| Enterprise | Custom | Custom |
Rate-limited requests return a 429 with a Retry-After header in seconds.
curl https://api.samwad.ai/v1/agents \
-H "Authorization: Bearer $SAMWAD_API_KEY"{
"data": [
{
"id": "agt_123",
"name": "Sales Qualifier",
"status": "live",
"language": "hi-en",
"created_at": "2026-06-02T09:12:00Z"
}
],
"has_more": false
}curl -X POST https://api.samwad.ai/v1/agents \
-H "Authorization: Bearer $SAMWAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Sales Qualifier",
"language": "hi-en",
"voice_id": "voice_priya"
}'Body parameters
namestringrequiredlanguagestringrequiredhi, en, or hi-en for code-mixed.voice_idstringoptionalcurl -X POST https://api.samwad.ai/v1/calls \
-H "Authorization: Bearer $SAMWAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agt_123",
"to": "+919876543210"
}'Body parameters
agent_idstringrequiredtostringrequired+919876543210).testbooleanoptionaltrue, places a test call that doesn't count against your billed minutes.curl https://api.samwad.ai/v1/calls/call_8f2a1c \
-H "Authorization: Bearer $SAMWAD_API_KEY"{
"id": "call_8f2a1c",
"agent_id": "agt_123",
"direction": "outbound",
"status": "completed",
"duration_seconds": 142,
"transcript_url": "https://api.samwad.ai/v1/calls/call_8f2a1c/transcript",
"recording_url": "https://api.samwad.ai/v1/calls/call_8f2a1c/recording"
}| Event | Fires when |
|---|---|
call.started | A call connects. |
call.completed | A call ends normally. |
call.transferred | The agent hands off to a human. |
call.failed | A call fails to connect. |
See Integrations → Webhooks for a full payload example and setup steps.
| Status | Meaning |
|---|---|
| 400 | Malformed request — check required fields. |
| 401 | Missing or invalid API key. |
| 403 | Key doesn't have access to this resource. |
| 404 | Resource not found. |
| 429 | Rate limit exceeded. |
| 500 | Something failed on our end — safe to retry. |