Upload a Google Ads video

Changed on

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

post/api/apps/{app_id}/google-ads/assets/upload-video

Request

  • Base URL: https://app.base44.com
  • URL: https://app.base44.com/api/apps/{app_id}/google-ads/assets/upload-video
  • Auth: HTTP bearer

Path parameters

app_idstring required

ID of the app whose Google Ads creative you want to generate or read.

Request body

file_urlstring required

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.

titlestring nullable

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 request

{
  "file_url": "https://storage.base44.com/gads-assets/spring-spot.mp4",
  "title": "Spring sale spot"
}

Response

The uploaded video, or a reference to poll while YouTube processes it.

video_idstring required

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.

upload_rnstring required

Google's reference for the upload. Keep it until video_id is filled in, and pass it to Poll a Google Ads video upload.

Example response

{
  "video_id": "dQw4w9WgXcQ",
  "upload_rn": "customers/1234567890/youTubeVideoUploads/AbC123xYz"
}

Changes