List messages
GET/messages
Paginated list. Filters: status, numberId, contactId, campaignId, batchId, sentByAccountId, from, to, limit, skip. Default order is createdAt desc.
PII fields (recipient to) are masked unless the caller has pii:full.
Parameters
| Field | In | Type | Description |
|---|---|---|---|
statusoptional | query | string | Values:queuedsendingsentdeliveredreadfailedarchived |
numberIdoptional | query | string | Branded Number id (num_ prefix + 21 nano-id chars). |
contactIdoptional | query | string | Branded Contact id (cnt_ prefix + 21 nano-id chars). |
campaignIdoptional | query | string | Filter by external campaign tag. Used by the dashboard to scope a 'reprocess all failures of this campaign' action. |
batchIdoptional | query | string | Branded batch id (btc_ prefix + 21 nano-id chars). |
sentByAccountIdoptional | query | string | Filter by the operator who sent the message. Powers the dashboard's per-agent view, where every counter has to follow the selected attendant. |
fromoptional | query | string · date-time | ISO-8601 timestamp in UTC. |
tooptional | 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 Message id ( msg_prefix + 21 nano-id chars).items[].organizationIdrequiredstringBranded Organization id ( org_prefix + 21 nano-id chars).items[].channeloptionalstringCanal da mensagem. Ausente em linhas antigas, anteriores ao campo — leia como whatsapp.Values:whatsappemailsmsinstagramitems[].numberIdoptionalstringBranded Number id ( num_prefix + 21 nano-id chars).items[].instagramAccountIdoptionalstringBranded Instagram account id ( iga_prefix + 21 nano-id chars).items[].mediaStorageoptionalobjectitems[].mediaStorage.mimeTypeoptionalstringMime REAL do binário, lido do Content-Type. items[].mediaStorage.sizeoptionalintegeritems[].mediaStorage.storedAtoptionalstring · date-timeitems[].contactIdoptionalstringBranded Contact id ( cnt_prefix + 21 nano-id chars).items[].campaignIdoptionalstringOptional external campaign tag carried through from the create call. Surfaced as a filter on GET /messagesand as a selector onPOST /messages/bulk-resend.items[].metadataoptionalobjectMetadados de correlação do seu sistema (ex.: customerId, journeyId), devolvidos intactos em todo webhook desta mensagem. Até 20 chaves; chave começa por letra e usa [A-Za-z0-9_.-] (até 64); valor é texto (até 256), número ou booleano. Não envie dado pessoal aqui. items[].templateIdoptionalstringBranded Template id ( tpl_prefix + 21 nano-id chars).items[].batchIdoptionalstringBranded batch id ( btc_prefix + 21 nano-id chars).items[].torequiredstringDestino, no formato do canal: telefone E.164 (whatsapp/sms), endereço de e-mail (email) ou IGSID (instagram). PII_SENSITIVE — mascarado a menos que o chamador tenha pii:full.items[].typerequiredstringValues: texttemplatemediainteractiveitems[].directionrequiredstringValues: outboundinbounditems[].priorityrequiredstringValues: normalbulkcriticalitems[].statusrequiredstringValues: queuedsendingsentdeliveredreadfailedarchiveditems[].forcerequiredbooleanWhen true the worker bypasses token bucket + quiet hours. Persisted for audit; only the forceroute sets it.items[].reprocessedoptionalbooleanTrue when a dashboard operator manually reprocessed this message. replacedBypoints to the new message.items[].replacedByoptionalstringBranded Message id ( msg_prefix + 21 nano-id chars).items[].payloadrequiredanyOpaque per-type payload (text body, template ref, etc). items[].templateVarsoptionalstring[]items[].attemptsrequiredintegeritems[].lastErroroptionalstringMost recent failure reason. After cancelAsReprocessed(or bulk-resend) this is overwritten with a 'substituted by ...' pointer string — seeoriginalErrorfor the underlying cause.items[].originalErroroptionalstringSnapshot of lastErrortaken the first time the message is reprocessed. Audit-trail field — never overwritten on subsequent transitions.items[].metaMessageIdoptionalstringitems[].origemDoLinkoptionalobjectDe onde veio a mensagem que trouxe o código do link de WhatsApp (fonte, campanha, grupo, anúncio e palavra-chave do link) e o código que estava no texto. Só em mensagem recebida. items[].origemDoLink.fonteoptionalstringValues: googlemetatiktokoutraitems[].origemDoLink.fonteRotulooptionalstringO nome livre da fonte ( src=do link) quandofonteéoutra.items[].origemDoLink.campanhaoptionalstringitems[].origemDoLink.grupooptionalstringitems[].origemDoLink.anunciooptionalstringitems[].origemDoLink.palavraChaveoptionalstringitems[].origemDoLink.codigooptionalstringO código que estava no texto, entre parênteses. O texto da mensagem não é alterado. items[].sentByAccountIdoptionalstringitems[].sentByNameoptionalstringOperator display name (when sent from the dashboard). items[].scheduledAtoptionalstring · date-timeISO-8601 timestamp in UTC. items[].sentAtoptionalstring · date-timeISO-8601 timestamp in UTC. items[].deliveredAtoptionalstring · date-timeISO-8601 timestamp in UTC. items[].readAtoptionalstring · date-timeISO-8601 timestamp in UTC. items[].failedAtoptionalstring · date-timeISO-8601 timestamp in UTC. items[].createdAtrequiredstring · date-timeISO-8601 timestamp in UTC. items[].updatedAtrequiredstring · date-timeISO-8601 timestamp in UTC. totalrequiredintegerJSON{ "items": [ { "id": "msg_aB3xY9zQ1pTkLmNoPqRsT", "organizationId": "org_pGgniw5L7CTDSZDwjDrQ2", "channel": "whatsapp", "numberId": "num_aB3xY9zQ1pTkLmNoPqRsT", "instagramAccountId": "iga_aB3xY9zQ1pTkLmNoPqRsT", "mediaStorage": { "mimeType": "string", "size": 0, "storedAt": "2026-10-16T12:00:00.000Z" }, "contactId": "cnt_aB3xY9zQ1pTkLmNoPqRsT", "campaignId": "string", "metadata": { "customerId": "123", "journeyId": "reativacao-q4" }, "templateId": "tpl_uV2aLwzXMqNmKjHbPiRoT", "batchId": "btc_aB3xY9zQ1pTkLmNoPqRsT", "to": "+5511999998888", "type": "text", "direction": "outbound", "priority": "normal", "status": "queued", "force": true, "reprocessed": true, "replacedBy": "msg_aB3xY9zQ1pTkLmNoPqRsT", "payload": null, "templateVars": [ "string" ], "attempts": 0, "lastError": "string", "originalError": "string", "metaMessageId": "wamid.HBgN...", "origemDoLink": { "fonte": "tiktok", "fonteRotulo": "bio", "campanha": "Verão", "grupo": "Corredores SP", "anuncio": "Corrida no parque", "palavraChave": "tênis de corrida", "codigo": "K7Q2X" }, "sentByAccountId": "string", "sentByName": "string", "scheduledAt": "2026-04-07T17:30:00.000Z", "sentAt": "2026-04-07T17:30:00.000Z", "deliveredAt": "2026-04-07T17:30:00.000Z", "readAt": "2026-04-07T17:30:00.000Z", "failedAt": "2026-04-07T17:30:00.000Z", "createdAt": "2026-04-07T17:30:00.000Z", "updatedAt": "2026-04-07T17:30:00.000Z" } ], "total": 42}
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/messages' \ -H "Authorization: Bearer $CCX_API_KEY"