Start free

API reference

Customer events

Record purchases and other conversions from your system, attributed to the last message sent to the contact within the window (7 days by default).

  • 2 operations
  • Base URLhttps://api.messages.ccxcompany.co
  • AuthenticationBearer with your API key

The technical text below comes from the public contract, openapi.json, in the language the contract was written in.

Lista os eventos do cliente de um período

GET/v2/events

Do mais recente para o mais antigo, com a atribuição de cada um. Permissão: contacts:read.

Parameters

FieldInTypeDescription
fromrequiredquerystring · date-time
torequiredquerystring · date-time
nameoptionalquerystring
contactIdoptionalquerystring
limitoptionalqueryinteger

Responses

  • 200Default Response

    Response fields and example
    FieldTypeDescription
    itemsrequiredobject[]
    items[].idrequiredstring
    items[].namerequiredstring
    items[].eventIdrequiredstring
    items[].contactIdoptionalstring
    items[].contactExternalIdoptionalstring
    items[].occurredAtrequiredstring
    items[].valueoptionalnumber
    items[].currencyoptionalstring
    items[].propertiesoptionalobjectMetadados 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[].attributionrequiredobject | null
    items[].attribution.messageIdrequiredstring
    items[].attribution.channelrequiredstringValues:whatsappsmsrcsemail
    items[].attribution.campaignIdoptionalstring
    items[].attribution.sentAtrequiredstring
    items[].attribution.horasAteOEventorequirednumber
    items[].attribution.journeyIdoptionalstring
    items[].attribution.journeyStepIdoptionalstring
    items[].attribution.journeyRunIdoptionalstring
    items[].duplicaterequiredboolean
    JSON
    {  "items": [    {      "id": "string",      "name": "string",      "eventId": "string",      "contactId": "string",      "contactExternalId": "string",      "occurredAt": "string",      "value": 0,      "currency": "string",      "properties": {},      "attribution": {        "messageId": "string",        "channel": "whatsapp",        "campaignId": "string",        "sentAt": "string",        "horasAteOEvento": 0,        "journeyId": "string",        "journeyStepId": "string",        "journeyRunId": "string"      },      "duplicate": true    }  ]}
  • 400RFC 7807 problem details for BAD_REQUEST (400).

  • 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
curl 'https://api.messages.ccxcompany.co/v2/events?from=2026-10-16T12%3A00%3A00.000Z&to=2026-10-16T12%3A00%3A00.000Z' \  -H "Authorization: Bearer $CCX_API_KEY"
Required fields only. Swap the sample values for your own.

Registra um evento do cliente (conversão) e devolve a atribuição

POST/v2/events

O que aconteceu fora da mensageria — compra, visita à loja, contrato — mandado pelo seu sistema. A CCX grava e ATRIBUI ao último toque: a mensagem enviada mais recente para o mesmo contato, em qualquer canal, dentro da janela (padrão 7 dias).

`eventId` deduplica: reenviar o mesmo eventId devolve o evento já gravado com duplicate: true.

Contato: por externalId (o seu Customer ID), contactId, phone ou email. A atribuição usa as mensagens que carregaram o contato no envio — envio pela API sem contactId não é atribuível.

Permissão: contacts:write.

Request bodyapplication/json

FieldTypeDescription
namerequiredstringNome do evento, ex.: purchase, agenda.visita_realizada.
contactrequiredobject
contact.externalIdoptionalstringO Customer ID do seu sistema.
contact.contactIdoptionalstring
contact.phoneoptionalstring
contact.emailoptionalstring · email
eventIdrequiredstringId do evento no seu sistema — deduplica o reenvio.
occurredAtoptionalstring · date-timeQuando aconteceu (padrão: agora).
valueoptionalnumberValor (ex.: da compra).
currencyoptionalstringISO 4217, padrão BRL.
propertiesoptionalobjectMetadados 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.
attributionWindowHoursoptionalintegerJanela de atribuição em horas (padrão 168 = 7 dias; máximo 720).
Full body example
JSON
{  "name": "string",  "contact": {    "externalId": "string",    "contactId": "string",    "phone": "string",    "email": "user@example.com"  },  "eventId": "string",  "occurredAt": "2026-10-16T12:00:00.000Z",  "value": 0,  "currency": "string",  "properties": {},  "attributionWindowHours": 1}

Responses

  • 200Default Response

    Response fields and example
    FieldTypeDescription
    idrequiredstring
    namerequiredstring
    eventIdrequiredstring
    contactIdoptionalstring
    contactExternalIdoptionalstring
    occurredAtrequiredstring
    valueoptionalnumber
    currencyoptionalstring
    propertiesoptionalobjectMetadados 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.
    attributionrequiredobject | null
    attribution.messageIdrequiredstring
    attribution.channelrequiredstringValues:whatsappsmsrcsemail
    attribution.campaignIdoptionalstring
    attribution.sentAtrequiredstring
    attribution.horasAteOEventorequirednumber
    attribution.journeyIdoptionalstring
    attribution.journeyStepIdoptionalstring
    attribution.journeyRunIdoptionalstring
    duplicaterequiredboolean
    JSON
    {  "id": "string",  "name": "string",  "eventId": "string",  "contactId": "string",  "contactExternalId": "string",  "occurredAt": "string",  "value": 0,  "currency": "string",  "properties": {},  "attribution": {    "messageId": "string",    "channel": "whatsapp",    "campaignId": "string",    "sentAt": "string",    "horasAteOEvento": 0,    "journeyId": "string",    "journeyStepId": "string",    "journeyRunId": "string"  },  "duplicate": true}
  • 201Default Response

    Response fields and example
    FieldTypeDescription
    idrequiredstring
    namerequiredstring
    eventIdrequiredstring
    contactIdoptionalstring
    contactExternalIdoptionalstring
    occurredAtrequiredstring
    valueoptionalnumber
    currencyoptionalstring
    propertiesoptionalobjectMetadados 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.
    attributionrequiredobject | null
    attribution.messageIdrequiredstring
    attribution.channelrequiredstringValues:whatsappsmsrcsemail
    attribution.campaignIdoptionalstring
    attribution.sentAtrequiredstring
    attribution.horasAteOEventorequirednumber
    attribution.journeyIdoptionalstring
    attribution.journeyStepIdoptionalstring
    attribution.journeyRunIdoptionalstring
    duplicaterequiredboolean
    JSON
    {  "id": "string",  "name": "string",  "eventId": "string",  "contactId": "string",  "contactExternalId": "string",  "occurredAt": "string",  "value": 0,  "currency": "string",  "properties": {},  "attribution": {    "messageId": "string",    "channel": "whatsapp",    "campaignId": "string",    "sentAt": "string",    "horasAteOEvento": 0,    "journeyId": "string",    "journeyStepId": "string",    "journeyRunId": "string"  },  "duplicate": true}
  • 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
curl -X POST 'https://api.messages.ccxcompany.co/v2/events' \  -H "Authorization: Bearer $CCX_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "contact": {},    "eventId": "string"  }'
Required fields only. Swap the sample values for your own.

Stuck on a route? Talk to the people who run the API.

Sign up through the site and get a US$5 test credit.