Introduction
Authentication
Every request carries a personal API key in the Authorization header.
The Orion API uses personal API keys. A key belongs to your Orion account and acts as you.
Send the key
Put the key in the Authorization header as a bearer token on every request:
Every key starts with os_. There is no other way to sign in to the API: no OAuth, no session cookie. (The MCP server is different: it signs you in with OAuth and takes no key.)
Make a key
- Sign in on the API keys page.
- Create a key and give it a name, such as
home-script. The name is only a label for you. - Optionally set an expiry date. After that moment the key stops working. Leave it empty for a key that never expires.
- Copy the key. The full key is shown once, when you make it. Orion cannot show it to you again.
Make one key per script or machine. Then you can revoke one without breaking the others.
Revoke a key
Revoke a key on the API keys page at any time. It stops working at once, and requests with it answer 401. Revoke a key straight away if you think someone else has seen it.
What a key can do
A key can call every operation in the API reference, as you. It has the same access you have in the Orion app:
- It sees the devices on your account and the people you share them with.
- On a shared device, it has your role. If you are a guest, the key cannot do what a guest cannot do. See Roles and permissions.
A key does not give access to anything outside the Orion API.
Keep keys safe
- Keep the key on a server or your own machine, in an environment variable or a secret manager.
- Never commit it. Add any file that holds it to
.gitignore. - Give a key an expiry date when you only need it for a while.
- Revoke keys you no longer use.
When the key is refused
A missing, unknown, revoked or expired key answers 401 with the code unauthorized:
The response also carries a WWW-Authenticate: Bearer header. Check that the header reads Bearer os_… with no extra spaces or quotes, and that the key has not been revoked or reached its expiry date. If it has, make a new key.
A 403 forbidden is different: the key is fine, but your account may not do that one thing, for example change another person's schedule without the owner or admin role. See Errors.