# Track an event for a person (Customer.io)

`POST /v1/compat/customerio/api/v1/customers/{identifier}/events`

Requires an API key with the `contacts:write events:write` scope. [About keys and scopes](/docs/api/authentication)

Customer.io's Track API v1, so an app sending to Customer.io can send here too while it moves, by pointing its client at `…/v1/compat/customerio`. Authenticate as Customer.io clients do, with HTTP Basic: any site id as the user and an Kirora API key as the password (a Bearer key works too). The identifier is the contact's `externalId`, or its email when it holds an `@`. `first_name`, `last_name`, `email` and `phone` fill those fields, `unsubscribed: true` withdraws email consent, and every other key becomes an attribute. Consent is never granted here: import it with its evidence. Agent keys are refused. A person not yet known is created first.

Requires API-key scope: `contacts:write` and `events:write`.

## Path parameters

- `identifier` (string, required, 1–255 characters)

## Request body

- `name` (string, required, 1–128 characters)
- `data` (object, optional)
- `timestamp` (integer, optional, min > 0, max 9007199254740991)
- `id` (string, optional, 1–255 characters)

## Returns

Returns `200 OK`. Otherwise returns an error; [Errors](/docs/api/errors) lists every code and which to retry.

## Example

```bash
curl -X POST https://api.kirora.io/v1/compat/customerio/api/v1/customers/identifier_example/events \
  -H "Authorization: Bearer $KIRORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Weekend specials"
  }'
```

Response `200`:

```json
{}
```
