Timeline events

Change a zone once, at a set time in the next seven days.

A timeline event is a one-off change to one or more zones at a future moment: "set my side to 18 °C at 22:30 tonight". It runs once and is gone.

Events or schedules

You wantUse
A change at one moment, onceA timeline event
A change every night, or on some weekdaysUpdate sleep schedules
Different values for one nightChange one night
A change right nowSet zone or Set multiple zones

The steps of a sleep schedule are not timeline events. You cannot list or cancel them here; change them with the schedule operations.

Schedule an event

Schedule timeline event takes the device, the time and the zone changes:

POST /v1/timeline-events
{
	"device_id": "3f6c2a9e-8b1d-4c57-9a0e-2d4b7f1c6e85",
	"at": "2026-12-04T22:30:00-08:00",
	"zones": [{ "id": "zone_a", "temp": 18 }],
	"label": "pre_sleep_cool"
}
JSON
FieldWhat it is
atWhen the event runs: an ISO 8601 date and time with a time zone offset, such as 2026-12-04T22:30:00-08:00. Seconds are dropped.
zonesThe changes to make. Each zone needs temp (°C), on, or both.
labelOptional. A lowercase name of up to 40 letters, digits and underscores. Defaults to manual. Names the sleep schedule uses for its own steps, such as bedtime, are refused.

The answer is the new event:

{
	"id": "9b2e4f10-5a7c-4d3b-8e61-0c9d2a4b7f33-SN0012345-pre_sleep_cool-1796452200000",
	"label": "pre_sleep_cool",
	"scheduledTime": "2026-12-05T06:30:00.000Z",
	"status": "pending",
	"zones": [{ "id": "zone_a", "temp": 18 }]
}
JSON

Rules

  • The time must be in the future, and at most 7 days away.
  • Events on the same zone must be at least 5 minutes apart.
  • temp must be inside the device's temperature_range from List devices. Unlike Set zone, a value outside it is refused.
  • Events run only on the device you are on now, and only on zones that device has.
  • An event that cannot run within 30 minutes of its time is skipped, not run late.
  • Sending the same event again does not add a second one.

List pending events

List timeline events returns the events on a device that have not run yet. Pass the device id as a query parameter:

GET /v1/timeline-events
curl "https://api.orionsleep.com/v1/timeline-events?device_id=3f6c2a9e-8b1d-4c57-9a0e-2d4b7f1c6e85" \
  -H "Authorization: Bearer $ORION_API_KEY"
Shell
{
	"events": [
		{
			"id": "9b2e4f10-5a7c-4d3b-8e61-0c9d2a4b7f33-SN0012345-pre_sleep_cool-1796452200000",
			"label": "pre_sleep_cool",
			"scheduledTime": "2026-12-05T06:30:00.000Z",
			"status": "pending",
			"zones": [{ "id": "zone_a", "temp": 18 }]
		}
	]
}
JSON

Cancel events

Cancel timeline events takes the device and one event_id, or several in event_ids:

DELETE /v1/timeline-events
{
	"device_id": "3f6c2a9e-8b1d-4c57-9a0e-2d4b7f1c6e85",
	"event_ids": ["9b2e4f10-5a7c-4d3b-8e61-0c9d2a4b7f33-SN0012345-pre_sleep_cool-1796452200000"]
}
JSON

Each id gets its own result, and one failing does not stop the others:

StatusMeaning
cancelledThe event will not run.
not_foundThe event already ran, was already cancelled, or does not exist.
forbiddenIt is another person's event, and you are not an owner or admin of the device.
errorCancelling failed. Try again.