Home API and integrations | Keys, endpoints and webhooks How to extract data in bulk via API (Data Extract API)

How to extract data in bulk via API (Data Extract API)

Last updated on Sep 22, 2026

Important notice: this API will no longer be evolved. The recommended way to perform bulk data extraction today is the new documentation: CloudHumans Data Export.


When to use it

  • You need to export historical ticket data for BI, auditing or an external dashboard
  • You want to feed custom reports with complete Cloud Chat data
  • You need to track delivery events from campaigns and proactive messages

Prerequisites

  • API Key generated by an administrator or supervisor user — see How to find your API Key in Cloud Chat

  • CLOUDCHAT_DOMAIN and ACCOUNT_ID

  • An extraction period of at most 5 days (120 hours) per request

This API is intended exclusively for bulk historical extraction. For real-time queries or actions on tickets, use the other APIs in the Master Guide.


About this article

The Data Extract API lets you export complete data from your tickets directly from your Cloud Chat account — dates, statuses, owners, response times and much more. Ideal for custom reports and external integrations.


Base request

curl --location 'https://{CLOUDCHAT_DOMAIN}/api/v2/accounts/{ACCOUNT_ID}/data_extracts?startDate=2025-03-27T01:58:59&endDate=2025-03-28T01:59:00&type=BASE_TICKET_METRICS' \
  --header 'Accept: application/json' \
  --header 'api_access_token: {API_TOKEN}'

