The most up-to-date documentation for the Cloud Humans APIs is at docs.cloudhumans.com/api-reference. If this article and the reference differ, the reference prevails.
When to use
-
You want to read current data from Cloud Chat without changing anything (look up a contact, view a customer's tickets, read the messages of a conversation)
-
You are integrating Cloud Chat with another system (CRM, internal portal) that needs to display live data
-
You want to avoid duplicate contacts before creating a ticket
Prerequisites
-
Administrator API Key β see How to find your API Key in Cloud Chat
-
CLOUDCHAT_DOMAINandACCOUNT_ID
If you are not sure yet which type of API to use, start with the Master Guide β How to access and operate Cloud Chat data via API.
This page covers real-time reading only.
About this article
The Real-Time Query APIs let you read current data from Cloud Chat, straight from the production database, without changing anything. They are ideal for integrations, automations, and internal screens that need to answer questions like:
-
"Does this contact already exist?"
-
"Which tickets does this customer have?"
-
"What is the current status of this ticket?"
-
"Which messages were exchanged in this conversation?"
About the /api/client/ namespace
The endpoints on this page use /api/client/accounts/... instead of the /api/v1/accounts/... used by other APIs. Both use the same api_access_token for authentication.
The /api/client/ namespace offers simplified read endpoints β they are more direct for one-off queries. For write operations (create, update, delete), use the /api/v1/ namespace.
What these APIs are for
Use them when you need to:
-
Read data right now
-
Integrate Cloud Chat data with another system
-
Display information in an application
-
Make decisions based on the current state of the service
What they are not for
Do not use these APIs to:
-
Generate reports β use the Data Extract API
-
Export large volumes of data β use the Data Extract API
-
Analyze long time periods β use the Data Extract API
-
Create or update tickets β use the Ticket Update and Action APIs
-
Insert messages β use the Ticket Update and Action APIs
Authentication
All endpoints require:
-
{CLOUDCHAT_DOMAIN}β your account's domain (e.g.cloudchat.cloudhumans.com) -
{ACCOUNT_ID}β account ID -
api_access_tokenβ for the/api/client/endpoints (sections 1, 2, and 3), the token must belong to an administrator β supervisor or agent tokens receive403 Forbidden. The free-text search (section 1b,/api/v1/namespace) accepts a token from any agent profile
1. Find a contact by email or phone
When to use
-
Before creating a ticket (to find out whether the contact already exists)
-
To associate external data with a contact
-
To avoid duplication
Endpoint
GET https://{CLOUDCHAT_DOMAIN}/api/client/accounts/{ACCOUNT_ID}/contacts?email=EMAIL&phone_number=PHONE
Rules
-
At least one of the parameters (
emailorphone_number) is required -
If both are sent, the API attempts the most precise match possible
What it returns
-
Contact ID, name, email, phone
-
Custom fields
-
Creation and last activity dates
1b. Search contacts by free text (Search)
When to use
To find a contact by any text field (name, email, phone, identifier, company) without knowing exactly which one holds the information.
Unlike the previous endpoint, this one performs an ILIKE search (case-insensitive, partial) across multiple fields simultaneously.
Endpoint
GET /api/v1/accounts/{account_id}/contacts/search?q={termo}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
q |
string | Yes | Search term. Minimum of 2 characters when it contains only letters (searches name only); minimum of 3 characters when it contains any digit (searches all fields). Below these limits, it returns HTTP 422 |
page |
integer | No | Results page (default: 1, 15 results per page) |
Searched fields
-
nameβ contact name (always searched) -
emailβ email (from 3 characters with a digit) -
identifierβ external identifier (from 3 characters with a digit) -
phone_numberβ phone, with and without the+prefix (from 3 characters with a digit) -
company_nameβ company name (from 3 characters with a digit)
Response
-
payload[]β array of matching contacts -
metaβ contains only the current page
meta.count and meta.total_pages were removed to reduce database cost on repeated queries. To get the absolute total, use the dedicated endpoint GET /api/v1/accounts/{account_id}/contacts/search/count?q={termo} (cached for 30s).
Example
GET /api/v1/accounts/1/contacts/search?q=maria&page=1
Returns every contact whose name, email, phone, identifier, or company contains maria.
Usage limit (rate limit)
40 requests per minute per access token. If you exceed the limit, the API responds with HTTP 429 (Too Many Requests). The same limit applies to /contacts/search/count.
Difference between the two search endpoints
| Search by email/phone | Free-text search | |
|---|---|---|
| Namespace | /api/client/ |
/api/v1/ |
| Fields | Email or phone only | name, email, identifier, phone, company |
| Match type | Exact | Partial (ILIKE) |
| Pagination | No | Yes (15 per page) |
| Result total | β | Separate endpoint (/search/count) |
2. List a contact's tickets
When to use
You already have the CONTACT_ID and want to list that customer's tickets:
-
Show the service history
-
View open or resolved tickets
-
Integrate with a CRM or internal portal
Endpoint
GET https://{CLOUDCHAT_DOMAIN}/api/client/accounts/{ACCOUNT_ID}/contacts/{CONTACT_ID}/conversations?page=1&limit=10
Parameters
-
pageβ required -
limitβ optional (default: 10)
What it returns
-
Ticket IDs
-
Status (open, resolved, etc.)
-
Priority
-
Inbox
-
Creation dates
-
Whether it was started by a campaign
3. List a ticket's messages
When to use
To retrieve the message history of a ticket:
-
Real-time auditing
-
Display the conversation in another interface
-
Debug integrations
Endpoint
GET https://{CLOUDCHAT_DOMAIN}/api/client/accounts/{ACCOUNT_ID}/conversations/{CONVERSATION_ID}/messages?page=1&limit=10
What it returns
-
Message content
-
Type (incoming / outgoing)
-
Public or private
-
Creation date
-
Message status
-
Attachment links (if any)
How these APIs connect (typical flow)
-
Find the contact by email or phone
-
Get the
CONTACT_ID -
List that contact's tickets
-
Pick a ticket
-
List the ticket's messages
All of this without changing any data.
Risk level
Medium risk β they do not change data, but they query the production database in real time.
Best practices:
-
Avoid aggressive loops
-
Use caching whenever possible
-
Do not use for bulk exports
Common mistakes
-
Using these APIs for historical reports
-
Forgetting the
pageparameter -
Mixing up
CONTACT_IDandCONVERSATION_ID -
Trying to create or update data with
GET
Conversation tags (labels) and how to find the contact_id
Tags applied to a conversation have their own endpoint (in Chatwoot, the base of Cloud Chat, they are called labels):
GET https://{CLOUDCHAT_DOMAIN}/api/v1/accounts/{ACCOUNT_ID}/conversations/{CONVERSATION_ID}/labels
To find the contact_id from the CONVERSATION_ID you don't need a separate endpoint β the conversation details already return it:
GET https://{CLOUDCHAT_DOMAIN}/api/v1/accounts/{ACCOUNT_ID}/conversations/{CONVERSATION_ID}
In the response, meta.sender.id is the contact_id of the contact who owns the conversation. The same meta.sender object includes the name, email, phone, and other identifiers.
Both endpoints require an api_access_token from a user with the appropriate permission.
Notes
-
To change status, priority, or team: How to update and act on tickets via API
-
For reports and BI (historical extraction): How to extract data in bulk via API
-
Overview of the available APIs: Master Guide β How to access and operate Cloud Chat data via API