Skip to content

Legacy OAuth2 Flow (Deprecated)

This page documents the original OAuth2 hostname at $API_APP_BASE_URL/oauth/*. It remains available as a compatibility mapping for existing integrations, including Zapier, so those clients do not need to change. New integrations should use the modern flow at {{AUTH_BASE_URL}}, which exposes the same API surface and adds PKCE, Dynamic Client Registration, and metadata discovery.

What the legacy flow supports

The legacy hostname supports the Authorization Code grant for confidential clients only. Tokens are JWTs. Access tokens expire after 60 minutes, refresh tokens after 365 days, and authorization codes are single-use with a 10-minute lifetime. PKCE is not supported on this host; security depends on client secrets, the state parameter, and redirect URI validation.

Use this checklist to decide whether an existing integration can remain on the legacy hostname:

  • The client is confidential and can keep a client secret server-side.
  • The integration already targets $API_APP_BASE_URL/oauth/* and works today.
  • The integration does not require PKCE, Dynamic Client Registration, or metadata discovery.
  • The redirect URI is registered exactly as sent.

If any item fails, plan a move to the modern flow at {{AUTH_BASE_URL}}.

Base URL

All legacy endpoints live under the /oauth path on the original API host. The host is kept alive indefinitely as a compatibility mapping onto the same underlying API and serves the same routes as the modern base URL, so existing Zapier and confidential-client integrations do not need to migrate.

Step 1: Redirect to the authorization endpoint

Send the user's browser to the authorization endpoint with the required parameters. The table below lists each parameter, whether it is required, and what it controls.

Step 2: User authenticates

The authorization endpoint validates the parameters and redirects the user to the login page. Users can sign in with a Microsoft account, Google account, Slack account, or email and password.

Step 4: Receive the authorization code

If the user approves, the browser is redirected back to the redirect_uri with an authorization code and the state value. Verify that the returned state matches the value sent in Step 1. The authorization code is single-use and expires after 10 minutes.

Step 5: Exchange the code for tokens

Make a server-side POST request to the token endpoint. The client can authenticate either by sending client_id and client_secret in the form body or by using HTTP Basic authentication.

Step 6: Receive tokens

On success, the response is JSON containing an access_token, id_token, refresh_token, token_type, and expires_in. The access_token authenticates API requests and expires in 60 minutes. The id_token carries user identity claims and also expires in 60 minutes. The refresh_token obtains new access tokens and is valid for 365 days.

Step 7: Use the access token

Include the access token in the Authorization header as a Bearer token when calling protected endpoints.

Refreshing tokens

When the access token expires, exchange the refresh token for a new access token. The response includes a new access_token, the same refresh_token, token_type, and expires_in. The same refresh token is returned; refresh tokens are not rotated on this host.

Error handling

If something goes wrong, the authorization endpoint returns an error as a JSON response. For example, an unknown client_id produces an invalid_client error with an error_description. See the Endpoints reference for the complete list of error codes per endpoint.

Authorization endpoint parameters
ParameterRequiredDescription
client_idYesYour registered OAuth client ID
redirect_uriYesMust exactly match a registered redirect URI for your client
stateYesRandom string for CSRF protection. You must verify this value when the user returns
scopeNoSpace-separated list of scopes. Defaults to openid
response_typeNoMust be code. Defaults to code

Parameter requirements and defaults as documented for the legacy hostname. Confirm current behavior against the live API before relying on defaults in production.

Frequently asked questions

Does the legacy OAuth2 hostname still work?

Yes. The original hostname at $API_APP_BASE_URL/oauth/* is kept as a permanent compatibility mapping onto the same underlying API. Existing Zapier and confidential-client integrations can continue without changes.

Do existing integrations need to migrate to {{AUTH_BASE_URL}}?

No. The legacy host serves the same routes as the modern base URL, so existing confidential-client and Zapier integrations do not need to migrate. New integrations should use the modern flow, which adds PKCE, Dynamic Client Registration, and metadata discovery.

Can I use PKCE with the legacy flow?

No. PKCE is not supported on the legacy hostname. Security relies on client secrets, the state parameter, and redirect URI validation. If your integration requires PKCE, use the modern flow.

Are refresh tokens rotated on the legacy host?

No. When you exchange a refresh token, the same refresh token is returned. Refresh tokens are valid for 365 days.

How long does an authorization code last?

An authorization code is single-use and expires after 10 minutes. This is separate from the access token lifetime of 60 minutes.

$API_APP_BASE_URL/oauth
GET $API_APP_BASE_URL/oauth/authorize
  ?client_id=your-client-id
  &redirect_uri=https://yourapp.com/callback
  &state=random-csrf-token
  &scope=openid email profile
  &response_type=code
curl -X POST $API_APP_BASE_URL/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=authorization_code" \
  -d "code=a1b2c3d4-..." \
  -d "redirect_uri=https://yourapp.com/callback" \
  -d "client_id=your-client-id" \
  -d "client_secret=your-client-secret"
curl -X POST $API_APP_BASE_URL/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -u "your-client-id:your-client-secret" \
  -d "grant_type=authorization_code" \
  -d "code=a1b2c3d4-..." \
  -d "redirect_uri=https://yourapp.com/callback"
{
  "access_token": "eyJ...",
  "id_token": "eyJ...",
  "refresh_token": "eyJ...",
  "token_type": "Bearer",
  "expires_in": 3600
}
curl $API_APP_BASE_URL/oauth/me \
  -H "Authorization: Bearer eyJ..."
curl -X POST $API_APP_BASE_URL/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=refresh_token" \
  -d "refresh_token=eyJ..." \
  -d "client_id=your-client-id" \
  -d "client_secret=your-client-secret"
{
  "access_token": "eyJ...",
  "refresh_token": "eyJ...",
  "token_type": "Bearer",
  "expires_in": 3600
}
{
  "error": "invalid_client",
  "error_description": "Unknown client_id"
}