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

> ## Agent Instructions
> Internal links on these pages omit the .md extension. Append .md to a docs page URL, or send an Accept: text/markdown header, to get that page as markdown.

# Upload a Google Ads video

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Uploads a video file to YouTube so you can use it in a campaign.

Google Ads only takes video as a YouTube video, so a file has to reach YouTube before a campaign can show it. Base44 fetches the file from `file_url` and uploads it as an unlisted video to a YouTube channel Google manages for Base44, not to your own channel. The upload is not tied to a campaign: pass the returned `video_id` as a campaign video the same way you would pass the ID from a YouTube link. An uploaded video that no campaign uses stays on that channel, unlisted.

The request waits while the file is fetched and uploaded, and then a few seconds more while YouTube assigns the video ID. If YouTube is still processing by then, the response carries an empty `video_id` and an `upload_rn`. The upload has succeeded in that case. Do not upload the file again: call [Poll a Google Ads video upload](/api-reference/poll-a-google-ads-video-upload) with `upload_rn` every few seconds until `video_id` comes back. A file that cannot be fetched, one over 64 MB, and a video YouTube rejects return a 400.

Each upload publishes a video, so this is limited to 5 uploads every 5 minutes per app. Some workspaces have a different limit. Polling has its own, looser limit. It is refused with a 409 while the workspace is on a Google Ads billing hold.

<Note>This endpoint accepts a personal API key from anyone who can edit the app. A read-only key is refused with a 403, and so are workspace API keys.</Note>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/apps/{app_id}/google-ads/assets/upload-video
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/apps/{app_id}/google-ads/assets/upload-video:
    post:
      summary: Upload a Google Ads video
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Uploads a video file to YouTube so you can use it in a campaign.


        Google Ads only takes video as a YouTube video, so a file has to reach
        YouTube before a campaign can show it. Base44 fetches the file from
        `file_url` and uploads it as an unlisted video to a YouTube channel
        Google manages for Base44, not to your own channel. The upload is not
        tied to a campaign: pass the returned `video_id` as a campaign video the
        same way you would pass the ID from a YouTube link. An uploaded video
        that no campaign uses stays on that channel, unlisted.


        The request waits while the file is fetched and uploaded, and then a few
        seconds more while YouTube assigns the video ID. If YouTube is still
        processing by then, the response carries an empty `video_id` and an
        `upload_rn`. The upload has succeeded in that case. Do not upload the
        file again: call [Poll a Google Ads video
        upload](/api-reference/poll-a-google-ads-video-upload) with `upload_rn`
        every few seconds until `video_id` comes back. A file that cannot be
        fetched, one over 64 MB, and a video YouTube rejects return a 400.


        Each upload publishes a video, so this is limited to 5 uploads every 5
        minutes per app. Some workspaces have a different limit. Polling has its
        own, looser limit. It is refused with a 409 while the workspace is on a
        Google Ads billing hold.


        <Note>This endpoint accepts a personal API key from anyone who can edit
        the app. A read-only key is refused with a 403, and so are workspace API
        keys.</Note>
      operationId: upload_video_asset_api_apps__app_id__google_ads_assets_upload_video_post
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: >-
              ID of the app whose Google Ads creative you want to generate or
              read.
            title: App Id
          description: >-
            ID of the app whose Google Ads creative you want to generate or
            read.
          example: 6820f3a4e7b91d003c45a1f2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GoogleAdsVideoUploadRequest'
      responses:
        '200':
          description: >-
            The uploaded video, or a reference to poll while YouTube processes
            it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleAdsVideoUpload'
        '400':
          description: >-
            The file could not be fetched from `file_url`, including an address
            on a host Base44 does not fetch from and a file over 64 MB, or
            YouTube or Google Ads rejected the video.
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            You can't edit this app, the app does not exist, or you used a
            read-only or workspace API key. A missing app and an app you cannot
            reach are deliberately the same answer.
        '404':
          description: The app has no connected Google Ads account.
        '409':
          description: The workspace is on a Google Ads billing hold.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: >-
            The app has used up its 5 uploads in the last 5 minutes, or Google
            Ads is rate limiting the account. Retry later.
components:
  schemas:
    GoogleAdsVideoUploadRequest:
      properties:
        file_url:
          type: string
          title: File Url
          description: >-
            Address of the video file. It has to be `https` on a host Base44
            fetches media from, such as an address on `base44.com` or
            `base44.app`, and the file can be at most 64 MB. Base44 does not
            fetch any other address and rejects it with a 400.
          example: https://storage.base44.com/gads-assets/spring-spot.mp4
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
          description: >-
            Title of the unlisted YouTube video. Only the first 100 characters
            are used. It is shown on the video itself, never in the ad. Leave it
            out for a generic title.
          example: Spring sale spot
      type: object
      required:
        - file_url
      title: GoogleAdsVideoUploadRequest
      description: A video file to upload to YouTube for Google Ads.
    GoogleAdsVideoUpload:
      properties:
        video_id:
          type: string
          title: Video Id
          description: >-
            The YouTube video ID. Pass it as a video on a campaign, exactly as
            you would the ID from a YouTube link. Empty while YouTube is still
            processing the upload, in which case poll with `upload_rn`.
          example: dQw4w9WgXcQ
        upload_rn:
          type: string
          title: Upload Rn
          description: >-
            Google's reference for the upload. Keep it until `video_id` is
            filled in, and pass it to [Poll a Google Ads video
            upload](/api-reference/poll-a-google-ads-video-upload).
          example: customers/1234567890/youTubeVideoUploads/AbC123xYz
      type: object
      required:
        - video_id
        - upload_rn
      title: GoogleAdsVideoUpload
      description: A video uploaded to YouTube for Google Ads.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: 'Personal access token, sent as `Authorization: Bearer <token>`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.