Overview
The API provides endpoints for:- Listing conversations for a bot
- Retrieving conversation details
- Getting message history
- Sending messages to conversations
- Updating conversation metadata
Authentication
All API requests require authentication using a Bearer token:Keep your API key secure. Never expose it in client-side code or public repositories.
Base URL
Endpoints
List Conversations
Get all conversations for a bot. Endpoint:GET /bots/{bot_id}/conversations
Parameters:
List conversations
List conversations
- cURL
- JavaScript
- PHP
- Python
List with filters
List with filters
- cURL
- JavaScript
- PHP
- Python
Get Conversation
Retrieve a specific conversation with details. Endpoint:GET /conversations/{conversation_id}
Get conversation details
Get conversation details
- cURL
- JavaScript
- PHP
- Python
List Messages
Get message history for a conversation. Endpoint:GET /conversations/{conversation_id}/messages
Parameters:
Get message history
Get message history
- cURL
- JavaScript
- PHP
- Python
Get paginated messages
Get paginated messages
- JavaScript
- Python
Send Message
Send a message to a conversation (for async replies or custom integrations). Endpoint:POST /conversations/{conversation_id}/messages
Body Parameters:
Send assistant message
Send assistant message
- cURL
- JavaScript
- PHP
- Python
Send user message (for testing)
Send user message (for testing)
- cURL
- JavaScript
Sending user messages via API is typically for testing. In production, users send messages through channels (Telegram, Slack, etc.).
Update Conversation
Update conversation metadata. Endpoint:PATCH /conversations/{conversation_id}
Body Parameters:
Update conversation metadata
Update conversation metadata
- cURL
- JavaScript
- PHP
- Python
Archive a conversation
Archive a conversation
- cURL
- JavaScript
- PHP
- Python
Use Cases
Async Message Delivery
Send a final response after long processing:Conversation Analytics
Analyze conversation patterns:Export Conversations
Export conversation history for backup or analysis:Custom Bot Behaviors
Implement custom logic based on conversation state:Rate Limits
Exceeding rate limits results in
429 Too Many Requests responses. Implement exponential backoff for retries.Error Responses
Example Error Response:
Best Practices
Cache API Keys
Load API keys once, not per request
Handle Pagination
Always handle pagination for large datasets
Implement Retries
Use exponential backoff for failed requests
Validate IDs
Always validate conversation IDs exist
Use idempotency keys when sending messages to prevent duplicates during retries.
Complete API Reference
View the full API specification with all endpoints, parameters, and response schemas.
Next Steps
Async Replies
Implement async message delivery
Webhook Payload
Understand webhook format
Conversation History
Configure history settings