Skip to main content
The Conversation Messages API allows you to programmatically access, create, and manage messages within conversations. This is essential for async replies, custom integrations, and conversation analytics.

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:
Get your API key from the dashboard under Settings → API Keys.
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:
Response:

Get Conversation

Retrieve a specific conversation with details. Endpoint: GET /conversations/{conversation_id}
Response:

List Messages

Get message history for a conversation. Endpoint: GET /conversations/{conversation_id}/messages Parameters:
Response:

Send Message

Send a message to a conversation (for async replies or custom integrations). Endpoint: POST /conversations/{conversation_id}/messages Body Parameters:
Response:
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:

Use Cases

Async Message Delivery

Send a final response after long processing:
See Async Replies for detailed guide.

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