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

# Google OAuth callback for the Google Sheets integration

> Public endpoint (no `authMiddleware`) that completes the Google OAuth flow for the Google Sheets scraper service. The relay proxies the upstream response — when the upstream returns a 3xx with a `Location` header, the relay forwards that redirect (typically back to the application UI). JSON or text bodies are forwarded with the upstream status.



## OpenAPI

````yaml /api-reference/openapi.yaml get /api/google-sheets/oauth/google/callback
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/google-sheets/oauth/google/callback:
    get:
      tags:
        - Google Sheets
      summary: Google OAuth callback for the Google Sheets integration
      description: >-
        Public endpoint (no `authMiddleware`) that completes the Google OAuth
        flow for the Google Sheets scraper service. The relay proxies the
        upstream response — when the upstream returns a 3xx with a `Location`
        header, the relay forwards that redirect (typically back to the
        application UI). JSON or text bodies are forwarded with the upstream
        status.
      operationId: get_google_sheets_oauth_callback
      parameters:
        - in: query
          name: code
          required: false
          schema:
            type: string
          description: OAuth authorization code returned by Google
        - in: query
          name: state
          required: false
          schema:
            type: string
          description: Opaque state token forwarded back to the OAuth caller
        - in: query
          name: scope
          required: false
          schema:
            type: string
        - in: query
          name: error
          required: false
          schema:
            type: string
          description: >-
            Set when the user denies the OAuth consent or the provider rejects
            the request
      responses:
        '200':
          description: >-
            Non-redirect upstream response (rare; e.g. the scraper directly
            returns a JSON status without redirecting).
          content:
            text/html:
              schema:
                type: string
              example: >-
                <html><body>Google Sheets connection completed. You can close
                this window.</body></html>
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Upstream status flag forwarded verbatim.
                additionalProperties: true
              example:
                status: success
        '302':
          description: >-
            Redirect back to the application UI (forwarded from the
            google-sheets-scraper service). On success the URL carries
            `google_sheets_status=success`; on user/provider denial it carries
            `google_sheets_status=error&reason=…`.
          headers:
            Location:
              description: Application redirect URL.
              schema:
                type: string
              example: >-
                https://app.tetherai.ca/integrations/google-sheets?google_sheets_status=success
        '502':
          description: Google Sheets service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleSheetsErrorResponse'
components:
  schemas:
    GoogleSheetsErrorResponse:
      type: object
      properties:
        error:
          type: string
        detail:
          type: string
      additionalProperties: true
      example:
        error: Google Sheets service unavailable
        detail: Upstream connection refused

````