APIBeta

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:

EventConnections revoked
The person leaves the team, or is removed from itTheirs
The person becomes a translatorTheirs
The person deletes their accountTheirs
The team is deletedEvery connection of the team
The subscription of the leader is cancelledEvery connection of the team
The person disconnects the app in Connected appsThat one
The app revokes its refresh tokenThat one
A refresh token is used twiceThat one. See Refresh the tokens
The refresh token is not used for 30 daysThat 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:

CodeWhy
FEATURE_NOT_ENABLEDThe plan of the team does not include the API, or OAuth is not enabled for the team
ACCOUNT_NOT_ACTIVEThe 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_SCOPEThe connection is read and the call writes

On this page