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

# Handle OAuth callback

> Receives the OAuth authorization callback from the provider, exchanges the `code` and `state` for tokens, and responds with an HTML bounce page that JS-redirects the user back to the web or desktop app.

Uses a bounce page rather than a bare 302 to support custom-scheme deeplinks on macOS.



## OpenAPI

````yaml get /integrations/{provider}/callback
openapi: 3.1.0
info:
  title: HERO API
  version: current
  description: |-
    The HERO REST API.

    See https://developers.myhero.so for the rendered docs.
servers:
  - url: https://app.myhero.so
security: []
paths:
  /integrations/{provider}/callback:
    get:
      tags:
        - Integrations
      summary: Handle OAuth callback
      description: >-
        Receives the OAuth authorization callback from the provider, exchanges
        the `code` and `state` for tokens, and responds with an HTML bounce page
        that JS-redirects the user back to the web or desktop app.


        Uses a bounce page rather than a bare 302 to support custom-scheme
        deeplinks on macOS.
      operationId: handleIntegrationCallback
      parameters:
        - schema:
            type: string
            enum:
              - gmail
              - outlook
              - google_drive
              - onedrive
              - dropbox
              - notion
          required: true
          name: provider
          in: path
        - schema:
            type: string
            maxLength: 2048
          required: false
          name: code
          in: query
        - schema:
            type: string
            maxLength: 128
          required: false
          name: state
          in: query
        - schema:
            type: string
          required: false
          name: error
          in: query
      responses:
        '200':
          description: >-
            HTML bounce page that JS-redirects the user back to the desktop or
            web app.
          content:
            text/html:
              schema:
                type: string
        '400':
          description: 400 response
          content:
            text/html:
              schema:
                type: string
      security: []

````