Atune Docs
API reference

Ingest Segment messages

Accepts Segment-style `track`, `identify`, `group`, or batch payloads. Batches may be a `{ batch: [...] }` envelope or a bare array (as sent by Segment's Webhooks (Actions) destination with batching enabled). A batch may be up to 512 KB and 1000 messages; each message, alone or in a batch, is limited to 16 KB (an oversized message inside a batch is listed in `rejected`). Every message counts toward the workspace write limit of 100 per 10 seconds. Segment is a compatibility ingress path; after mapping, messages use the same internal ingest core as native Atune capture. `track` and `identify` may omit the account when `userId` is set. Atune then uses the account the user was most recently grouped into. For a user with no account, `identify` creates none and keeps the traits until one does; `track` makes the user an account of one. Account IDs may be strings or numbers, and `company_id`, `account_id` and `group_id` are read too. In a batch, invalid messages are listed in `rejected` and the valid ones are still stored.

Send a Segment track
curl -X POST https://test.useatune.com/api/v1/segment \  -H "Authorization: Bearer <YOUR_API_KEY>" \  -H "Content-Type: application/json" \  -d '{    "type": "track",    "messageId": "seg-msg-001",    "event": "Invoice Sent",    "userId": "user_123",    "properties": {      "accountId": "acme",      "amount": 1200    }  }'

Sign in to find your API key in Settings.

POST/api/v1/segment

Accepts Segment-style track, identify, group, or batch payloads. Batches may be a { batch: [...] } envelope or a bare array (as sent by Segment's Webhooks (Actions) destination with batching enabled). A batch may be up to 512 KB and 1000 messages; each message, alone or in a batch, is limited to 16 KB (an oversized message inside a batch is listed in rejected). Every message counts toward the workspace write limit of 100 per 10 seconds. Segment is a compatibility ingress path; after mapping, messages use the same internal ingest core as native Atune capture.

track and identify may omit the account when userId is set. Atune then uses the account the user was most recently grouped into. For a user with no account, identify creates none and keeps the traits until one does; track makes the user an account of one. Account IDs may be strings or numbers, and company_id, account_id and group_id are read too. In a batch, invalid messages are listed in rejected and the valid ones are still stored.

Authorization

bearerAuth
AuthorizationBearer <token>

Workspace API key from Atune settings or onboarding.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/segment" \  -H "Content-Type: application/json" \  -d '{    "type": "track",    "messageId": "seg-msg-001",    "event": "Invoice Sent",    "userId": "user_123",    "properties": {      "accountId": "acme",      "amount": 1200    }  }'

{  "ok": true,  "deduped": true,  "source": "segment",  "account": {    "id": "cm123",    "externalId": "acme"  },  "user": null}