Orion Intelligence

See what Orion Intelligence changed in your schedule and why, then undo, accept or reject it.

Orion Intelligence adjusts your sleep schedule over time. It either applies a change itself or suggests one for you to accept. Two operations let you review and act on those changes. Both cover only your own changes.

List changes

List Orion Intelligence changes returns your change history, newest first: every change Orion Intelligence made to or suggested for your schedule.

GET /v1/intelligence/changes

Each change says what changed, from what value to what value, on which days, and why. These fields matter most:

FieldWhat it is
idThe change id. Act on changes takes it.
decision_idThe decision this change belongs to. One decision can show as several changes.
phaseThe schedule phase it changed: bedtime, night, dawn or alarm. null for a program (below).
statusapplied, suggested, undone, rejected or expired.
actionsWhat you may do with it now: ["undo"] for an applied change, ["accept", "reject"] for a suggestion, or none.

A program is a temperature plan that Orion Intelligence runs over a range of nights, rather than a change to one phase.

Pages

The list comes in pages. limit sets the page size, 1 to 100, default 50. When there are more, the answer has a next value; pass it back as before to get the next page. next is null on the last page.

curl "https://api.orionsleep.com/v1/intelligence/changes?limit=20" \
  -H "Authorization: Bearer $ORION_API_KEY"
Shell

To see how changes shape a given night, read Get sleep schedules: its nights include Orion Intelligence's changes, with changes saying what changed and why. See Schedules.

Undo, accept or reject

Act on Orion Intelligence changes takes an action and one change_id, or several in change_ids:

POST /v1/intelligence/changes
ActionDoes
undoUndoes an applied change.
acceptAccepts a suggestion, so it is applied.
rejectRejects a suggestion.
seenMarks changes as seen. Nothing else changes.
{
	"action": "undo",
	"change_id": "the id of a change from the list"
}
JSON

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

{
	"results": [
		{
			"change_id": "the id you sent",
			"decision_id": "6a0f3c2e-8d41-4b7a-9e15-2c6d8f0a4b97",
			"ok": false,
			"status": "expired"
		}
	]
}
JSON

Check ok on each result. A status such as expired means a suggestion is no longer current, so it cannot be accepted. Read the list again to see what you can do now.