---
title: "Upload an ad video"
method: POST
path: "/v1/ads/videos"
tags: ["Ad Creatives"]
---

# Upload an ad video

`POST /v1/ads/videos`

Standalone ad-video upload (parallel to POST /v1/ads/images), so a video creative can
be rendered via POST /v1/ads/preview or attached via `video.id` on POST /v1/ads/create
before an ad exists.

Accepts either an https `videoUrl` we download server-side (SSRF-guarded) or raw
`videoBase64` bytes; exactly one is required. `videoBase64` is capped by Vercel's body
limit, around 4.5 MB payload in practice, so larger videos must come via `videoUrl`.

Returns the Meta `video.id` (reusable wherever `video.id` is accepted) plus Meta's
auto-generated poster URL when available. The endpoint waits until Meta reports the
video ready (chunked upload + transcode can take minutes; the handler runs up to
800 s).

## Request body

- object
  - `accountId` string, required — Zernio SocialAccount id (posting or ads variant); its platform decides where the campaign is created.
  - `adAccountId` string, required — Platform ad account id (Meta act_<n>, Google customer id, LinkedIn account id, ...).
  - `videoUrl` string — Public https URL of the video; downloaded server-side (SSRF-guarded) before chunked upload. Provide exactly one of videoUrl or videoBase64.
  - `videoBase64` string — Raw base64 video bytes, or a full data URL (the data:video/...;base64, prefix is stripped). Capped by Vercel's body limit (~4.5 MB payload). Provide exactly one of videoUrl or videoBase64.
  - `filename` string — Optional filename shown alongside the upload session. Applied only when uploading via videoBase64.

## Response `201`

Video uploaded and ready

- object
  - `adAccountId` string
  - `video` object
    - `id` string — Meta video id, reusable as video.id on POST /v1/ads/create and inside POST /v1/ads/preview creativeSpec.
    - `thumbnailUrl` string, nullable — Meta-hosted poster URL if available; null when Meta has not produced a poster yet.

## Other responses

- `400` — Invalid input, or Meta rejected the upload
- `401` — Unauthorized
- `404` — The account or requested resource was not found or is not accessible. An account ID may have been disconnected and removed. Read GET /v1/accounts for current account IDs.
- `409` — The account exists but is inactive or needs reconnection. Reconnect it, then read GET /v1/accounts for its current account ID before retrying. Code: ads_connection_required.
- `501` — Only supported on Meta (facebook/instagram)
- `502` — Meta accepted the request then failed to produce the media (upload session, chunk transfer, processing timeout, or a response with no video id). Inspect `platformError.reason`.

## Changes

- **2026-09-16** `3e6ddf2a99ea` — 2 info
  - added the optional property `details/budgetScope` to the response with the `404` status
  - added the optional property `details/budgetScope` to the response with the `409` status
- **2026-09-15** `0dba7d004d75` — 4 info
  - added the optional property `details/quotaExhausted` to the response with the `404` status
  - added the optional property `details/quotaExhausted` to the response with the `409` status
  - added the optional property `details/quotaScope` to the response with the `404` status
  - added the optional property `details/quotaScope` to the response with the `409` status
- **2026-09-10** `e70ed06e7150` — 2 info
  - added the non-success response with the status `404`
  - added the non-success response with the status `409`
- **2026-08-25** `ac5fffe58a63` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/zernio/apis/zernio-api/changes/v1/ads/videos/post.md)

---

[API](https://skmtc.dev/zernio/apis/zernio-api.md) · [All operations](https://skmtc.dev/zernio/apis/zernio-api/llms.txt) · [OpenAPI document](https://skmtc.dev/zernio/apis/zernio-api/revisions/dd3865482f9f?raw)
