Send the token
Send the token in theAuthorization header of each request:
onio_pat_. The API does not accept session cookies or tokens in the query string.
Create a token
- Sign in to Onio and open your profile.
- In API Access, select Create Token.
- Enter a name, select the permissions the tool needs and select Create Token.
- Copy the token. Onio shows it only once. If you lose it, revoke it and create a new one.
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 with401.
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.