Autumn's V2 API is live in beta. We recommend using this version.
import { Autumn } from 'autumn-js';
const autumn = new Autumn();
const { data, error } = await autumn.track({ customer_id: 'x' });{
"customer_id": "customer_123",
"feature_id": "api_tokens"
}import { Autumn } from 'autumn-js';
const autumn = new Autumn();
const { data, error } = await autumn.track({ customer_id: 'x' });{
"customer_id": "customer_123",
"feature_id": "api_tokens"
}This endpoint is for tracking usage events in Autumn, so feature usage can be limited or billed for.Documentation Index
Fetch the complete documentation index at: https://docs-v1.useautumn.com/llms.txt
Use this file to discover all available pages before exploring further.
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.Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ID which you provided when creating the customer
ID of the feature to track usage for. Required if event_name is not provided. Use this for direct feature tracking.
An event name can be used in place of feature_id. This can be used if multiple features are tracked in the same event.
The amount of usage to record. Defaults to 1. Can be negative to increase the balance (e.g., when removing a seat).
Additional properties to attach to this usage event.
Show child attributes
Unique key to prevent duplicate event recording. Use this to safely retry requests without creating duplicate usage records.
Additional customer properties. These will be used to create or update the customer if they don't exist or their properties are not already set.
Show child attributes
If using entity balances (eg, seats), the entity ID to track usage for.
How to handle usage when balance is insufficient. 'cap' limits usage to available balance, 'reject' prevents the usage entirely.
cap, reject