Developer
REST API
The Talknex API is a standard REST API with predictable resource-oriented URLs, Bearer token auth, and JSON request/response bodies.
Base URL & authentication
# Base URL
https://api.talknex.ai/v1
# All requests must include:
Authorization: Bearer <your-api-key>
Content-Type: application/json
API keys are created in Settings → API Keys. Each key is scoped to your organization. Keys have no expiry but can be revoked at any time.
Placing a call
# POST /v1/calls
curl -X POST https://api.talknex.ai/v1/calls \
-H "Authorization: Bearer $TALKNEX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agentId": "agent_8f3c",
"to": "+14155550192",
"from": "+18005551234",
"metadata": { "leadId": "lead_4421" }
}'# Response
{
"id": "call_9xkz3",
"status": "initiated",
"agentId": "agent_8f3c",
"to": "+14155550192",
"createdAt": "2026-05-05T10:23:00Z"
}Endpoints
Agents
/agentsList all agents in your organization.
/agentsCreate a new agent.
/agents/:idRetrieve a single agent by ID.
/agents/:idUpdate agent configuration.
/agents/:idDelete an agent.
Calls
/callsInitiate an outbound call.
/callsList call history with pagination and filters.
/calls/:idGet call details, transcript, and sentiment.
/calls/:idDelete call record and recording.
Phone Numbers
/phone-numbersList all phone numbers in your account.
/phone-numbersPurchase and provision a new number.
/phone-numbers/:idUpdate routing config or assigned agent.
/phone-numbers/:idRelease a number back to Twilio.
Knowledge
/knowledge/collectionsList all knowledge collections.
/knowledge/collectionsCreate a new collection.
/knowledge/collections/:id/documentsUpload a document or submit text chunks.
/knowledge/collections/:id/documents/:docIdRemove a document.
Contacts
/contactsList contacts with search and filter.
/contactsCreate a contact.
/contacts/:idUpdate contact details or CRM fields.
Rate limits & errors
Rate limits
100 requests per minute per API key. Exceeded requests receive a 429 Too Many Requests response with a Retry-After header.
Error format
{
"error": {
"code": "validation_error",
"message": "agentId is required",
"field": "agentId"
}
}HTTP status codes
200Success
201Resource created
400Bad request — invalid parameters
401Unauthorized — missing or invalid API key
403Forbidden — resource belongs to another org
404Not found
429Rate limit exceeded
500Internal server error — retry with exponential backoff
WebSocket transcript stream
Subscribe to a live call's transcript in real-time via WebSocket:
import { Talknex } from '@talknex/sdk';
const client = new Talknex({ apiKey: process.env.TALKNEX_API_KEY });
client.calls.on('call_9xkz3', 'transcript', (chunk) => {
console.log(`[${chunk.role}] ${chunk.text}`);
// [agent] Hi, this is Aria from Northridge Clinics...
// [caller] I'd like to book an appointment
});
client.calls.on('call_9xkz3', 'tool_call', (event) => {
console.log(`Tool called: ${event.tool} with `, event.args);
});