Search contacts
SDK platic.clients.search()
Search contacts by name, phone number or email. Filter by tags, WhatsApp status and one custom field.
The response includes a page and a searchId that keeps all results for 12 hours. Use it to add them to a campaign, remove them from one or tag them without copying the list.
Example
curl -X POST https://api.platic.ai/v1/clients/search \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "tags": ["vip"], "customFieldFilter": { "fieldId": "city", "operator": "eq", "value": "CDMX" } }' const { totalFound, searchId } = await platic.clients.search({
tags: ["vip"],
customFieldFilter: { fieldId: "city", operator: "eq", value: "CDMX" },
}); Find the VIP customers in Mexico City.
Your assistant uses search_clients.
Request body
It searches a single workspace: the credential's, or the one in ?workspace= if it has several. All fields are optional.
| Field | Type | Required | Description |
|---|---|---|---|
query | string | — | Free text: name, phone number or email. Up to 200 characters |
phone | string | — | An exact phone number; its variants are tried |
tags | string[] | — | Contacts with at least one of these tags, up to 10 |
whatsappStatus | string | — | The contact's WhatsApp status, such as active or opted_out |
customFieldFilter | object | — | { fieldId, operator, value }: fieldId from custom fields, operator eq (default) or contains, and value (on an options field, the option's label) |
page | number | — | The page, from 1 |
perPage | number | — | Results per page, from 1 to 250. Default, 25 |
Response
{
"status": "success",
"data": {
"message": "312 contacts found. Page 1 of 13 (25 results).",
"totalFound": 312,
"results": [
{
"id": "c_8fK2pQx7",
"name": "Ana",
"phoneNumber": "5215512345678",
"email": "ana@acme.com",
"tags": ["vip"],
"whatsappStatus": "active",
"customFields": { "city": "CDMX" }
}
],
"pagination": { "currentPage": 1, "totalPages": 13, "perPage": 25, "totalResults": 312, "hasNextPage": true, "hasPreviousPage": false },
"searchId": "srch_4f9a2c",
"searchExpiresAt": "2026-11-24T06:00:00.000Z",
"searchCachedHits": 312
}
} | Field | Description |
|---|---|
totalFound | How many contacts match |
results | The contacts on this page |
searchId | Stores all the results until searchExpiresAt (12 hours). After that, search again |
searchCachedHits | How many results the searchId stores |
Errors
| Status | details.code | When it happens |
|---|---|---|
400 | INVALID_REQUEST | A field is not valid. details.issues says which one |
400 | INVALID_REQUEST | The credential covers several workspaces and ?workspace= is missing, or the supplied workspace is not authorized. details.available lists the available ones and details.requested shows the one you sent |
401 | UNAUTHENTICATED | The credential is missing or invalid |
403 | FORBIDDEN | The credential does not have the Contacts module (Missing contacts permission) |
4xx | UPSTREAM_REFUSED | Platica refused the operation. The status is the one it answered and details.message carries its text |
502 | UPSTREAM_ERROR | Platica failed to complete the operation. Try again |
The general error format is in Errors.