Where to find the parameters

  • CLOUDCHAT_DOMAIN — part of the URL when you log in to your account

  • ACCOUNT_ID — after logging in, the ID appears in the URL as app/accounts/{id}/dashboard. E.g.: in cloudhumans.com/app/accounts/1/conversations/6341 the account_id is 1

  • API_TOKEN — generate it from an administrator or supervisor profile (under "Configurações do perfil" (Profile settings), in your own environment — use your account's domain, e.g.: https://YOUR-DOMAIN.cloudhumans.com/app/accounts/{ACCOUNT_ID}/profile/settings. The domain varies by instance: cloudchat, cloudchat2, cloudchat3…)


Required parameters

  • startDate — Start date and time (UTC) in the yyyy-MM-ddTHH:mm:ss format. E.g.: 2025-03-27T01:58:59

  • endDate — End date and time (UTC). It must be later than startDate and the interval cannot exceed 5 days (120 hours). E.g.: 2025-03-28T01:59:00

  • type — Type of data to export (see the list below)

  • account_id — Account ID, provided in the URL path

Available types

  • BASE_TICKET_METRICS

  • TICKET_METRICS_WITH_AGENT_INFORMATION

  • TICKET_SUMMARY

  • CAMPAIGN_DELIVERY_EVENTS

  • SINGLE_CONTACT_DELIVERY_EVENTS


Optional parameter: rangeFilterProperty

Defines which date field is used to apply the period filters.

Value Behavior
CREATED_AT (default) Filters by the creation date
UPDATED_AT Filters by the last update date

Date range

To ensure stability and performance, the maximum interval allowed per request is 5 days.

To export longer periods (e.g.: 30 days), split it into multiple requests — 6 consecutive calls with 5-day windows cover an entire month.


Request limit (rate limit)

The Data Extract API applies a limit of 20 requests per minute per token. Different tokens from the same account have independent budgets.

What happens when you exceed the limit

Requests beyond the limit receive HTTP 429 Too Many Requests:

{
  "error": "Rate limit exceeded. Retry later.",
  "retry_after": 42
}

Recommendations

  • Respect the Retry-After header before trying again. Retry loops without backoff amplify the blocking

  • For large extractions (e.g.: 30 days), combine 5-day windows with spacing between requests — 20/min is generous for the typical volume

  • If your integration needs higher throughput on a sustained basis, contact support


1. BASE_TICKET_METRICS

Returns basic ticket data. Returned fields:

Field Type Description Possibly Sensitive Data
ticketId Integer Internal ticket ID No
displayTicketId Integer ID shown to the user in Cloud Chat — visible in the URL and in the search by filters No
inboxId Integer Inbox ID No
accountId Integer Account ID No
accountName Text Account name No
ticketStatus Text Ticket status: open (Aberto), resolved (Resolvido), pending (Pendente), snoozed (Adiado) No
teamName Text Name of the responsible team No
ticketPriorityName Text Priority: low, medium, high, urgent No
ticketType Text Ticket type (first associated tag) No
inboxName Text Inbox name No
ticketTitle Text Ticket title — may contain the contact's name or phone number Yes
channel Text Communication channel (e.g.: Whatsapp) No
tags Text Ticket tags separated by commas No
createdAt Timestamp Ticket creation date and time No
firstReplyAt Timestamp Date and time of the first reply No
firstReplyTime Decimal Time to the first reply (in minutes) No
resolvedAt Timestamp Resolution date and time No
totalResolutionTimeMin Decimal Total resolution time (in minutes) No
agentId Integer ID of the responsible agent No
ticketOwner Text Name of the responsible agent Yes
ticketOwnerEmail Text E-mail of the responsible agent Yes
contactId Integer Contact ID No
contactName Text Contact name Yes
contactEmail Text Contact e-mail Yes
contactPhone Text Contact phone number Yes
campaignId Integer ID of the campaign that originated the ticket, if applicable No
proactivelyInitiated Boolean Indicates whether the ticket was initiated proactively No

When you set the account's time zone (e.g.: GMT-3), the timestamp fields (createdAt, firstAgentAssignmentTime, firstReplyAt, firstAgentFirstReplyTime, resolvedAt, firstReplyTime, firstReplierAgentAssignmentTime, firstReplierAgentFirstReplyTime, repliedAt, readAt, receivedAt, sentAt) are returned in the configured time zone. Without a configured time zone, the times come in UTC.

Setup: Time zone configuration.

Response example

[
  {
    "ticketId": 123456,
    "displayTicketId": 7890,
    "inboxId": 101,
    "accountId": 42,
    "accountName": "Minha Empresa",
    "ticketStatus": "resolved",
    "teamName": "Meu Time",
    "ticketPriorityName": "High",
    "ticketType": "suporte",
    "inboxName": "WhatsApp",
    "ticketTitle": "+5511999999999",
    "channel": "Whatsapp",
    "createdAt": "2025-03-27T09:53:14.791Z",
    "firstReplyAt": "2025-03-27T10:09:29.225Z",
    "firstReplyTime": 16.24,
    "resolvedAt": "2025-03-27T13:20:15.830Z",
    "totalResolutionTimeMin": 207.01,
    "tags": "suporte,prioridade_alta",
    "agentId": 42,
    "ticketOwner": "ClaudIA",
    "ticketOwnerEmail": "[email protected]",
    "contactId": 998877,
    "contactName": "Contact Name",
    "contactEmail": "[email protected]",
    "contactPhone": "+5511887774411",
    "campaignId": 123,
    "proactivelyInitiated": true
  }
]

2. TICKET_METRICS_WITH_AGENT_INFORMATION

Includes details about the agent who replied and resolved. Additional fields:

Field Type Description Possibly Sensitive Data
ticketLink Text Direct URL to the ticket in Cloud Chat No
agentOnResolutionId Integer ID of the human agent who resolved the ticket No
agentOnResolutionName Text Name of the human agent who resolved it Yes
agentOnResolutionEmail Text E-mail of the human agent who resolved it Yes
firstAgentReplyId Integer ID of the first human agent who replied No
firstAgentReplyName Text Name of the first human agent who replied Yes
firstAgentReplyEmail Text E-mail of the first human agent who replied Yes
firstAgentAssignmentTime Timestamp Date and time when the ticket was assigned to the first agent No
firstAgentFirstReplyTime Timestamp Date and time of the agent's first reply No
firstReplierAgentAssignmentTime Timestamp Assignment date and time of the agent who replied first No
firstReplierAgentFirstReplyTime Timestamp Timestamp of the first reply from the agent who replied first No
firstAgentReplyTimeMin Decimal Time between assignment and the agent's first reply (min) No
firstAgentResolutionTimeMin Decimal Time between assignment and ticket resolution (min) No
csatScore Numeric Satisfaction score (CSAT) given by the customer No
csatFeedback Text Text comment left by the customer in the CSAT survey Yes
contactCustomFields JSON Contact custom fields — may contain personal data Yes
conversationCustomFields JSON Conversation custom fields — may contain personal data Yes
conversationAdditionalFields JSON Additional conversation metadata — may contain personal data Yes

Response example

[
  {
    "ticketId": 11111,
    "displayTicketId": 11111,
    "accountName": "account name",
    "inboxName": "WhatsApp",
    "ticketLink": "https://cloudchat.cloudhumans.com/app/accounts/99999/conversations/11111",
    "ticketStatus": "resolved",
    "createdAt": "2025-03-27T13:00:40.897954",
    "resolvedAt": "2025-03-27T15:38:02.743726",
    "agentOnResolutionId": 225,
    "agentOnResolutionName": "ClaudIA",
    "agentOnResolutionEmail": "[email protected]",
    "firstAgentReplyId": 111,
    "firstAgentReplyName": "ClaudIA",
    "firstAgentReplyEmail": "[email protected]",
    "firstAgentAssignmentTime": "2025-03-27T13:16:13.001269",
    "firstAgentFirstReplyTime": "2025-03-27T13:17:01.344971",
    "firstAgentReplyTimeMin": 0.81,
    "firstAgentResolutionTimeMin": 141.83,
    "csatScore": null,
    "csatFeedback": "",
    "contactCustomFields": "{}",
    "conversationCustomFields": "{}",
    "conversationAdditionalFields": "{}"
  }
]
  • firstAgentReplyTimeMin — time between firstAgentAssignmentTime and firstAgentFirstReplyTime

  • firstAgentResolutionTimeMin — time between firstAgentAssignmentTime and resolvedAt


3. TICKET_SUMMARY

Returns a summary of the ticket conversation. Returned fields:

Field Type Description Possibly Sensitive Data
ticketId Integer Internal ticket ID No
displayTicketId Integer ID shown to the user in Cloud Chat — visible in the URL and in the search by filters No
ticketLink Text Direct URL to the ticket in Cloud Chat No
summary Text Summary of the conversation between customer and agent — it may come truncated in long conversations Yes
[
  {
    "ticketId": 1111,
    "displayTicketId": 1111,
    "ticketLink": "https://cloudchat.cloudhumans.com/app/accounts/99999/conversations/1111",
    "summary": "CONTATO: Oi\nUSUÁRIO: Olá!"
  }
]

The summary field does not guarantee the full transcript of the conversation: it consolidates excerpts and, in long conversations, the content may come cut off. If you need the complete history, use the transcript delivery by e-mail from the conversation itself, instead of the API.


4. CAMPAIGN_DELIVERY_EVENTS

Returns WhatsApp campaign delivery events, tracking message status by contact and campaign.

Returned fields:

Field Type Description Possibly Sensitive Data
id Integer Unique ID of the delivery event No
campaignId Integer Campaign ID No
campaignTitle Text Campaign title No
audience Text Audience/list used in the campaign No
contactId Integer ID of the recipient contact No
contactName Text Name of the recipient contact Yes
contactEmail Text E-mail of the recipient contact Yes
contactPhoneNumber Text Phone number of the recipient contact Yes
ticketId Integer ID of the ticket generated by the send, if any No
displayTicketId Text ID shown to the user in Cloud Chat — visible in the URL and in the search by filters No
messageSent Boolean Flag indicating whether the message was sent to the WhatsApp (Meta) API No
sentAt Timestamp Send date and time No
messageReceived Boolean Flag indicating whether the message was delivered to the contact's device No
receivedAt Timestamp Delivery date and time No
messageRead Boolean Flag indicating whether the message was read (depends on the contact's privacy settings) No
readAt Timestamp Read date and time No
messageReplied Boolean Flag indicating whether the message was replied to No
repliedAt Timestamp Date and time of the first reply No
error Text Delivery error: invalid number, no WhatsApp, block, etc. No
createdAt Timestamp Record creation date and time No
updatedAt Timestamp Date and time of the last update No

Response example

[
  {
    "id": 103,
    "campaignId": 5502,
    "campaignTitle": "Natal 2025 - Promoção Especial",
    "audience": "lista_fidelidade_natal",
    "contactId": 9003,
    "contactName": "Carla Souza",
    "contactEmail": "[email protected]",
    "contactPhoneNumber": "+55 31 99999-99999",
    "ticketId": 78414,
    "displayTicketId": "2027",
    "messageSent": false,
    "sentAt": null,
    "messageReceived": false,
    "receivedAt": null,
    "messageRead": false,
    "readAt": null,
    "messageReplied": false,
    "repliedAt": null,
    "error": "Número de telefone inválido ou não registrado no WhatsApp",
    "createdAt": "2025-12-10T09:00:00.000Z",
    "updatedAt": "2025-12-10T09:00:00.000Z"
  }
]

5. SINGLE_CONTACT_DELIVERY_EVENTS

Returns delivery events of proactive single-send messages (not campaigns). Returned fields:

Field Type Description Possibly Sensitive Data
id Integer Unique ID of the delivery event No
contactId Integer ID of the recipient contact No
contactName Text Name of the recipient contact Yes
contactEmail Text E-mail of the recipient contact Yes
contactPhoneNumber Text Phone number of the recipient contact Yes
ticketId Integer ID of the ticket generated by the send, if any No
displayTicketId Text ID shown to the user in Cloud Chat — visible in the URL and in the search by filters No
messageSent Boolean Flag indicating whether the message was sent to the WhatsApp (Meta) API No
sentAt Timestamp Send date and time No
messageReceived Boolean Flag indicating whether the message was delivered to the contact's device No
receivedAt Timestamp Delivery date and time No
messageRead Boolean Flag indicating whether the message was read (depends on the contact's privacy settings) No
readAt Timestamp Read date and time No
messageReplied Boolean Flag indicating whether the message was replied to No
repliedAt Timestamp Date and time of the first reply No
error Text Delivery error: invalid number, no WhatsApp, block, etc. No
createdAt Timestamp Record creation date and time No
updatedAt Timestamp Date and time of the last update No

Response example

[
  {
    "id": 321,
    "contactId": 555777,
    "contactName": "Maria Silva",
    "contactEmail": "[email protected]",
    "contactPhoneNumber": "+55 11 98888-7777",
    "ticketId": 78414,
    "displayTicketId": "2027",
    "messageSent": true,
    "sentAt": "2025-08-01T12:00:05.000Z",
    "messageReceived": true,
    "receivedAt": "2025-08-01T12:00:08.000Z",
    "messageRead": true,
    "readAt": "2025-08-01T12:01:30.000Z",
    "messageReplied": false,
    "repliedAt": null,
    "error": null,
    "createdAt": "2025-08-01T11:59:59.000Z",
    "updatedAt": "2025-08-01T12:01:30.000Z"
  }
]

Practical step by step

  1. Generate your API Key in an administrator or supervisor profile ("Configurações do perfil" (Profile settings) → see "How to find your API Key").
  2. Choose where to run it: it is an HTTP GET call — use an API client (Postman, Insomnia) or the terminal with curl. No programming required.
  3. Build the URL replacing the fields between {}: https://{YOUR_DOMAIN}/api/v2/accounts/{ACCOUNT_ID}/data_extracts?startDate=2025-03-27T00:00:00&endDate=2025-03-27T23:59:59&type=TICKET_METRICS_WITH_AGENT_INFORMATION
  4. Add the authentication header (required — without it, it returns 401): api_access_token: {YOUR_API_KEY}
  5. Send the request (Send button in Postman, or run the curl).
  6. Read the result: you get a JSON with the list of tickets; each field is described in the type tables of this article.

Notes