OAuth
Call the API as a manager of the team, through a connection that the manager approves.
An OAuth connection acts as one person: the manager who gave the consent, in their team. Each action shows the name of that person. For example, the documents your integration uploads belong to them.
To connect your integration step by step, follow Build an OAuth integration.
The scopes are the same as the ones of the API key: read for calls that read, write for every call. The person can lower write to read on the consent page.
Manage the connections
Each person sees the apps they connected in Settings > Integrations > Connected apps: the access of each app (read only, or read and write), when it was connected and when it was last used. Disconnect revokes the connection at once. The leader does not see the connections of the managers.
What ends a connection
These events revoke the connection at once. Every token stops working, and the person must give the consent again:
| Event | Connections revoked |
|---|---|
| The person leaves the team, or is removed from it | Theirs |
| The person becomes a translator | Theirs |
| The person deletes their account | Theirs |
| The team is deleted | Every connection of the team |
| The subscription of the leader is cancelled | Every connection of the team |
| The person disconnects the app in Connected apps | That one |
| The app revokes its refresh token | That one |
| A refresh token is used twice | That one. See Refresh the tokens |
| The refresh token is not used for 30 days | That one: it expires |
These events do not revoke the connection. The calls get 403 until access comes back:
- The subscription or the trial ends on its date, or is suspended:
ACCOUNT_NOT_ACTIVE. - The plan of the team no longer includes the API, or OAuth is turned off for the team:
FEATURE_NOT_ENABLED.
A new team leader changes nothing: the connections of the old leader keep working, because the old leader stays a manager.
To keep an integration independent from the people of the team, give the consent with a dedicated manager account. It uses a seat of the team.
When a call is refused
An access token that is malformed, expired or revoked gets 401 with the code UNAUTHENTICATED and the message The access token is missing or not valid. The answer carries a WWW-Authenticate header that points to the metadata of the API, for clients that discover the authorization server by themselves:
HTTP/2 401
www-authenticate: Bearer resource_metadata="https://api.redokun.com/.well-known/oauth-protected-resource", error="invalid_token"A valid token can get 403:
| Code | Why |
|---|---|
FEATURE_NOT_ENABLED | The plan of the team does not include the API, or OAuth is not enabled for the team |
ACCOUNT_NOT_ACTIVE | The person cannot call right now: for example, the account is disabled, the person is no longer a manager of the team, or the subscription of the team is suspended or expired |
INSUFFICIENT_SCOPE | The connection is read and the call writes |