Skip to main content
This feature is in public preview.
Events form an append-only log of what happens on your account, such as instances starting and terminating or orders filling. Only events from the last 7 days are available. Authenticate with a bearer token, as described in Using the API.
The response holds a page of events in data.
action names what happened, and occurred_at records when, as a Unix timestamp in seconds. actor is the API token whose request caused the event, or { "type": "system" } for automated actions, such as a preemption or a scheduled end. targets lists the resources the event is about as {type, id} pairs. Each id is the same ID the rest of the API uses for that resource.

Event types

The table below lists each event type and its target type. To filter by resource, pass a target type as target_type or a single resource’s ID as target. New event types are added over time, so if you don’t filter by action, expect actions that aren’t in this table. For a given instance, instance.created, instance.running, and instance.terminated appear in that order. An instance terminated while still awaiting allocation has no instance.running event.

Consuming the stream

List events with GET /preview/v2/events. Events are returned oldest first, up to limit per request. limit defaults to 50 and is capped at 200. To fetch the next page, pass the response’s cursor back as starting_after. has_more tells you whether more events are already available. When data is empty and has_more is false, you have read everything so far. That response carries no cursor, so keep the one you sent and poll with it again later. Filter with action for an exact event type, target for one resource, target_type for one type of resource, and since and until for inclusive bounds on occurred_at, given as Unix timestamps. Filters combine, so a single request can ask for one event type on one resource.
A cursor only works with the filters it was created with, and reusing it with different filters returns 400 Bad Request. If a saved cursor falls outside the 7-day retention window, requests with it return 410 Gone. In that case, start over without a cursor to read from the oldest available event.

API reference

See the Events API for every parameter and response field.