Skip to main content
POST
/
track
import { Autumn as autumn } from 'autumn-js';

await autumn.track({
customer_id: 'user_123',
feature_id: 'messages',
value: 3
});
{
  "id": "evt_2w5dzidzFD1cESxOGnn9frVuVcm",
  "code": "event_received",
  "customer_id": "user_123",
  "feature_id": "messages"
}
This endpoint is for tracking usage events in Autumn, so feature usage can be limited or billed for.
If the customer_id you send doesn’t already exist, Autumn will automatically create a new customer. You can optionally set the properties of this new customer through the customer_data field.

Authorizations

Authorization
string
header
required

Use your Autumn Secret Key as the Bearer token.

Body

application/json
feature_id
string
required

ID of the feature to track usage for.

customer_id
string
required

ID which you provided when creating the customer

value
integer
default:1

How much usage should be deducted from the balance. Default is 1.

entity_id
string

If using entity balances (eg, seats), the entity ID to track usage for.

event_name
string

An event name can be used in place of feature_id. This can be used if multiple features are tracked in the same event.

idempotency_key
string

Unique identifier for the event. If the an event with the same key is sent multiple times, any subsequent events will be ignored and return an error.

properties
object

Event properties that you can define.

customer_data
object

Additional customer properties. These will be used if the customer's properties are not already set.

Response

200 - application/json
id
string

Unique identifier for the event

code
string

Status code indicating the result of sending the event

customer_id
string

Your unique identifier for the customer

feature_id
string

ID of the feature being tracked