Chatbot API TALKR.ai v4.2
Integrate a TALKR conversational chatbot on your website, mobile app, or telephony server. One endpoint, two channels: web and telephony.
Overview
The TALKR Chatbot API lets you control a conversational agent via HTTP requests. It is used by both the web widget and telephony servers (SIP/VoIP). The principle is simple:
- You send a POST to initiate the conversation
- The bot returns a welcome message + a session identifier
- You send user messages with the session and tracking
- The bot processes the intent and returns its response
Base URL
🔒 URL provided on request
The API base URL is provided when your TALKR account is created. Contact us to get your access credentials (company, bot_id, endpoint).
URL parameters
| Variable | Description |
|---|---|
| {company} | Your TALKR workspace name (provided at registration) |
| {bot_id} | Numeric identifier of your bot (visible in the platform) |
| {channel} | Communication channel: web or telephony |
Authentication
The API is open (no API key required for conversational calls). Identification is done via the company + bot_id pair in the URL.
For the web channel, add the header:
Quickstart — 3 minutes to integrate
Here's how to start a conversation in 2 API calls:
Step 1 — Initiate the conversation
You receive a JSON with:
session— unique conversation identifier (keep this)data.messages[0].content— bot welcome messagedata.responses[0].tracking— current block identifier
Step 2 — Send a user message
The bot analyzes the intent and returns its response in variables.bot_answer and data.messages.
Conversation flow
Each conversation follows this cycle:
Key fields to send on each turn
| Field | Source | Role |
|---|---|---|
| session | Response from step 1 | Identifies the current conversation — keep throughout the exchange |
| tracking | data.responses[0].tracking |
Indicates the conversation tree block. Tells the bot where it is |
| variables.userresponse | Text typed by the user | Contains the user's response for NLU/AI processing |
Web channel (chat)
Endpoint for web chat integrations (widget, website, mobile app).
Required headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json |
required |
| X-Talkr-Query | 1 |
required |
Telephony channel (SIP/VoIP)
Endpoint for telephony integrations (SIP, VoIP, IVR). Same request/response format as the web channel, with additional data for text-to-speech (TTS) and speech recognition (STT).
Additional response data
| Field | Description |
|---|---|
| data.speech_synthesis | TTS configuration (vendor, voice, ElevenLabs/Google/Azure options) |
| data.speech_recognizer | STT configuration (vendor, language, recognition timeouts) |
| data.hangup_no_response | Auto hang up if no response (0 or 1) |
| data.retries | Number of retry prompts before abandoning |
Request parameters (JSON body)
Initial call (start a conversation)
Subsequent calls (send a message)
| Parameter | Type | Required | Description |
|---|---|---|---|
| message | string | required | User message text |
| session | string | required | Session identifier returned by the initial call |
| tracking | string | required | Conversation block identifier (data.responses[0].tracking) |
| variables | object | required | Object containing userresponse (the user's text) |
| variables.userresponse | string | required | User's response — used by the NLU/AI engine to process intent |
| currentUrl | string | optional | URL of the page where the user is located (context) |
Response structure
200 Success — the response contains bot data.
Key response fields
| Field | Description |
|---|---|
| session | Session identifier to keep for the entire conversation |
| variables.bot_answer | Final bot response (after NLU/AI processing). This is the main message to display |
| data.messages | Messages displayed by the bot. May be an intermediate message ("please wait...") before the final response |
| data.responses[0].tracking | Current conversation block identifier. Send this back in the next call |
| data.has_background_text | 1 if the bot performs background processing. Display data.messages as a waiting message, then variables.bot_answer as the final response |
Code examples
Test the API
Try it live — send a message to the bot
Error codes
| Code | Meaning | Action |
|---|---|---|
| 200 | Success | Process the response normally |
| 400 | Invalid request | Check JSON format and required fields |
| 404 | Bot not found | Check company and bot_id in the URL |
| 500 | Server error | Retry after a few seconds |
The variables.error field in the response may contain details about internal bot errors (e.g., missing variable in the conversation tree).
FAQ
What's the difference between the web channel and the telephony channel?
The request format and conversation flow are identical. The telephony channel response additionally includes TTS (text-to-speech) and STT (speech recognition) configurations for SIP/VoIP servers.
How long does a session last?
A session stays active as long as there are exchanges. After a configurable period of inactivity (per bot), the session expires and a new initial call is needed.
The bot shows "please wait" then the real answer — how to handle this?
When data.has_background_text = 1, the bot performs AI processing in the background. Display data.messages[0].content (waiting message) first, then variables.bot_answer (final response) with a slight delay between the two.
Do I need an API key?
No, the conversational API is open. Identification is done via the company/bot_id pair in the URL. For bot management (creation, configuration), a separate admin API with authentication is available.
Can I use this API from a Node.js, Python, PHP backend...?
Yes, the API is a simple REST endpoint (POST + JSON). It works with any language capable of making HTTP requests. See examples in the "Code examples" section.