> ## Documentation Index
> Fetch the complete documentation index at: https://microstrate-1133-notifications-prefs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# OAuth callback handler

> Handles OAuth callback from external authentication provider



## OpenAPI

````yaml /api-reference/endpoint/accounts/openapi.json get /accounts/oauth/callback
openapi: 3.0.3
info:
  title: quiva.ai Gateway
  description: >-
    API for managing accounts, users, authentication, and payments in the
    quiva.ai platform
  version: 1.0.0
  contact:
    name: quiva.ai Support
    url: https://app.quiva.ai
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Account Management
    description: Operations related to account creation, updating, and deletion
  - name: User Management
    description: Operations related to user creation, updating, and deletion
  - name: Authentication
    description: Operations related to authentication and session management
  - name: API Keys
    description: Operations related to API key management
  - name: Multi-Factor Authentication
    description: Operations related to MFA setup and verification
  - name: Payment
    description: Operations related to subscription and payment management
  - name: Mesh Nodes
    description: Operations related to mesh node management
paths:
  /accounts/oauth/callback:
    get:
      tags:
        - Authentication
      summary: OAuth callback handler
      description: Handles OAuth callback from external authentication provider
      operationId: handleOAuthCallback
      parameters:
        - name: code
          in: query
          required: true
          description: Authorization code from OAuth provider
          schema:
            type: string
        - name: state
          in: query
          required: true
          description: State parameter to prevent CSRF attacks
          schema:
            type: string
      responses:
        '200':
          description: Authentication successful - typically redirects user
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    description: >-
                      Success response (implementation may vary based on
                      authOrMFA function)
        '400':
          description: Bad request - invalid parameters or authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security: []
components:
  schemas:
    ErrorResponse:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          description: Error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````