> ## 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.

# YouTube OAuth Callback Endpoint

> This endpoint processes the callback from YouTube API



## OpenAPI

````yaml post /youtube/oauth/callback
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/callback:
    post:
      tags:
        - youtube
      summary: YouTube OAuth Callback Endpoint
      description: This endpoint processes the callback from YouTube API
      operationId: youtube_oauth_callback
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OAuthCallback'
        required: true
      responses:
        '201':
          description: Access token generated successfully
          content:
            application/json:
              schema:
                title: Access Token Response Object
                type: object
                properties:
                  access_token:
                    title: Google Credentials
                    type: object
                    properties:
                      token:
                        type: string
                      refresh_token:
                        type: string
                      id_token:
                        type: string
                      token_uri:
                        type: string
                      client_id:
                        type: string
                      client_secret:
                        type: string
                      scopes:
                        type: array
                        items:
                          type: string
                      default_scopes:
                        type: array
                        items:
                          type: string
                      quota_project_id:
                        type: string
                      expiry:
                        type: string
                        format: date-time
                      rapt_token:
                        type: string
                      refresh_handler:
                        type: string
                      enable_reauth_refresh:
                        type: boolean
                      granted_scopes:
                        type: array
                        items:
                          type: string
                    description: Google Credentials OpenAPI Schema
                  error:
                    type: string
                description: Access Token Response Object OpenAPI Schema
              example:
                access_token:
                  token: >-
                    ya29.a0AfB_byAHoRIisnxsXs8p-HUIamXB6Ah5EuM6c4H6VFapy10FXFQp__u2V_Rfpym_m1QDolLqlCSJ5IYGWUqPpFS5D95CkzFa8KQTmaShjyfd8r8O5lneN47_gfce3PAiX_wiw-c3pt-JHEMlt9BULphoFgzaGg1Kel1kaCgYKARASARESFQHGX2MiX8Tf3yRlb4XTbpuAltWNIw0171
                  refresh_token: >-
                    1//09i2-LKuXjfacCgYIARAAGAkSNwF-L9IrQbVFsti16aYij3iQejWdPOhdj1DjtKHgJyVrHBPrlMLjSmrvhlCm35Zawn0CWNWFOJo
                  id_token: null
                  token_uri: https://oauth2.googleapis.com/token
                  client_id: client_id
                  client_secret: client_secret
                  scopes:
                    - https://www.googleapis.com/auth/youtube.upload
                    - https://www.googleapis.com/auth/youtube.download
                    - https://www.googleapis.com/auth/youtube.readonly
                    - https://www.googleapis.com/auth/youtube
                    - https://www.googleapis.com/auth/youtube.force-ssl
                    - https://www.googleapis.com/auth/youtubepartner
                    - >-
                      https://www.googleapis.com/auth/youtubepartner-channel-audit
                    - >-
                      https://www.googleapis.com/auth/youtube.channel-memberships.creator
                    - >-
                      https://www.googleapis.com/auth/youtube.channel-memberships.creator
                    - >-
                      https://www.googleapis.com/auth/youtube.third-party-link.creator
                  default_scopes: null
                  quota_project_id: null
                  expiry: '2024-03-02T15:44:00.537Z'
                  rapt_token: null
                  refresh_handler: null
                  enable_reauth_refresh: false
                  granted_scopes:
                    - https://www.googleapis.com/auth/youtube.upload
                    - https://www.googleapis.com/auth/youtube.download
                    - https://www.googleapis.com/auth/youtube.readonly
                    - https://www.googleapis.com/auth/youtube
                    - https://www.googleapis.com/auth/youtube.force-ssl
                    - https://www.googleapis.com/auth/youtubepartner
                    - >-
                      https://www.googleapis.com/auth/youtubepartner-channel-audit
                    - >-
                      https://www.googleapis.com/auth/youtube.channel-memberships.creator
                    - >-
                      https://www.googleapis.com/auth/youtube.channel-memberships.creator
                    - >-
                      https://www.googleapis.com/auth/youtube.third-party-link.creator
                error: null
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  request_url:
                    type: array
                    items:
                      type: string
                  redirect_uri:
                    type: array
                    items:
                      type: string
                  state:
                    type: array
                    items:
                      type: string
              example:
                request_url:
                  - This field is required.
                redirect_uri:
                  - This field is required.
                state:
                  - This field is required.
        '500':
          description: Access token was not generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: object
                    properties: {}
                  error:
                    type: string
              example:
                access_token: null
                error: Failed to fetch OAuth token
components:
  schemas:
    OAuthCallback:
      required:
        - redirect_uri
        - request_url
        - state
      type: object
      properties:
        request_url:
          title: Request url
          minLength: 1
          type: string
        redirect_uri:
          title: Redirect uri
          minLength: 1
          type: string
        state:
          title: State
          minLength: 1
          type: string
  securitySchemes:
    Basic:
      type: http
      scheme: basic
    api_key:
      type: apiKey
      name: User-JWT
      in: header

````