Docs

Events

Every event type, its data, and how to list and replay events: what webhooks deliver, kept for a month.

An event records something that happened in your account. Every event is kept for 30 days and listed by GET /v1/events, whether or not a webhook endpoint received it, and each one is delivered to the webhook endpoints subscribed to its type.

RouteWhat it doesKey scope
GET /v1/eventsList events, newest firstaccount:read
GET /v1/events/{id}Get an eventaccount:read
POST /v1/events/{id}/redeliverDeliver an event againadmin

The event object

The body of a webhook delivery is the event object, exactly as GET /v1/events/{id} returns it:

FieldTypeDescription
objectstringAlways event.
One of event
idstringThe event ID (evt_…): the webhook-id header of every delivery, the same on retries. Deduplicate on it.
typestringThe event type (event types table); new types may be added.
timestampstring (date-time)When it happened.
dataanyThe type's data object (small: a summary plus links).

Event types

TypeWhendata
job.completedA job ended with every item ended (check request_counts: items fail individually).JobEventData
job.canceledA canceled job ended: its running items finished.JobEventData
job.expiredA job reached its deadline; its unfinished items expired.JobEventData
credits.lowA balance change took the balance from above the account's low_balance_threshold to at or below it (once per crossing; the owner is emailed too).CreditsLowData
credits.depletedThe balance reached 0 (once, until credits are added).CreditsDepletedData
api_key.spend_limit_reachedAn API key's request (or job) was refused for its spend limit, the first time in the limit's interval.SpendLimitReachedData
webhook.testSent by POST /v1/webhook_endpoints/{id}/test to that endpoint only.WebhookTestData

New types may be added; ignore the ones you don't handle. Subscribe an endpoint to a family with a wildcard (job.*) or to everything with *, and filter GET /v1/events the same way with its type parameter.

Job events

job.completed, job.canceled and job.expired carry the job's summary and links, never its results:

FieldTypeDescription
objectstringOne of job
idstring
statusstringOne of queued, running, canceling, completed, canceled, expired
request_countsobject
request_counts.totalinteger
request_counts.queuedintegerNot started.
request_counts.runningintegerStarted (fetching, waiting for a retry or walking pages).
request_counts.succeededinteger
request_counts.failedinteger
request_counts.canceledinteger
request_counts.expiredinteger
creditsobject
credits.maxintegermax_credits: the most the job may spend.
credits.reservedintegerCredits still held for items not ended (0 once the job ends).
credits.chargedintegerCredits charged so far (items' prices; failed items are free).
metadataobject
created_atstring (date-time)
finished_atstring (date-time) or null
urlstringGET this (with your API key) for the job.
results_urlstringGET this (with your API key) for its results.

url is the job and results_url its results, both read with your API key.

Account events

The balance and spend events come from the account itself (live keys only: test requests never touch the balance), and webhook.test from a test delivery. Their data:

credits.low

FieldTypeDescription
balanceintegerThe balance after the change that crossed the threshold.
low_balance_thresholdintegerThe account's low_balance_threshold at the time.

credits.depleted

FieldTypeDescription
balanceintegerThe balance: 0.

api_key.spend_limit_reached

FieldTypeDescription
api_key_idstringThe key (key_…) whose spend limit was reached.
spend_limitobjectIts spend limit.
spend_limit.amountintegerMost credits the key may spend per interval.
spend_limit.intervalstringCalendar day or month, UTC.
One of day, month
usedintegerCredits the key had used this interval (spent plus held by its requests in flight).
resets_atstring (date-time)Start of the next interval, RFC 3339 UTC: the key can spend again then.

webhook.test

FieldTypeDescription
webhook_endpoint_idstring