openapi: 3.0.3 info: title: Clerk Backend Account Portal OAuth2 Callbacks API x-logo: url: https://clerk.com/_next/image?url=%2Fimages%2Fclerk-logo.svg&w=96&q=75 altText: Clerk docs href: https://clerk.com/docs contact: email: support@clerk.com name: Clerk Platform Team url: https://clerk.com/support description: 'The Clerk REST Backend API, meant to be accessed by backend servers. ### Versions When the API changes in a way that isn''t compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2025-04-10`. For more information, please see [Clerk API Versions](https://clerk.com/docs/versioning/available-versions). Please see https://clerk.com/docs for more information.' version: '2025-11-10' termsOfService: https://clerk.com/terms license: name: MIT url: https://github.com/clerk/openapi-specs/blob/main/LICENSE servers: - url: https://api.clerk.com/v1 security: - bearerAuth: [] tags: - name: OAuth2 Callbacks description: Used to receive callbacks from successful OAuth attempts. paths: /v1/oauth_callback: get: operationId: getOauthCallback summary: OAuth Callback description: The endpoint where the OAuth providers redirect to after a successful authentication attempt. tags: - OAuth2 Callbacks parameters: - in: query name: scope schema: type: string description: returned scopes from OAuth provider. - in: query name: code schema: type: string description: returned exchange code from OAuth provider. - in: query name: state schema: type: string description: returned state from OAuth provider. - in: query name: error schema: type: string description: returned error state from OAuth provider, if applicable responses: '200': description: '[AuthV2] HTML-based redirection in dev instances' '299': description: FAKE SUCCESS '301': description: Redirect '303': description: Redirect '400': $ref: '#/components/responses/ClerkErrors' '403': $ref: '#/components/responses/ClerkErrors' post: operationId: postOauthCallback summary: OAuth Post Callback description: Converts a POST to a GET, because if it's a POST coming from an external account. This is necessary because some providers (e.g. Apple) issue a POST instead of a GET request. tags: - OAuth2 Callbacks requestBody: content: application/x-www-form-urlencoded: schema: type: object additionalProperties: true properties: code: description: returned exchange code from OAuth provider. type: string scope: description: returned scopes from OAuth provider. type: string nullable: true state: description: returned state from OAuth provider. type: string error: description: returned error state from OAuth provider, if applicable type: string nullable: true responses: '303': description: Redirect to GET /v1/oauth_callback with same parameters components: schemas: ClerkErrors: type: object properties: errors: type: array items: $ref: '#/components/schemas/ClerkError' meta: type: object clerk_trace_id: type: string required: - errors ClerkError: type: object properties: message: type: string long_message: type: string code: type: string meta: type: object required: - message - long_message - code responses: ClerkErrors: description: Request was not successful content: application/json: schema: $ref: '#/components/schemas/ClerkErrors' securitySchemes: bearerAuth: type: http scheme: bearer description: Secret key, obtained under "API Keys" in the Clerk Dashboard. bearerFormat: sk__ externalDocs: url: https://clerk.com/docs x-speakeasy-retries: strategy: backoff backoff: initialInterval: 500 maxInterval: 60000 maxElapsedTime: 3600000 exponent: 1.5 statusCodes: - 5XX retryConnectionErrors: true