Exporta as mensagens de WhatsApp de um período
GET/v2/exports/whatsapp
Todas as mensagens de WhatsApp criadas entre from e to (inclusive; até 31 dias por consulta), da mais recente para a mais antiga, com a correlação dos webhooks: metadata, campaignId, contactId e o seu Customer ID (contactExternalId).
Paginação por cursor: passe o nextCursor da resposta em cursor até ele voltar null. O custo por página é constante, qualquer que seja a profundidade.
Ambiente: vem da credencial — chave de teste exporta o sandbox.
O destinatário (to) sai mascarado sem o escopo pii:full.
Permissão: messages:read.
Parameters
| Field | In | Type | Description |
|---|---|---|---|
fromrequired | query | string · date-time | Início do período (inclusive), ISO 8601. |
torequired | query | string · date-time | Fim do período (inclusive), ISO 8601. |
cursoroptional | query | string | O nextCursor da página anterior. Ausente = primeira página. |
limitoptional | query | integer | Linhas por página (padrão 500, máximo 1000). |
Responses
200Default ResponseResponse fields and example
Field Type Description itemsrequiredobject[]items[].idrequiredstringitems[].channelrequiredstringValues: whatsappsmsrcsemailitems[].directionrequiredstringValues: outboundinbounditems[].torequiredstringitems[].statusrequiredstringitems[].campaignIdoptionalstringitems[].contactIdoptionalstringitems[].contactExternalIdoptionalstringitems[].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[].createdAtrequiredstringitems[].sentAtoptionalstringitems[].deliveredAtoptionalstringitems[].readAtoptionalstringitems[].failedAtoptionalstringitems[].reasonoptionalstringitems[].segmentsoptionalintegeritems[].deliveredViaoptionalstringValues: rcssmsitems[].subjectoptionalstringnextCursorrequiredstring | nullJSON{ "items": [ { "id": "string", "channel": "whatsapp", "direction": "outbound", "to": "string", "status": "string", "campaignId": "string", "contactId": "string", "contactExternalId": "string", "metadata": {}, "createdAt": "string", "sentAt": "string", "deliveredAt": "string", "readAt": "string", "failedAt": "string", "reason": "string", "segments": 1, "deliveredVia": "rcs", "subject": "string" } ], "nextCursor": "string"}
400RFC 7807 problem details for BAD_REQUEST (400).401RFC 7807 problem details for UNAUTHORIZED (401).403RFC 7807 problem details for FORBIDDEN (403).422RFC 7807 problem details for VALIDATION_ERROR (422).
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/v2/exports/whatsapp?from=2026-10-16T12%3A00%3A00.000Z&to=2026-10-16T12%3A00%3A00.000Z' \ -H "Authorization: Bearer $CCX_API_KEY"