Skip to main content

Export conversations API

Prerequisites

To use the APIs, you need to have a token. Tokens can be generated by an admin at the setting section in Filum CX platform. Ensure you have the necessary permissions to access the admin settings for token generation.

APIs

Access the APIs via the endpoint: https://contact-center.filum.ai/

GET /external/conversations

Summary

Get Conversations

Query Parameters

NameDescriptionRequiredSchema
start_dateThe start date for filtering conversations (YYYY-MM-DD)Yesstring (date)
end_dateThe end date for filtering conversations (YYYY-MM-DD)Yesstring (date)
pageThe page number of the conversation results you want to retrieveNointeger (>= 1, default: 1)
per_pageThe number of conversation results you want to display per pageNointeger (1 .. 100, default: 10)
statusesFilter by conversation statuses (comma-separated). Options: closed, human_in_progress, ai_in_progress, pending, classifying, ratingNostring
installed_source_idsFilter by installed source IDs (comma-separated)Nostring
assignee_account_idsFilter by assignee account IDs (comma-separated)Nostring
team_idsFilter by team IDs (comma-separated)Nostring
has_ticketFilter by whether conversation has a ticket. Options: true, falseNoboolean
chatbot_enabledFilter by whether chatbot is enabled. Options: true, falseNoboolean
readFilter by read status. Options: true, falseNoboolean
searchSearch term to filter conversations by user name, phone, email, or ticket IDNostring

Header Parameters

NameDescriptionRequiredSchema
authorizationThe authorization token to validate the request. The value should be in the format Bearer <your_api_token>Yesstring
organization-idThe unique identifier of your organizationYesstring
auth-typeThe type of authorization used for the request. Options: token (for API tokens), account (for user sessions)Yesstring

Responses

CodeDescriptionContent type
200Successful Responseapplication/json
422Validation Errorapplication/json

200 Successful Response

FieldType/FormatRequiredDescription
itemsarray of objectsYesA list of conversations
items.idstringYesThe unique identifier of the conversation
items.organization_idstringYesThe unique identifier of the organization
items.installed_source_idintegerNoThe ID of the installed source (channel)
items.source_idintegerNoThe ID of the source
items.userobjectYesInformation about the user in the conversation
items.user.idstringNoThe unique identifier of the user
items.user.namestringNoThe name of the user
items.user.emailstringNoThe email of the user
items.user.phonestringNoThe phone number of the user
items.user.anonymous_idstringNoThe anonymous identifier of the user
items.statusstringYesThe status of the conversation
items.assigneeobjectNoInformation about the assignee
items.assignee.idintegerYesThe ID of the assignee
items.assignee.namestringYesThe name of the assignee
items.assignee.emailstringYesThe email of the assignee
items.teamobjectNoInformation about the team
items.team.idintegerYesThe ID of the team
items.team.namestringYesThe name of the team
items.ticketobjectNoInformation about the linked ticket
items.ticket.idintegerYesThe ID of the ticket
items.ticket.statusstringNoThe status of the ticket
items.ticket.assigneeobjectNoThe assignee of the ticket
items.ticket.teamobjectNoThe team of the ticket
items.last_messageobjectNoInformation about the last message
items.last_message.textstringNoThe text content of the last message
items.last_message.created_atstring (date-time)NoThe timestamp when the last message was created
items.last_message.sender_typestringNoThe sender type of the last message (user, assistant, agent)
items.readbooleanYesWhether the conversation has been read
items.chatbot_enabledbooleanYesWhether chatbot is enabled for the conversation
items.ai_package_enabledbooleanYesWhether AI package is enabled for the conversation
items.created_atstring (date-time)YesThe timestamp when the conversation was created
items.updated_atstring (date-time)YesThe timestamp when the conversation was last updated
items.typestringNoThe type of conversation (chat, call, etc.)
items.namestringNoThe name of the conversation
totalintegerYesTotal number of conversations matching the filter
pageintegerYesCurrent page number
per_pageintegerYesNumber of items per page
pagesintegerYesTotal number of pages

Response samples

{
"items": [
{
"id": "507f1f77bcf86cd799439011",
"organization_id": "org_12345",
"installed_source_id": 1,
"source_id": 10,
"user": {
"id": "user_123",
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "+84901234567",
"anonymous_id": null
},
"status": "closed",
"assignee": {
"id": 42,
"name": "Agent Smith",
"email": "agent.smith@company.com"
},
"team": {
"id": 5,
"name": "Support Team"
},
"ticket": {
"id": 1001,
"status": "closed",
"assignee": {
"id": 42,
"name": "Agent Smith",
"email": "agent.smith@company.com"
},
"team": {
"id": 5,
"name": "Support Team"
}
},
"last_message": {
"text": "Thank you for your help!",
"created_at": "2024-01-15T10:30:00Z",
"sender_type": "user"
},
"read": true,
"chatbot_enabled": false,
"ai_package_enabled": true,
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:35:00Z",
"type": "chat",
"name": "Support Inquiry"
}
],
"total": 150,
"page": 1,
"per_page": 10,
"pages": 15
}

