Authorize
The authorization endpoint (browser). A valid request is a 302 to the web app's consent screen (`/oauth/consent?request=<signed request>`, 10 minutes); an unknown client or redirect URI is a 302 to the consent screen with `error`; any other problem is a 302 back to the client's redirect URI with `error` and `state` (RFC 6749 §4.1.2.1).
API key access
/api/v1/oauth/authorizeQuery Parameters
code
One of the registered redirect URIs (optional when exactly one is registered).
PKCE challenge (43-128 characters).
S256
Space-separated API-key scopes (leads:* allowed); default: every scope but admin.
RFC 8707: the MCP endpoint (<origin>/api/v1/mcp).
Response Body
curl -X GET "http://localhost:8000/api/v1/oauth/authorize?response_type=string&client_id=string&redirect_uri=string&code_challenge=string&code_challenge_method=string&state=string&scope=string&resource=string"Authorization Server Metadata
RFC 8414 metadata: authorization code with PKCE (S256 only), refresh tokens, dynamic registration of public clients, revocation. The issuer is `OAUTH_ISSUER_URL` (default: the first `WEB_BASE_URL`).
Decide Consent Request
Approve (a grant for `workspace_id` and a one-time code, 5 minutes) or deny. Granting `admin` needs the admin role; a suspended workspace can't be connected (403 `workspace_suspended`). Audited as `oauth.granted`.