How to hit the Customer.io API

Customer.io has two APIs: the Track API (https://track.customer.io/api/v1) records people and events, and the App API (https://api.customer.io/v1) sends transactional messages and reads data. EU accounts use -eu hosts.

Authentication

The Track API uses Basic auth with your Site ID and Track API key — curl's -u, PostTaco's Auth tab. The App API uses an App API key as a Bearer token. Both are under Account Settings → API Credentials.

Full reference: https://docs.customer.io/api/

Create or update a person

curl -X PUT https://track.customer.io/api/v1/customers/user-123 \
  -u {{CIO_SITE_ID}}:{{CIO_TRACK_API_KEY}} \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]", "plan": "pro"}'
Run in PostTaco

Track an event

curl -X POST https://track.customer.io/api/v1/customers/user-123/events \
  -u {{CIO_SITE_ID}}:{{CIO_TRACK_API_KEY}} \
  -H "Content-Type: application/json" \
  -d '{"name": "purchased", "data": {"price": 23.45}}'
Run in PostTaco

Send a transactional email

Uses a transactional message template.

curl -X POST https://api.customer.io/v1/send/email \
  -H "Authorization: Bearer {{CIO_APP_API_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{"transactional_message_id": "{{MESSAGE_ID}}", "to": "[email protected]", "identifiers": {"id": "user-123"}}'
Run in PostTaco