GET /external/conversations/{conversation_id}/messages

Summary

Get Messages for a Conversation

Path Parameters

NameDescriptionRequiredSchema
conversation_idThe unique identifier of the conversationYesstring

Query Parameters

NameDescriptionRequiredSchema
pageThe page number of the message results you want to retrieveNointeger (>= 1, default: 1)
per_pageThe number of message results you want to display per pageNointeger (1 .. 100, default: 20)
scopeFilter by message scope. Options: external, internal, socialNostring
sender_typeFilter by sender type. Options: user, assistant, agentNostring

Header Parameters

NameDescriptionRequiredSchema
authorizationThe authorization token to validate the request. The value should be in the format Bearer <your_api_token>Yesstring
organization-idThe unique identifier of your organizationYesstring
auth-typetokenYesstring

Responses

CodeDescriptionContent type
200Successful Responseapplication/json
404Conversation Not Foundapplication/json
422Validation Errorapplication/json

200 Successful Response

FieldType/FormatRequiredDescription
itemsarray of objectsYesA list of messages
items.idstringYesThe unique identifier of the message
items.conversation_idstringYesThe unique identifier of the conversation
items.organization_idstringYesThe unique identifier of the organization
items.textstringNoThe text content of the message
items.sender_typestringYesThe type of sender (user, assistant, agent)
items.scopestringYesThe scope of the message (external, internal, social)
items.statusstringNoThe status of the message (sent, sending, failed, etc.)
items.attachmentsarray of objectsNoList of attachments in the message
items.attachments.urlstringYesThe URL of the attachment
items.attachments.typestringYesThe type of attachment (image, file, etc.)
items.attachments.namestringNoThe name of the attachment
items.attachments.mime_typestringNoThe MIME type of the attachment
items.created_atstring (date-time)YesThe timestamp when the message was created
items.updated_atstring (date-time)YesThe timestamp when the message was last updated
items.agent_typestringNoThe type of agent (qna, survey, greeting, etc.)
items.assistant_idstringNoThe ID of the assistant that sent the message
items.metadataobjectNoAdditional metadata about the message
totalintegerYesTotal number of messages in the conversation
pageintegerYesCurrent page number
per_pageintegerYesNumber of items per page
pagesintegerYesTotal number of pages

Response samples

{
"items": [
{
"id": "msg_507f1f77bcf86cd799439011",
"conversation_id": "507f1f77bcf86cd799439011",
"organization_id": "org_12345",
"text": "Hello, I need help with my order",
"sender_type": "user",
"scope": "external",
"status": "sent",
"attachments": [
{
"url": "https://example.com/image.jpg",
"type": "image",
"name": "order-screenshot.jpg",
"mime_type": "image/jpeg"
}
],
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:00:00Z",
"agent_type": null,
"assistant_id": null,
"metadata": {}
},
{
"id": "msg_507f1f77bcf86cd799439012",
"conversation_id": "507f1f77bcf86cd799439011",
"organization_id": "org_12345",
"text": "Sure, I'd be happy to help you with your order. Could you please provide your order number?",
"sender_type": "assistant",
"scope": "external",
"status": "sent",
"attachments": null,
"created_at": "2024-01-15T10:00:30Z",
"updated_at": "2024-01-15T10:00:30Z",
"agent_type": "qna",
"assistant_id": "assistant_abc123",
"metadata": {
"sources": [
{
"title": "Order Support Documentation",
"url": "https://docs.example.com/orders"
}
]
}
}
],
"total": 25,
"page": 1,
"per_page": 20,
"pages": 2
}

Usage Examples

Example 1: Get all conversations from the last 30 days

curl -X GET "https://contact-center.filum.ai/external/conversations?start_date=2024-01-01&end_date=2024-01-31&page=1&per_page=50" \
-H "authorization: Bearer your_api_token_here" \
-H "organization-id: your_organization_id_here" \
-H "auth-type: token"

Example 2: Get messages for a specific conversation

curl -X GET "https://contact-center.filum.ai/external/conversations/507f1f77bcf86cd799439011/messages?page=1&per_page=50" \
-H "authorization: Bearer your_api_token_here" \
-H "organization-id: your_organization_id_here" \
-H "auth-type: token"

Rate Limiting

The API endpoints are rate-limited to ensure fair usage and system stability. The default rate limits are:

  • Per second: 5 requests
  • Per minute: 50 requests

If you exceed these limits, you will receive a 429 Too Many Requests response. Please implement appropriate retry logic with exponential backoff in your integration.

Error Responses

401 Unauthorized

{
"detail": {
"message": "Unauthorized"
}
}

404 Not Found

{
"detail": {
"message": "Conversation not found"
}
}

422 Validation Error

{
"detail": [
{
"loc": ["query", "start_date"],
"msg": "field required",
"type": "value_error.missing"
}
]
}

429 Too Many Requests

{
"detail": "Rate limit exceeded"
}