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

# Start Google OAuth

> Start the Google OAuth flow for a specific agent. Returns a Google authorization URL and the scopes requested from the provided or saved managed Google tool configuration.



## OpenAPI

````yaml /docs/openapi.json post /api/v1/google/{agent_id}/oauth/start
openapi: 3.1.0
info:
  title: Voice AI Developer API
  description: >-
    Generate realistic speech and clone voices. AI voice agents with retrieval
    augmented generation (RAG) and model context protocol (MCP) included.
  version: 1.5.0
  contact: {}
servers:
  - url: https://dev.voice.ai
    description: HTTP API endpoints
security:
  - BearerAuth: []
tags:
  - name: Text To Speech
    description: Text-to-speech endpoints for voice cloning and speech generation.
  - name: Pronunciation Dictionaries
    description: Manage versioned pronunciation dictionaries for TTS and voice agents.
  - name: Agent Management
    description: Create, update, deploy, and manage voice agents.
  - name: Models
    description: Discover supported LLM and TTS model options.
  - name: Agent Connection
    description: Connect to agents and manage active calls.
  - name: Agent Analytics
    description: >-
      Analytics and reporting for agent performance, call history, and
      statistics.
  - name: Agent Knowledge Base
    description: >-
      Manage knowledge bases for retrieval augmented generation (RAG) with your
      agents.
  - name: Phone Number Management
    description: >-
      Search, select, and manage phone numbers from your plan allocation.
      Release numbers to free up slots.
  - name: Managed Tools
    description: >-
      Connect Google Calendar, Sheets, and Gmail to agents and inspect
      connection state.
paths:
  /api/v1/google/{agent_id}/oauth/start:
    post:
      tags:
        - Managed Tools
      summary: Start Google OAuth
      description: >-
        Start the Google OAuth flow for a specific agent. Returns a Google
        authorization URL and the scopes requested from the provided or saved
        managed Google tool configuration.
      operationId: start_google_oauth_api_v1_google__agent_id__oauth_start_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GoogleOAuthStartRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleOAuthStartResponse'
        '401':
          description: Unauthorized - Invalid or missing bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Agent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    GoogleOAuthStartRequest:
      type: object
      properties:
        return_path:
          type: string
          title: Return Path
          description: >-
            Optional relative return path or allowlisted absolute app URL to
            return to after OAuth completes.
        managed_tools:
          $ref: '#/components/schemas/ManagedGoogleToolsConfig'
      title: GoogleOAuthStartRequest
    GoogleOAuthStartResponse:
      type: object
      properties:
        auth_url:
          type: string
          title: Auth Url
          description: Google OAuth authorization URL to open in a popup or browser.
        requested_scopes:
          type: array
          title: Requested Scopes
          items:
            type: string
      required:
        - auth_url
        - requested_scopes
      title: GoogleOAuthStartResponse
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: Error message
        detail:
          type: string
          title: Detail
          description: Detailed error information
          nullable: true
        code:
          type: string
          title: Code
          description: Error code
          nullable: true
      type: object
      required:
        - error
      title: ErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ManagedGoogleToolsConfig:
      type: object
      properties:
        google_calendar:
          anyOf:
            - $ref: '#/components/schemas/ManagedGoogleCalendarConfig'
            - type: 'null'
        google_sheets:
          anyOf:
            - $ref: '#/components/schemas/ManagedGoogleSheetsConfig'
            - type: 'null'
        google_gmail:
          anyOf:
            - $ref: '#/components/schemas/ManagedGoogleGmailConfig'
            - type: 'null'
      title: ManagedGoogleToolsConfig
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ManagedGoogleCalendarConfig:
      type: object
      properties:
        enabled:
          type: boolean
          title: Enabled
          description: Whether Google Calendar managed tools are enabled for this agent.
        default_calendar_id:
          type: string
          title: Default Calendar Id
          description: >-
            Optional default Google Calendar ID. Falls back to 'primary' when
            omitted.
        timezone:
          type: string
          title: Timezone
          description: Optional IANA timezone like America/Los_Angeles.
        selected_operations:
          type: array
          title: Selected Operations
          description: >-
            Optional ordered subset of Calendar operations to enable. Omit for
            all supported Calendar operations.
          items:
            type: string
            enum:
              - google_calendar_check_availability
              - google_calendar_list_upcoming_events
              - google_calendar_create_event
              - google_calendar_update_event
              - google_calendar_cancel_event
      title: ManagedGoogleCalendarConfig
    ManagedGoogleSheetsConfig:
      type: object
      properties:
        enabled:
          type: boolean
          title: Enabled
          description: Whether Google Sheets managed tools are enabled for this agent.
        spreadsheet_id:
          type: string
          title: Spreadsheet Id
          description: Optional default Google Sheets spreadsheet ID.
        sheet_name:
          type: string
          title: Sheet Name
          description: Optional default worksheet tab name.
        selected_operations:
          type: array
          title: Selected Operations
          description: >-
            Optional ordered subset of Sheets operations to enable. Omit for all
            supported Sheets operations.
          items:
            type: string
            enum:
              - google_sheets_append_row
              - google_sheets_list_sheets
              - google_sheets_read_rows
      title: ManagedGoogleSheetsConfig
    ManagedGoogleGmailConfig:
      type: object
      properties:
        enabled:
          type: boolean
          title: Enabled
          description: Whether Gmail managed tools are enabled for this agent.
        selected_operations:
          type: array
          title: Selected Operations
          description: >-
            Optional ordered subset of Gmail operations to enable. Omit for all
            supported Gmail operations.
          items:
            type: string
            enum:
              - google_gmail_search_messages
              - google_gmail_get_message
              - google_gmail_send_email
      title: ManagedGoogleGmailConfig
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer token authentication. Use your API key as the bearer token.
        Format: Authorization: Bearer <your-api-key>

````