Skip to main content

Complete Gorgias App Authorization

POST 

/api/integrations/gorgias/oauth/complete

Exchanges the authorization code for tokens, checks them with Gorgias and saves the connection with auth_type: oauth (updating the existing Gorgias connection if there is one). Access tokens last 24 hours and are refreshed automatically before they expire.

Required scope: integrations:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Body:

  • code (required, string) — from the Gorgias redirect
  • state (required, string) — from the Gorgias redirect
  • domain (optional, string) — the account Gorgias redirected for; must match the one authorised

When order support is on (an install from the Gorgias App Store turns it on), the Gorgias objects are set up straight away: provisioned is true when every item was created, and provision_error says what could not be set up (null otherwise). The connection is saved either way; retry with Set Up Gorgias Objects.

422 when the state is unknown, expired, already used or from another user, or Gorgias refuses the code.

Connection fields: id, domain (the Gorgias subdomain), account_name, auth_type (api_key | oauth), email, has_api_key, connected_at, last_success_at, last_error, endpoint_base_url (the base of the URLs Gorgias calls; null until the connection has a webhook token), webhook_secret_hint (last 4 characters only; the API key, OAuth tokens and full secret are never returned), order_support (cancellation rules plus the address_edit, reship, returns and refunds policies), repairs (push_updates, sender_user_id, webhook_url), provisioning (last_run_at and the setup checklist), stats_30d (lookups, cancelled, held_for_review, not_allowed, holds) oauth_available and health (status: ok | degraded | needs_reconnect; reason; last_checked_at; missing_scopes: the app permissions the connection still needs, empty for API-key connections).

Checklist items whose status is manual carry copy-ready values in manual, with the shared secret masked to its last 4 characters. Get Gorgias AI Agent Setup Values returns them with the full secret.

Requires gorgias.manage.

Request​

Responses​

OK

Response Headers
    Content-Type