Skip to main content
Context.dev supports the OAuth 2.0 authorization code flow with PKCE and rotating refresh tokens.

Endpoints

Authorization request

Redirect the user’s browser to the authorization endpoint with these query parameters. The code verifier is 43 to 128 characters from A-Z, a-z, 0-9, -, ., _, and ~. Context.dev redirects to redirect_uri with code and state. If the user cancels, it redirects with error=access_denied, error_description, and state instead. An invalid request is shown to the user on Context.dev with the reason, so you can fix it while you build. Once your app is verified, invalid requests are returned to your redirect_uri with one of the errors below. A request with an unknown client_id or an unregistered redirect_uri is never redirected.

Token request

Send a POST to the token endpoint, form-encoded or as JSON.
Errors use the standard OAuth shape, {"error": "...", "error_description": "..."}.

Revocation

Send a POST to the revocation endpoint with token set to the current refresh token. That ends the connection, so every token issued for it stops working, including tokens on the user’s other devices. An access token works too while it is still valid. A refresh token that was already replaced, an expired access token, and an unknown token are all ignored, and the endpoint still returns 200.

Scopes

Apart from profile, scopes match API key permissions, with one exception: an OAuth app can’t list or use saved browser profiles. A request that sets sharedParams.profile, or calls GET /org/browser/profiles, returns 403.

Lifetimes

Connections

  • A connection is one person’s approval of your app for one workspace and one set of scopes. A token can do exactly what its consent screen listed.
  • Approving the same scopes again reuses the connection. Approving different scopes creates a separate connection and leaves the first one unchanged.
  • Tokens from separate approvals of the same scopes, such as two devices, all stay valid and share the connection.
  • A connection ends right away when your app revokes a token, the user disconnects on their Connected apps page, or the user disables or deletes the connection’s key on their API keys page.
  • A connection stops refreshing when the user leaves the workspace or you delete the app. Access tokens already issued work until they expire, within the hour.
  • Monitors and batches your app created belong to the workspace. They keep running after the connection ends, until the user stops them.

API responses