Talkar Service API Reference
Programmatically launch outbound calls, poll or SSE-stream live transcripts, read wallet/transactions, upload S3 files, integrate public web embeds, and call Talkar Automation APIs.
Talkar Service API Reference
Use these APIs when embedding Talkar inside a client's application, CRM, web portal, or backend automation pipeline. All interactive playgrounds below connect through the docs proxy—never paste live production secrets into untrusted shared environments.
Authentication Headers
| API Surface | Header / Token | Who Calls It |
|---|---|---|
Public Agent Trigger & Status (/api/v1/public/agent/...) | X-API-Key: <org_api_key> (strictly required; /stream takes ?api_key=...) | External backends, CRMs, and browser SSE listeners launching outbound runs or streaming live turns. |
Authenticated Workflow, Campaign & Wallet API (/api/v1/...) | X-API-Key: <org_api_key> (or Authorization: Bearer ...) | Querying run history (/runs/all), reading wallet/usage, managing embed tokens, testing tools/KB, or managing campaigns. |
Web Embed Public Routes (/api/v1/public/embed/...) | token (POST /init body or GET /config/{token} path) & {session_token} | Unauthenticated browser widgets scoped strictly to a published workflow's token and allowed_domains. |
Talkar Automation Platform API (/automation/v1/...) | X-Talkar-API-Key: tkr_auto_... | Internal/partner billing & account ops (n8n, admin automations) on https://billing.talkar.in/automation/v1. (Uses the numeric workspace/engine org ID in /customers/{org_id} routes.) |
Pre-call admission & wallet gates
Live outbound calls check organization status (agent_building allows up to 2 free webrtc/textchat/mock playground sessions while blocking PSTN), provisioning completion, sub-org monthly spending caps, fleet/sub-org concurrency limits, > ₹500 wallet floor, and worst-case concurrency reserve (concurrent_calls * ceil(max_duration / 60) * rate), returning HTTP 402 on quota rejection or 429 / 503 on engine concurrency rejection.
1. Trigger Outbound Calls Programmatically
You can initiate an automated outbound call via an API Trigger Node (trigger_path) (POST /api/v1/public/agent/{uuid}) or Workflow UUID (POST /api/v1/public/agent/workflow/{workflow_uuid}) for Published builds—or insert /test/ (POST /api/v1/public/agent/test/{uuid} and /test/workflow/{workflow_uuid}) to test the Latest Draft:
phone_number(required): E.164 destination phone number or SIP target.initial_context(optional): Key-value dictionary merged intoinitial_context({{customer_name}},{{order_id}}, etc.).- Response: Returns
{ "status": "initiated", "workflow_run_id": ..., "workflow_run_name": "WR-API-..." }(useworkflow_run_idas{run_id}in monitoring routes).
curl -X POST "https://api.example.com/api/v1/public/agent/<trigger_uuid>" \
-H "X-API-Key: <org_api_key>" \
-H "Content-Type: application/json" \
-d '{
"phone_number": "+919876543210",
"initial_context": {
"customer_name": "Rohan Sharma",
"order_id": "ORD-9182"
}
}'Initiates an outbound call against the published workflow version targeted by an ACTIVE Trigger Node UUID.
ApiKeyAuthX-API-Key<token>Organization-scoped API key for External Trigger & Live Monitoring endpoints.
uuid*stringAPI Trigger Node UUID configured on the workflow canvas.
application/json- body
phone_number*stringDestination E.164 phone number or SIP address.
initial_context?Custom key-value variables merged into initial_context before greeting.
telephony_configuration_id?integerOptional specific org telephony configuration ID. Defaults to org default outbound trunk.
Call initiated
application/json- response
status?stringworkflow_run_id?integerworkflow_run_name?stringcurl -X POST 'https://api.talkar.in/api/v1/public/agent/string' \ -H 'Content-Type: application/json' \ -d '{ "phone_number": "string"}'{ "status": "string", "workflow_run_id": 0, "workflow_run_name": "string"}Initiates an outbound call directly by Workflow UUID (uses published version). Use POST /api/v1/public/agent/test/workflow/{workflow_uuid} to run against latest draft.
ApiKeyAuthX-API-Key<token>Organization-scoped API key for External Trigger & Live Monitoring endpoints.
workflow_uuid*stringapplication/json- body
phone_number*stringinitial_context?telephony_configuration_id?integerCall initiated
curl -X POST 'https://api.talkar.in/api/v1/public/agent/workflow/string' \ -H 'Content-Type: application/json' \ -d '{ "phone_number": "string"}'2. Monitor Call Runs, Poll/Stream Transcripts & Download Artifacts
After launching a call (saving workflow_run_id), you can:
- Check completion, disposition & extracted data via
GET /api/v1/public/agent/run/{run_id}(X-API-Keyheader — returns{ run_id, is_completed, extracted_data, call_disposition }). (For full recording/transcript URLs, logs,cost_info, and QAannotations, callGET /api/v1/workflow/{workflow_id}/runs/{run_id}.) - Poll live or completed turns (JSON) via
GET /api/v1/public/agent/run/{run_id}/live-transcript(X-API-Keyheader — returns{ run_id, is_live, turns }). - Stream live call events via SSE (
text/event-stream) viaGET /api/v1/public/agent/run/{run_id}/stream?api_key=<org_api_key>(passesapi_keyas a query parameter for browserEventSourcecompatibility; emitsconnected,turn,agent_start,agent_done,ended,timeout,errorwith1sheartbeats). - Download recordings or transcripts (
recording,transcript,user_recording,bot_recording) using public run token links (GET /api/v1/public/download/workflow/{token}/{artifact_type}, returns302redirect to a 1-hour signed URL).
// Frames arrive as `data: <json>\n\n` (no named `event:` header) with `: heartbeat` ticks every 1s.
const stream = new EventSource(
`https://api.example.com/api/v1/public/agent/run/${runId}/stream?api_key=${encodeURIComponent(apiKey)}`
);
stream.onmessage = (event) => {
const payload = JSON.parse(event.data);
if (payload.type === 'connected') console.log('Subscribed to run', payload.run_id);
if (payload.type === 'turn') console.log(`[${payload.role}]`, payload.text, { final: payload.final });
if (payload.type === 'ended' || payload.type === 'timeout' || payload.type === 'error') {
console.warn('Stream closed:', payload);
stream.close();
}
};SSE stream auth & timeout behavior
/run/{run_id}/stream checks api_key inside the SSE generator: an invalid key returns HTTP 200 and immediately emits {"type": "error", "message": "Invalid API key"}. If no conversation events start within 30s, the server emits {"type": "timeout"} and closes cleanly.
Querying & Filtering Run History (/runs/all & /{workflow_id}/runs)
List paginated runs across your organization (GET /api/v1/workflow/runs/all) or scoped to a single workflow (GET /api/v1/workflow/{workflow_id}/runs) with optional page, limit, sort_by ("duration" or "created_at"), sort_order ("asc" | "desc", default "desc"), and filters (URL-encoded JSON array):
attribute | Required type | value JSON Shape | Behavior / Scope |
|---|---|---|---|
dateRange | "dateRange" | {"from": "<ISO-8601>", "to": "<ISO-8601>"} | Filters created_at (from and/or to optional) |
dispositionCode | "multiSelect" | {"codes": ["user_qualified", "completed"]} | Matches gathered_context.mapped_call_disposition |
duration | "numberRange" | {"min": 10, "max": 300} | Filters usage_info.call_duration_seconds (min and/or max) |
status | "radio" | {"status": "completed"} | "completed" or "in_progress" (is_completed) |
tokenUsage | "numberRange" | {"min": 0.01, "max": 2.5} | Filters run usage cost |
workflowId | "number" | {"value": 103} | /runs/all only — filters by workflow_id |
FILTERS='[{"attribute":"workflowId","type":"number","value":{"value":103}},{"attribute":"status","type":"radio","value":{"status":"completed"}},{"attribute":"duration","type":"numberRange","value":{"min":30}}]'
curl -G "https://api.example.com/api/v1/workflow/runs/all" \
-H "X-API-Key: <org_api_key>" \
--data-urlencode "page=1" \
--data-urlencode "limit=25" \
--data-urlencode "sort_by=duration" \
--data-urlencode "sort_order=desc" \
--data-urlencode "filters=${FILTERS}"(Malformed JSON returns HTTP 400, and disallowed filter attributes return HTTP 403. List responses set logs: null and annotations: null; call GET /api/v1/workflow/{workflow_id}/runs/{run_id} for full transcripts, logs, and QA annotations.)
ApiKeyAuthX-API-Key<token>Organization-scoped API key for External Trigger & Live Monitoring endpoints.
run_id*integerExtraction & disposition payload
application/json- response
run_id?integeris_completed?booleanextracted_data?call_disposition?stringcurl -X GET 'https://api.talkar.in/api/v1/public/agent/run/0'{ "run_id": 0, "is_completed": true, "extracted_data": {}, "call_disposition": "string"}JSON polling endpoint returning current finalized turns while live or persisted turns after completion. For Server-Sent Events (SSE), use /api/v1/public/agent/run/{run_id}/stream?api_key=...
ApiKeyAuthX-API-Key<token>Organization-scoped API key for External Trigger & Live Monitoring endpoints.
run_id*integerOrdered speaker turns
application/json- response
run_id?integeris_live?booleanturns?array<>curl -X GET 'https://api.talkar.in/api/v1/public/agent/run/0/live-transcript'{ "run_id": 0, "is_live": true, "turns": [ { "role": "agent", "text": "string", "timestamp": "2019-08-24T14:15:22Z" } ]}Streams real-time SSE events (connected, turn, agent_start, agent_done, ended, timeout, error) with 1s heartbeats. Uses the api_key query parameter for browser EventSource compatibility.
run_id*integerapi_key*stringOrganization X-API-Key passed as query param for EventSource clients.
SSE event stream (text/event-stream)
curl -X GET 'https://api.talkar.in/api/v1/public/agent/run/0/stream?api_key=string'No auth header required; authorized via WorkflowRun public_access_token. Returns 302 redirect to signed URL (1 hour TTL).
token*stringartifact_type*string"recording""transcript""user_recording""bot_recording"inline?booleanfalseRedirect to signed artifact URL
curl -X GET 'https://api.talkar.in/api/v1/public/download/workflow/string/recording'3. Public Web Embeds (Voice or Text Chat)
Client websites can embed a Published Talkar workflow (settings.widgetType configured as voice or chat, returned as top-level widget_type from /init) with allowed_domains, floating/inline/headless modes, and usage_limit caps (see the step-by-step Public Web Embeds Guide for code samples, 409 revision locking, and WebRTC signaling):
- Fetch origin-validated widget config (
GET /api/v1/public/embed/config/{token}). - Initialize a 1-hour session (
POST /api/v1/public/embed/init, passing{"token": "...", "context_variables": {...}}in the JSON body). - In
chatmode, exchange turns viaPOST /api/v1/public/embed/chat/{session_token}/messages(4000-char limit, optionalexpected_revisionoptimistic lock returning409,50-turn limit returning429), inspect state viaGET /api/v1/public/embed/chat/{session_token}, or close viaPOST .../end. Public embed responses automatically redact internal prompts, raw errors, and system context. (WebRTC embeds fetch ICE servers viaGET /api/v1/public/embed/turn-credentials/{session_token}.)
token*stringWidget configuration
curl -X GET 'https://api.talkar.in/api/v1/public/embed/config/string'application/json- body
token*stringcontext_variables?Returns session_token (1h TTL), workflow_run_id, config, widget_type, and initial chat_session for chat widgets
curl -X POST 'https://api.talkar.in/api/v1/public/embed/init' \ -H 'Content-Type: application/json' \ -d '{ "token": "string"}'session_token*stringapplication/json- body
text*string1 <= length <= 4000expected_revision?integerOptimistic concurrency revision check
Updated PublicEmbedChatSessionResponse
curl -X POST 'https://api.talkar.in/api/v1/public/embed/chat/string/messages' \ -H 'Content-Type: application/json' \ -d '{ "text": "string"}'4. Org Wallet, Presigned Uploads & Platform Automation API
Organization Wallet & S3 File Helpers (/api/v1)
Authenticated via X-API-Key or Bearer token:
- Wallet & Ledger:
GET /api/v1/wallet,GET /api/v1/wallet/balance, andGET /api/v1/wallet/transactions?page=1&limit=20&type=... - Presigned S3 Uploads/Downloads (
900supload TTL):POST /api/v1/s3/presigned-document-url(onboarding PDF/PNG/JPG up to20 MB),POST /api/v1/s3/presigned-upload-url(campaign.csvup to10 MB),GET /api/v1/s3/signed-url(expires_indefault3600s),GET /api/v1/s3/file-metadata.
Platform & Automation API (https://billing.talkar.in/automation/v1)
Scope-gated (credit, deduct, wallet_read, customer_read, suspend, stats_read, notify) with X-Talkar-API-Key: tkr_auto_..., per-key RPM throttling (429), and audit logging:
| Scope | Endpoints & Key Constraints |
|---|---|
credit / deduct | POST /customers/{org_id}/credit (0 < amount_rupees <= 100000, types credit/top_up/grant/manual_credit; auto-activates pending_deposit or zero_balance-suspended accounts when threshold met); POST /customers/{org_id}/deduct (amount_rupees > 0, no negative overdraft). |
wallet_read / customer_read | GET /customers/{org_id}/wallet, GET /wallet/overview, GET /customers/{org_id}, GET /customers |
suspend | POST /customers/{org_id}/suspend (reason: zero_balance, policy_violation, fraud, other — cascades master -> sub-orgs), POST /customers/{org_id}/unsuspend (requires shared wallet > ₹500; restores zero_balance sub-orgs only) |
stats_read | GET /calls/stats (from_date/to_date max 90 days), GET /wallet/alerts |
notify | POST /customers/{org_id}/notify (JSON { "content": { "title", "body", "alert_type" }, "delivery": { "in_app_notification": bool, "send_email": bool } } — returns { "status": "skipped" } cleanly during pre-live building stages) |
Public Web Embeds (Voice & Chat)
Configure widget embed tokens, enforce allowed domains, and build custom website voice (WebRTC) or headless text chat experiences using Talkar's Public Embed APIs.
Phone Numbers & Telephony Setup
Configure multi-trunk telephony providers, bind inbound/outbound DIDs, set up caller-ID pools, configure live call transfers, and enable Voicemail / AMD detection.