Report a usage event

View as Markdown

Reports a single usage event for a customer. The event_name must match an active usage event definition configured for your account.

If no properties are provided, a default count: 1 property is added automatically.

Authentication

AuthorizationBearer

Use a secret key (sk_test_* or sk_live_*) for full read/write access, or a public key (pk_test_* or pk_live_*) for read-only access.

Request

This endpoint expects an object.
customer_idstringRequiredformat: "uuid"
The customer who performed the action.
event_namestringRequired
The name or ID of the usage event definition. Must match an active event in your account.
subscription_idstring or nullOptionalformat: "uuid"
Optional subscription to associate the event with.
timestampdatetime or nullOptional
When the event occurred. Defaults to the current time.
propertiesmap from strings to any or nullOptional

Custom key-value properties for the event.

idempotency_keystring or nullOptional
Unique key to prevent duplicate event processing.

Response

Usage event reported successfully
dataobject

Errors

401
Unauthorized Error
403
Forbidden Error
422
Unprocessable Entity Error
500
Internal Server Error