> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mrassistant.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Oauth Callback

> Handles the OAuth callback. Exchanges the authorization code for user info,
creates or finds the user, and returns JWT tokens.

The frontend should verify the state parameter matches what was returned
by /authorize before calling this endpoint.



## OpenAPI

````yaml https://api.mrassistant.ai/openapi.json get /auth/oauth/{provider}/callback
openapi: 3.1.0
info:
  title: Backend - Multilingual Voice Agent System
  description: FastAPI backend for multilingual voice agents with tool use
  version: 1.0.0
servers: []
security: []
paths:
  /auth/oauth/{provider}/callback:
    get:
      tags:
        - oauth
      summary: Oauth Callback
      description: >-
        Handles the OAuth callback. Exchanges the authorization code for user
        info,

        creates or finds the user, and returns JWT tokens.


        The frontend should verify the state parameter matches what was returned

        by /authorize before calling this endpoint.
      operationId: oauth_callback_auth_oauth__provider__callback_get
      parameters:
        - name: provider
          in: path
          required: true
          schema:
            type: string
            title: Provider
        - name: code
          in: query
          required: true
          schema:
            type: string
            description: Authorization code from provider
            title: Code
          description: Authorization code from provider
        - name: state
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: State parameter for CSRF verification
            title: State
          description: State parameter for CSRF verification
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````