Agentes
Agent - Export Conversations
Export conversation history for an agent as a CSV file with filtering options
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
The agent ID to export conversations from
Query
Optional
Start date in ISO 8601 format (e.g.,
2026-01-01T00:00:00Z)End date in ISO 8601 format (e.g.,
2026-06-16T23:59:59Z)Comma-separated conversation IDs to export (e.g.,
id1,id2,id3)Filter by message sender type:
all, human, or agentFilter by conversation status:
all, RESOLVED, UNRESOLVED, or HUMAN_REQUESTEDFilter by channel:
all, website, whatsapp, telegram, slack, dashboard, meta, mercadolibre, chatwoot, or crmchatsappaiMaximum number of messages to export (1-100000). Default is 5000.
When
true, limits results to 100 messages for preview purposesSort 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:Unique identifier of the conversation
Sender of the message:
human or agentThe message content text
ISO 8601 timestamp of when the message was created
Error Responses
| Status Code | Type | Description |
|---|---|---|
| 400 | Bad Request | Invalid query parameters (e.g., invalid date format, search query too long) |
| 401 | UNAUTHORIZED | Missing or invalid authentication token |
| 404 | NOT_FOUND | Agent does not exist or does not belong to your organization |
| 500 | Internal Server Error | Server 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
