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

# Generate YouTube OAuth URL

> Generates a URL for the user to authenticate with YouTube



## OpenAPI

````yaml get /youtube/oauth
openapi: 3.0.1
info:
  title: ClipVision API
  description: ClipVision AI API
  termsOfService: https://www.clipvision.ai/terms/
  contact:
    email: help@clipvision.ai
  license:
    name: ClipVision License
  version: v1
servers:
  - url: https://backend.clipvision.ai/
security:
  - Basic: []
  - api_key: []
paths:
  /youtube/oauth:
    get:
      tags:
        - youtube
      summary: Generate YouTube OAuth URL
      description: Generates a URL for the user to authenticate with YouTube
      operationId: youtube_generate_oauth
      parameters:
        - name: redirect_uri
          in: query
          required: true
          schema:
            minLength: 1
            type: string
      responses:
        '200':
          description: OAuth URL generated successfully
          content:
            application/json:
              schema:
                title: OAuth Response Object
                type: object
                properties:
                  url:
                    type: string
                  csrf_state:
                    type: string
                  error:
                    type: string
                description: OAuth Response Object OpenAPI Schema
              example:
                url: >-
                  https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=1032745113471-kdu4fuipd4eqov464nqt2krvmis60rhp.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fdashboard.clipvision.ai%2Foauth%2Fyoutube&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube.upload+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube.download+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube.readonly+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube.force-ssl+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutubepartner+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutubepartner-channel-audit+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube.channel-memberships.creator+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube.channel-memberships.creator+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube.third-party-link.creator&state=upCMZ1kxwgX39jUTVFBaEYAnJb0XrT&access_type=offline&include_granted_scopes=true&prompt=consent
                csrf_state: upCMZ1kxwgX39jUTVFBaEYAnJb0XrT
                error: null
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  redirect_uri:
                    type: array
                    items:
                      type: string
              example:
                redirect_uri:
                  - This field is required.
        '500':
          description: OAuth URL was not generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                  csrf_state:
                    type: string
                  error:
                    type: string
              example:
                url: null
                csrf_state: null
                error: Failed to generate OAuth URL - Flow init failed
components:
  securitySchemes:
    Basic:
      type: http
      scheme: basic
    api_key:
      type: apiKey
      name: User-JWT
      in: header

````