Skip to main content
GET
Export conversation history and message data from an agent in CSV format. Supports filtering by date range, channel, status, and search terms. Use this endpoint to:
  • Extract conversation history for analysis or compliance
  • Export specific conversations by ID
  • Filter messages by channel, status, or date range
  • Search for messages by text content

Path

id
string
required
The agent ID to export conversations from

Query

Optional

from
string
Start date in ISO 8601 format (e.g., 2026-01-01T00:00:00Z)
to
string
End date in ISO 8601 format (e.g., 2026-06-16T23:59:59Z)
conversationId
string
Comma-separated conversation IDs to export (e.g., id1,id2,id3)
include
enum
default:"all"
Filter by message sender type: all, human, or agent
status
enum
default:"all"
Filter by conversation status: all, RESOLVED, UNRESOLVED, or HUMAN_REQUESTED
channel
enum
default:"all"
Filter by channel: all, website, whatsapp, telegram, slack, dashboard, meta, mercadolibre, chatwoot, or crmchatsappai
limit
number
default:"5000"
Maximum number of messages to export (1-100000). Default is 5000.
preview
boolean
When true, limits results to 100 messages for preview purposes
orderBy
enum
default:"asc"
Sort messages by creation date: asc (ascending) or desc (descending)
Search messages by text content (case-insensitive). Maximum 500 characters.

Response

The response is a CSV file with the following columns:
conversation_id
string
Unique identifier of the conversation
message_from
string
Sender of the message: human or agent
message_text
string
The message content text
message_created_at
string
ISO 8601 timestamp of when the message was created

Error Responses

Status CodeTypeDescription
400Bad RequestInvalid query parameters (e.g., invalid date format, search query too long)
401UNAUTHORIZEDMissing or invalid authentication token
404NOT_FOUNDAgent does not exist or does not belong to your organization
500Internal Server ErrorServer error during export processing

Notes

The response is a CSV file attachment, not JSON. Set Accept: text/csv header to explicitly request CSV format.
If no conversations are found, the response will be an empty CSV with headers only: conversation_id,message_from,message_text,message_created_at
Special characters in CSV fields are automatically escaped to prevent CSV injection attacks. Text values are quoted and internal quotes are doubled.