Skip to main content
The API uses personal access tokens. A token acts for the account that created it. It can only reach that account’s data, and only as far as its scopes allow.

Send the token

Send the token in the Authorization header of each request:
Tokens start with onio_pat_. The API does not accept session cookies or tokens in the query string.

Create a token

  1. Sign in to Onio and open your profile.
  2. In API Access, select Create Token.
  3. Enter a name, select the permissions the tool needs and select Create Token.
  4. Copy the token. Onio shows it only once. If you lose it, revoke it and create a new one.
You can have up to 10 tokens. Tokens do not expire. A token stays valid until you revoke it.

Scopes

A scope sets what a token can do. You choose the scopes when you create the token. You cannot change them later. Create a new token instead. Give each tool only the scopes it needs. A write scope does not include wishlists:read. A tool that adds wishes and then reads the list needs both. Tokens created before the write scopes existed have wishlists:read only. No scope gives access to giver data, followers or other people’s lists. Only wishlists:share returns a share link, and only when it shares the list.

Revoke a token

Open your profile, find the token in API Access and select Revoke. Requests with the token fail at once with 401. Onio also revokes all your tokens when you reset your password. This protects your account when you recover it. Changing your password while you are signed in keeps your tokens. The profile shows the day each token was last used. Onio stores only the day, not each request.

Keep tokens safe

  • Use the API from a server, a script or a local tool. The API sends no CORS headers, so a browser on another website cannot call it.
  • Store tokens in environment variables or a secret manager. Never commit them.
  • Use one token per tool. Then you can revoke one tool without breaking the others.

Errors

A 401 response includes the header WWW-Authenticate: Bearer.