Atune Docs
API reference

Capture a behavior event

Stores one behavior event for an account. Scoring is not triggered here; the scheduled recompute job remains the sole writer of health and inbox outcomes.

Capture an event
curl -X POST https://staging.useatune.com/api/v1/events \  -H "Authorization: Bearer <YOUR_API_KEY>" \  -H "Content-Type: application/json" \  -d '{    "accountId": "acme",    "userId": "user_123",    "event": "feature.report.generated",    "properties": { "reportType": "activation" }  }'

Sign in to find your API key in Settings.

POST
/api/v1/events

Stores one behavior event for an account. Scoring is not triggered here; the scheduled recompute job remains the sole writer of health and inbox outcomes.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Workspace API key from Atune settings or onboarding.

Request Body

application/json
  1. body
accountId*string

External account ID in the customer app.

Length1 <= length
userId?string

Optional external user ID inside the account.

event*string

Event name, for example feature.report.generated.

Length1 <= length
properties?

Behavior metadata. Request bodies should never be sent.

timestamp?string

ISO timestamp. Defaults to the ingest time.

Formatdate-time
messageId?string

Optional idempotency key, 1-128 printable characters without spaces. The same messageId sent again by the same workspace stores one event, so a retry never makes a duplicate. A malformed messageId is rejected with 400.

Match^[\x21-\x7e]+$
Length1 <= length <= 128
accountStage?string

Optional lifecycle enrichment. Unknown values are ignored. Atune never infers paying; an account that has never been sent a stage is shown as a trial, marked as assumed. past_due means a paying account whose payment is failing. canceled means the customer cancelled; Atune keeps the date. Sending paying or trial again clears either.

Value in"trial""paying""past_due""canceled"
trialEndsAt?string

Optional real trial end date.

Formatdate-time
accountPlan?string

Optional plan name in your product, for example Pro. Trimmed; last write wins. Invalid values are ignored.

Lengthlength <= 100
accountSeats?integer

Optional number of seats the account pays for. Last write wins. Invalid values are ignored.

Range1 <= value
accountMrr?number

Optional monthly amount the account pays, in major units (49.5 = 49.50). 0 is kept. A change is recorded in the account's subscription history; a lower value on a paying account opens a Downgraded action. Invalid values are ignored.

Range0 <= value
accountCurrency?string

Optional ISO 4217 code for accountMrr, for example NOK. Invalid values are ignored.

Match^[A-Za-z]{3}$
accountCancelReason?string

Optional, with accountStage canceled. Why the customer cancelled, from this fixed list; any other value is ignored. Never free text.

Value in"price""missing_feature""switched""no_longer_needed""support""other"
[key: string]?any

Response Body

Event stored.

application/json
  1. response
ok*boolean
deduped?boolean

True when an event with this messageId was already stored; nothing new was written.

account*
user*|null
Example Request
curl -X POST 'https://useatune.com/api/v1/events' \  -H 'Content-Type: application/json' \  -d '{  "accountId": "acme",  "userId": "user_123",  "event": "feature.report.generated",  "properties": {    "reportType": "activation",    "source": "dashboard"  },  "accountStage": "trial",  "trialEndsAt": "2026-08-15T00:00:00.000Z",  "accountPlan": "Pro",  "accountSeats": 10,  "accountMrr": 490,  "accountCurrency": "NOK"}'
Example Response
{  "ok": true,  "account": {    "id": "cm123",    "externalId": "acme"  },  "user": {    "id": "cm456",    "externalId": "user_123"  }}