Introduction

Errors

Every failure answers with one JSON shape and a short code you can act on.

A successful request answers 200 with the operation's result. A failed request answers a 4xx or 5xx status with an error object.

The error envelope

Every error has the same shape:

{
	"error": {
		"code": "invalid",
		"message": "Provide at least one of temp (°C) or on (boolean) — an empty zone update does nothing."
	}
}
JSON
FieldWhat it is
error.codeA short, stable code from the table below. Branch on this in your code.
error.messageA sentence for people: what went wrong and often what to do. It can change, so do not parse it.

Error codes

CodeStatusMeaningWhat to do
invalid400The request is not valid: a missing or wrong field, a body that is not a JSON object, a date in the past.Fix the request using the message. Do not retry it unchanged.
unauthorized401The API key is missing, unknown, revoked or expired, or it is not a personal API key.Check the Authorization header, or make a new key. See Authentication.
forbidden403The key is valid, but your account may not do this, for example act on another person without the owner or admin role.Call List devices to see your role on each device.
not_found404The device, route or item does not exist, or is not yours.Check the id. Device ids come from List devices.
conflict409The data changed while you were writing it.Read it again, then send your change again.
rate_limited429You sent more than 120 requests in a minute.Wait for the Retry-After time. See Rate limits.
internal500Something failed on Orion's side.Retry with backoff.
unavailable503The service, or one feature, is not available right now. Also answered when the API is not yet available for your account.Retry later. If it persists for every request, the API is not yet open to your account.

Examples

A device id that is not an id, such as a serial number:

{
	"error": {
		"code": "invalid",
		"message": "SN0012345 is not a device id. Pass the device id (id in list_devices), not the serial."
	}
}
JSON

A device you have no access to:

{
	"error": {
		"code": "forbidden",
		"message": "Only owners and admins can move other people on this device. Call list_devices to see your role on each device."
	}
}
JSON

A path that does not exist:

{
	"error": {
		"code": "not_found",
		"message": "No route GET /v1/device."
	}
}
JSON

Operations that act on several items

A few operations take one id or a list of ids: Rate nights, Cancel timeline events and Act on Orion Intelligence changes. They answer 200 with one result per id, and one id failing does not stop the others:

{
	"results": [
		{
			"event_id": "9b2e4f10-5a7c-4d3b-8e61-0c9d2a4b7f33-SN0012345-manual-1796452200000",
			"ok": true,
			"status": "cancelled"
		},
		{
			"event_id": "9b2e4f10-5a7c-4d3b-8e61-0c9d2a4b7f33-SN0012345-manual-1796454000000",
			"ok": false,
			"status": "not_found"
		}
	]
}
JSON

Check ok on each result, not only the status code. Each operation's reference page lists its statuses.

Retrying

StatusRetry?
400, 401, 403, 404No. The same request fails the same way. Fix it first.
409Yes, after you read the current data again.
429Yes, after the Retry-After time.
500, 503Yes, with exponential backoff: wait 1 s, then 2 s, then 4 s, and give up after a few tries.

Changing a zone, a schedule or a setting to the same value twice gives the same result, so retrying those is safe. Starting thermal relief, swapping zones and splitting zones are not: read the current state before you send them again.