Skip to content
ApiqDevelopers
API v1.64.0Open console
API referenceidentity

Oauth authorize

GET/v1/oauth/authorize

Start an MCP grant — OAuth 2.1 authorization code with PKCE

Opened in the human's browser by an MCP client.Show moreOpened in the human's browser by an MCP client. If (1) or (2) fails the answer is a plain 400 and the browser is NEVER redirected. (3) response_type: code only. (4) code_challenge and code_challenge_method: S256 only; plain or absent is refused with reason PKCE_S256_REQUIRED. (5) resource (RFC 8707, required): exactly one of the configured MCP resources, the plane's /mcp/console, /mcp/supplier or /mcp/operator URL; any other value is invalid_target. Supplier: mcp:supplier:read only. Operator: mcp:operator:read only. Any other scope, mcp:supplier:write and mcp:operator:write included, is invalid_scope. The write scope does not itself grant a write: the consent screen offers only the tools the tenant enabled and the human may use, every one unticked. (7) state: passed back unchanged. Refusals from (3) on are redirects to redirect_uri with error, error_description, state and iss (RFC 9207) only when that redirect_uri is a loopback IP literal or the client is a platform pre-registered (verified) client; for any other redirect_uri of an unverified client the refusal is a plain 400 with the same error and reason, so an anonymously registered client cannot turn this route into an open redirector to its own host (RFC 9700 section 4.11.2). Requests are rate limited per client address (details.action oauth-authorize), which also bounds the metadata-document fetches an anonymous caller can cause. On success the platform records a pending grant request (10 minutes) and answers 302 to the consent screen of the realm the resource belongs to, {consent-base}/console/connect/authorize?request=<id>, {consent-base}/supplier/connect/authorize?request=<id> or {consent-base}/admin/connect/authorize?request=<id> (operator), where the signed-in human reads it (getMcpGrantRequest, supplierGetMcpGrantRequest or opsGetMcpGrantRequest) and approves or denies. Every client registered dynamically or by metadata document is UNVERIFIED on that screen. There is no implicit grant and no password grant.

Query parameters

  • response_typestringRequired
    • code
  • client_idstringRequired
    A registered client id, or the https URL of the client's metadata document
  • redirect_uristringRequired
  • code_challengestringRequired
    BASE64URL(SHA-256(code_verifier)), 43 characters (RFC 7636 section 4.2)
  • code_challenge_methodstringRequired
    • S256
  • resourcestringRequired
    The canonical URL of the MCP endpoint the grant is for (RFC 8707)
  • scopestringOptional
    Space-separated (RFC 6749 section 3.3). mcp:console:read, optionally with mcp:console:write; mcp:supplier:read; or mcp:operator:read
  • statestringOptional

Request body

This operation takes no request body.

Responses

  • 302
    To the realm's consent screen (success), or to redirect_uri with error, error_description, state and iss (a refusal after the client and redirect_uri checks, when redirect_uri is a loopback IP literal…Show moreTo the realm's consent screen (success), or to redirect_uri with error, error_description, state and iss (a refusal after the client and redirect_uri checks, when redirect_uri is a loopback IP literal or the client is verified)
  • 400
    invalid_request (reason REDIRECT_URI_MISMATCH) or invalid_client (reason CLIENT_UNKNOWN or CLIENT_METADATA_INVALID): the client or the redirect_uri could not be trusted, so the browser is not…Show moreinvalid_request (reason REDIRECT_URI_MISMATCH) or invalid_client (reason CLIENT_UNKNOWN or CLIENT_METADATA_INVALID): the client or the redirect_uri could not be trusted, so the browser is not redirected (RFC 6749 section 4.1.2.1). Also any later refusal (checks 3 to 6) for an unverified client whose redirect_uri is not a loopback IP literal, answered here instead of by redirect so the route is never an open redirector (RFC 9700 section 4.11.2)
    OAuthError
  • 404NOT_FOUND — unknown or expired ref (unguessable refs, 15)ApiErrorResponse
  • 405
    VALIDATION — the public edge serves GET, POST, PUT, PATCH and DELETE only; any other method is refused before the platform sees it (details.reason METHOD_NOT_ALLOWED, details.source edge).Show moreVALIDATION — the public edge serves GET, POST, PUT, PATCH and DELETE only; any other method is refused before the platform sees it (details.reason METHOD_NOT_ALLOWED, details.source edge). Not retryable as sent.
    ApiErrorResponse
  • 414
    VALIDATION — the request URI (path and query string) is longer than 8 KiB; the public edge refuses it before the platform sees it (details.reason URI_TOO_LONG, details.source edge).Show moreVALIDATION — the request URI (path and query string) is longer than 8 KiB; the public edge refuses it before the platform sees it (details.reason URI_TOO_LONG, details.source edge). Not retryable as sent: send long input in the body of a POST.
    ApiErrorResponse
  • 429
    Counted in fixed windows (default 15 min).Show moreCounted in fixed windows (default 15 min). The signup, login, password and invite routes count every attempt per client address AND per subject (the email, the username + site, or the invite token). POST /v1/oauth/token is counted three ways, none of them on client_id alone, so knowing a client_id (which is not secret) never lets anyone spend its holder's budget: oauth-token counts every attempt per client address only; oauth-token-failure counts FAILED client authentications per client address and per (client address, client_id) pair; oauth-token-issued counts tokens issued per client_id only, and only a request whose secret, grant_type and scope all passed can spend it. details.reason says which limit tripped (CLIENT_RATE_LIMITED | SUBJECT_RATE_LIMITED) and details.action which count (signup | signup-verify | login | password-forgot | password-reset | invite-accept | oauth-token | oauth-token-failure | oauth-token-issued). Retry-After is whole seconds to the end of the window, and details.retryAfterMs mirrors it. The answer is the same whether or not the account or key exists, so the limit cannot be used to enumerate accounts, and nothing the caller sent is echoed. adds three counts per client address for the MCP grant routes: oauth-authorize (GET /v1/oauth/authorize, which may fetch a Client ID Metadata Document), oauth-register (POST /v1/oauth/register) and oauth-device (POST /v1/oauth/device_authorization), and one count per MCP grant, oauth-exchange-grant (the token exchange of POST /v1/oauth/token, counted per grant after the exchange client and the subject token verified, default 120 a minute), whose details.reason is EXCHANGE_RATE_LIMITED.
    ApiErrorResponse
  • 500INTERNAL — a bug, and traceId is the support handle.ApiErrorResponse

Errors you should handle

Branch on code and honour retryable — never on the HTTP status alone.

404NOT_FOUND
searchRef SR-F-7b31d0a9 is unknown or has expired; re-search
not retryable
405VALIDATION
This method is not served.
not retryable
414VALIDATION
The request URI is longer than 8 KiB.
not retryable
429RATE_LIMITED
Too many requests of this kind for this address or account. Wait for the Retry-After interval before trying again.
retryable
500INTERNAL
An unexpected error occurred. Quote the traceId to support.
retryable