List contacts in the current organization
GET/contacts
Returns a paginated list. Filters: tag, optInStatus, source, externalId, listId, updatedSince, q, limit, skip.
`externalId=` acha o contato pelo Customer ID do seu sistema (igualdade exata, no máximo um resultado).
`q=` searches name, whatsappProfileName, email and phone (phone matches by DIGITS, so (11) 96459-8816 finds +5511964598816).
Until 2026-09-26 this filter was documented as requiring pii:full and being silently dropped otherwise. It was in fact never implemented in the repository layer — every caller, including pii:full ones, got the unfiltered list back.
PII_SENSITIVE fields (phone) are masked unless the caller has pii:full.
Parameters
| Field | In | Type | Description |
|---|---|---|---|
tagoptional | query | string | |
optInStatusoptional | query | string | Values:granteddeniedunknown |
sourceoptional | query | string | Values:manualimportapiwebhook |
externalIdoptional | query | string | Customer ID do seu sistema (DBM/CRM). Único na organização quando presente; aceita UUID, número, hash hex ou composto como loja:45:cliente:123. |
listIdoptional | query | string | Só os contatos desta lista estática (lst_…). |
qoptional | query | string | Free-text prefix search on name/email. Requires `pii:full`; otherwise silently dropped and a warnings entry is emitted. |
updatedSinceoptional | query | string · date-time | ISO-8601 timestamp in UTC. |
limitoptional | query | integer | |
skipoptional | query | integer |
Responses
200Default ResponseResponse fields and example
Field Type Description itemsrequiredobject[]items[].idrequiredstringBranded Contact id ( cnt_prefix + 21 nano-id chars).items[].organizationIdrequiredstringBranded Organization id ( org_prefix + 21 nano-id chars).items[].phonerequiredstringE.164 phone (PII_SENSITIVE — masked unless caller has pii:full).items[].phoneHashrequiredstringDeterministic blind index sha256(orgId + ':' + e164phone).items[].nameoptionalstringitems[].emailoptionalstring · emailitems[].avatarUrloptionalstring · uriPublic avatar URL displayed in the chat list and contact card. Accepts http(s) URLs and inline data:URIs (≤64 KB) for click-to-upload avatars stored without external storage.items[].whatsappProfileNameoptionalstringDisplay name reported by WhatsApp on inbound messages ( contacts[0].profile.name). Updated automatically; does not overwrite an operator-setname.items[].cpfCipheroptionalstringPII_CRITICAL — encrypted CPF blob (JSON-serialized EncryptedBlob). Never returned plaintext via routes; decryption requires reason+actoraudit at the service layer.items[].cnpjCipheroptionalstringPII_CRITICAL — encrypted CNPJ. items[].birthDateCipheroptionalstringPII_CRITICAL — encrypted birth date. items[].attributesrequiredobjectFree-form key/value attributes: text, number, boolean, null or a list of short texts (no nested objects). items[].documentosoptionalobjectOs documentos que o contato TEM, já mascarados no servidor (o valor completo nunca sai aqui). Só no GET de um único contato ( /contacts/:id). Para ver um por inteiro:POST /v2/contacts/:id/documentos/revelar(só sessão,contacts:pii, auditado).items[].documentos.cpfoptionalstringitems[].documentos.cnpjoptionalstringitems[].documentos.nascimentooptionalstringitems[].debtorGroupsoptionalobject[]Grupos de cobrança do contato: cada grupo é uma empresa devedora e os telefones daquele contexto. items[].debtorGroups[].idrequiredstringitems[].debtorGroups[].companyrequiredstringitems[].debtorGroups[].phonesrequiredstring[]items[].debtorGroups[].amountCentsoptionalintegerValor em aberto daquela dívida, em centavos de BRL. items[].debtorGroups[].statusoptionalstringSituação da dívida daquele grupo.Values: vencidaem_atrasoem_diaitems[].debtorGroups[].referenceoptionalstringReferência livre: nº do contrato, dias de atraso, observação. items[].tagsrequiredstring[]items[].optInrequiredobjectitems[].optIn.statusrequiredstringValues: granteddeniedunknownitems[].optIn.sourceoptionalstringitems[].optIn.atoptionalstring · date-timeISO-8601 timestamp in UTC. items[].optIn.ipoptionalstringitems[].optIn.userAgentoptionalstringitems[].optIn.revokedAtoptionalstring · date-timeISO-8601 timestamp in UTC. items[].optIn.revokedReasonoptionalstringitems[].sourcerequiredstringValues: manualimportapiwebhookitems[].externalIdoptionalstringCustomer ID do seu sistema (DBM/CRM). Único na organização quando presente; aceita UUID, número, hash hex ou composto como loja:45:cliente:123.items[].externalIdsoptionalobjectOs ids do contato nos sistemas integrados (HubSpot, Pipedrive, RD Station, Zendesk) — a chave que a sincronização com cada um usa. Ausente = o contato não está em nenhuma integração. items[].externalIds.hubspotoptionalstringitems[].externalIds.pipedriveoptionalstringitems[].externalIds.rd_stationoptionalstringitems[].externalIds.zendeskoptionalstringitems[].companyIdoptionalstringEmpresa do CRM ( emp_+ 21 caracteres) —GET /v2/companies.items[].papelNaEmpresaoptionalstringO papel do contato na empresa ( companyId): decisor, financeiro, operacao ou outro.Values:decisorfinanceirooperacaooutroitems[].lastInteractionAtoptionalstring · date-timeISO-8601 timestamp in UTC. items[].createdAtrequiredstring · date-timeISO-8601 timestamp in UTC. items[].updatedAtrequiredstring · date-timeISO-8601 timestamp in UTC. totalrequiredintegerwarningsoptionalstring[]Set when a filter was silently dropped (e.g. q=withoutpii:full).JSON{ "items": [ { "id": "cnt_aB3xY9zQ1pTkLmNoPqRsT", "organizationId": "org_pGgniw5L7CTDSZDwjDrQ2", "phone": "+5511999998888", "phoneHash": "string", "name": "Alice Andersen", "email": "alice@example.com", "avatarUrl": "https://cdn.example.com/avatars/alice.png", "whatsappProfileName": "string", "cpfCipher": "string", "cnpjCipher": "string", "birthDateCipher": "string", "attributes": {}, "documentos": { "cpf": "•••.456.789-••", "cnpj": "••.•••.678/0001-••", "nascimento": "••/••/1990" }, "debtorGroups": [ { "id": "grp_9f1c2a3b4d5e6f70", "company": "Casas Bahia", "phones": [ "+5511988887777", "1140042000" ], "amountCents": 248000, "status": "vencida", "reference": "Contrato 8842-01 · atraso 47 dias" } ], "tags": [ "string" ], "optIn": { "status": "granted", "source": "landing-page", "at": "2026-04-07T17:30:00.000Z", "ip": "203.0.113.42", "userAgent": "string", "revokedAt": "2026-04-07T17:30:00.000Z", "revokedReason": "string" }, "source": "manual", "externalId": "123", "externalIds": { "hubspot": "9001", "pipedrive": "string", "rd_station": "string", "zendesk": "string" }, "companyId": "emp_aB3xY9zQ1pTkLmNoPqRsT", "papelNaEmpresa": "decisor", "lastInteractionAt": "2026-04-07T17:30:00.000Z", "createdAt": "2026-04-07T17:30:00.000Z", "updatedAt": "2026-04-07T17:30:00.000Z" } ], "total": 42, "warnings": [ "string" ]}
401RFC 7807 problem details for UNAUTHORIZED (401).403RFC 7807 problem details for FORBIDDEN (403).
Error responses follow RFC 7807 (application/problem+json), with a stable code in the code field. See the error codes
curl example
curl 'https://api.messages.ccxcompany.co/contacts' \ -H "Authorization: Bearer $CCX_API_KEY"