Chat Exports Quickstart
Export your agent's conversation history
Export all conversations between your agent and users. Get a downloadable ZIP file with JSON chat logs for analytics and insights.
Create an export request
Request an export of chat history for a specific agent and time range.
curl -X POST "https://api.d-id.com/agents/chats/exports" \
-H "Authorization: Basic <YOUR KEY>" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agt_abc123",
"from": "2024-01-01T00:00:00Z",
"to": "2024-01-31T23:59:59Z"
}'{
"export_id": "exp_xyz789"
}Save the export_id — you'll use it to check status and download the file. Omit from and to to export the full chat history.
Check export status
Poll the GET endpoint until the export is ready. Large exports may take a few minutes.
curl -X GET "https://api.d-id.com/agents/chats/exports/exp_xyz789" \
-H "Authorization: Basic <YOUR KEY>"{
"export_id": "exp_xyz789",
"agent_id": "agt_abc123",
"status": "done",
"total_files_count": 134,
"result": {
"result_url": "https://result.d-id.com/.../chats.zip"
},
"expires": 1705708800
}Poll until status is done. The result_url contains the downloadable ZIP file.
Download and analyze
Download the ZIP file containing JSON chat logs.
curl -O "https://result.d-id.com/.../chats.zip"{
"chatId": "cht_abc123",
"agentId": "agt_abc123",
"messages": [
{
"role": "assistant",
"content": "Hello! How can I help you today?",
"created_at": "2024-01-15T10:30:00.000Z"
},
{
"role": "user",
"content": "What are your business hours?",
"created_at": "2024-01-15T10:30:15.000Z"
},
{
"role": "assistant",
"content": "We're open Monday to Friday, 9 AM to 5 PM.",
"created_at": "2024-01-15T10:30:18.000Z"
}
]
}Each chat session is saved as a separate JSON file. The export URL expires after 7 days.
Updated 2 days ago
