Skip to main content

OAuth Callback (Faire → SKU)

GET 

/faire/callback

OAuth callback hit by Faire after the user authorizes the app. Not called manually — Faire redirects the user's browser to this URL.

Flow:

  1. Reads the state parameter to resolve the workspace and the integration instance the flow started from (CSRF protection).
  2. Calls Faire's token endpoint to exchange authorization_code for a long-lived access_token.
  3. Persists the access token + granted scopes on the integration instance.
  4. Redirects the browser back to the workspace's own host — https://{workspace}.sku.io/v2/integrations/faire?filter[integration_instance_ids]={id} on success, or https://{workspace}.sku.io/v2/integrations/faire/settings?filter[integration_instance_ids]={id}&oauth_error=... on failure.

Faire is registered with a single shared callback URL, so the callback can land on a host other than the workspace's own. The state value carries the originating workspace, and the redirect in step 4 always points back at that workspace's host.

Query Parameters:

  • state (required) - CSRF state, format {app_url}~{workspace}_{instance_id}
  • authorization_code (required, alias code) - One-time auth code from Faire

Auth: No Bearer token. Faire redirects the user's browser, so the request arrives unauthenticated and is authorized by the state value alone.

Errors:

  • 400 State mismatch - The state is missing, expired, or does not resolve to an instance
  • 404 Faire integration not found - Instance referenced by state has been deleted
  • Redirect with ?oauth_error=... - Token exchange failed at Faire's side

Request

Responses

Found

Response Headers
    Location