Synchronously ingest billable events

View as Markdown
Accepts a single billable event and inserts it synchronously into the database.

Authentication

AuthorizationBearer
API key obtained from the Afternoon dashboard

Request

This endpoint expects an object.
event_namestringRequired1-255 characters
Name of the event
idempotency_keystringRequired1-255 characters
Unique key to prevent duplicate event processing
customer_idstringRequiredformat: "cuid"
Customer identifier
timestampdatetimeRequired

Event timestamp in ISO 8601 UTC format (Z or +00:00)

propertiesmap from strings to anyOptional
Additional event properties

Response

Events processed synchronously
successboolean
statusenum
Processing outcome for the submitted event
Allowed values:
request_idstring
Request ID for tracing
usage_idstring
Created or existing billable event ID
costlist of objects
Aggregated event cost by wallet denomination. Present on successful requests.
customer_balanceslist of objects
Current customer wallet balances across denominations after ingestion.
errorobject

Errors

400
Bad Request Error
401
Unauthorized Error
413
Content Too Large Error
429
Too Many Requests Error
500
Internal Server Error