---
title: "Initiate Oauth"
method: POST
path: "/api/integrations/instances/{registration_id}/oauth/initiate"
tags: ["mcp-oauth"]
---

# Initiate Oauth

`POST /api/integrations/instances/{registration_id}/oauth/initiate`

## Request

- Base URL: `https://app.thinqos.com` (the document declares no server; this is the origin it was published from)
- URL: `https://app.thinqos.com/api/integrations/instances/{registration_id}/oauth/initiate`
- Auth: none declared

Begin the configured OAuth 2 authorization-code flow.

1. Scope-check the registration to the caller's identity.
2. Validate auth_kind == 'oauth2'.
3. Validate discovery for MCP resources. REST connections may use their
   statically configured authorization and token endpoints.
4. Perform DCR if oauth_client_id is not yet set.
5. Generate a state token and the configured PKCE pair, if any.
6. Insert a short-lived IdentityMcpOAuthState row.
7. Build and return the authorization URL.

## Path parameters

- `registration_id` string, uuid, required

## Headers

- `x-impersonate-identity-id` string, nullable

## Request body

- OAuthInitiateRequest
  - `browser_launch_nav_item_id` string, uuid, nullable
  - `redirect_after` string, nullable
  - `target_identity_id` string, uuid, nullable
  - `permissions` string[], nullable
  - `upgrade_version_id` string, uuid, nullable

## Response `200`

Successful Response

- OAuthInitiateResponse: Returned after a successful OAuth initiate.
  - `authorization_url` string, required
  - `state` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/thinqos/apis/thinqos-api.md) · [All operations](https://skmtc.dev/thinqos/apis/thinqos-api/llms.txt) · [OpenAPI document](https://skmtc.dev/thinqos/apis/thinqos-api/revisions/5387b4ded614?raw)
