Browse the Help Centre
Overview

Help Centre / API and MCP

How do I upload media through the overads API?

Included in Growth, the one overads plan. API keys, webhooks and the MCP server are part of the plan.

There are two ways to give overads a file over the API. Pass a public https link in mediaUrls on the post, or upload the file yourself in three calls (reserve an upload URL, PUT the bytes, complete) and attach it with mediaIds.

Which way to use

By link (mediaUrls)By upload (mediaIds)
Best forA file already on the public webA private file, or a large video
CallsNone extra: the link rides on the postThree, then the post
Image sizeUp to 15 MBUp to 15 MB
Video sizeUp to 25 MBUp to 500 MB
How many per postUp to 10 linksUp to 10 ids
Scope the key needsposts:writemedia:write, then posts:write

Put public https links in mediaUrls when you create the post. overads downloads each file into its own storage before the post is saved, so the source can go away afterwards.

curlbash
curl -X POST https://api.overads.io/public/v1/posts -H "Authorization: Bearer sk_live_YOUR_KEY" -H "Content-Type: application/json" \
  -d '{
    "content": "Two new pastries this week.",
    "connectionIds": ["3f1c1a2e-6b2a-4a0e-9a5f-0d5a7d0f2b11"],
    "mediaUrls": ["https://cdn.example.com/pear-danish.jpg", "https://cdn.example.com/cinnamon-bun.jpg"]
  }'
  • The link must be public https. Plain http, private addresses, a response that is not 2xx and content that is not an image or video are all refused with MEDIA_URL_REFUSED.
  • The file type is read from the bytes, not from the file extension.
  • A signed link works as long as it is public https and still valid when overads fetches it.
  • A refusal names the host, never the full link, because signed links carry tokens.

By upload: three calls

Use this for a file that is not on the public web, or a video over 25 MB. The example uploads a short reel for Brew & Bloom.

  1. Reserve. POST /media/upload-url with the kind (image or video), the contentType and the exact size in bytes. The answer carries a media object with its id, an uploadUrl and the headers to send.
  2. Send the bytes. PUT the file to uploadUrl with exactly the returned headers. The URL is valid for 15 minutes.
  3. Complete. POST /media/:id/complete. The asset becomes ready.
  4. Attach. Create the post with the id in mediaIds.
bashbash
# 1. reserve
RES=$(curl -s -X POST https://api.overads.io/public/v1/media/upload-url -H "Authorization: Bearer sk_live_YOUR_KEY" -H "Content-Type: application/json" \
  -d "{ \"kind\": \"video\", \"contentType\": \"video/mp4\", \"bytes\": $(stat -f%z reel.mp4) }")
URL=$(echo "$RES" | jq -r .data.uploadUrl)
ID=$(echo "$RES" | jq -r .data.media.id)

# 2. put the bytes with the returned headers
curl -X PUT "$URL" -H "Content-Type: video/mp4" --data-binary @reel.mp4

# 3. complete, then attach
curl -X POST https://api.overads.io/public/v1/media/$ID/complete -H "Authorization: Bearer sk_live_YOUR_KEY"
curl -X POST https://api.overads.io/public/v1/posts -H "Authorization: Bearer sk_live_YOUR_KEY" -H "Content-Type: application/json" \
  -d "{ \"content\": \"Latte art, slowed down.\", \"connectionIds\": [\"3f1c1a2e-6b2a-4a0e-9a5f-0d5a7d0f2b11\"], \"mediaIds\": [\"$ID\"] }"

What an upload accepts

KindContent typesLargest file
imageimage/jpeg, image/png, image/gif, image/webp15 MB
videovideo/mp4, video/quicktime, video/webm500 MB

These are the API's own caps. Each channel then has its own cap on top, and a video over one target channel's cap is refused when the post is created. See media sizes for the channel rules.

The states of an uploaded file

statusMeaning
uploadingReserved. The bytes have not been confirmed yet. It cannot be attached.
readyCompleted. It can be attached through mediaIds.
failedComplete found the stored file over the cap for its kind.

When a step is refused

CodeStatusMeaningRecovery
MEDIA_NOT_READY409The asset has not been completed, or the bytes are not in storage yet.PUT the file, then POST /media/:id/complete.
MEDIA_TOO_LARGE400Over the cap: 15 MB images, 500 MB video by upload, 25 MB video by URL. (A video over one target channel's own size cap carries the same code in the flat channel-limit body below.)Shrink it, or use the presigned upload for large video.
MEDIA_NOT_FOUND404A mediaIds entry is not a media asset in this workspace.Use the id returned by POST /media/upload-url.
MEDIA_URL_REFUSED400The URL is not public https, did not answer 2xx, or did not return an image or video.Host the file on a public https URL.
MEDIA_STORAGE_UNAVAILABLE503Object storage is not configured or not reachable.Retry later; nothing was written.
VALIDATION_FAILED400 (409 for a taken slug)An Idempotency-Key over 255 characters, an upload contentType the kind does not accept, a taken workspace slug, or a managed key asking only for workspaces:manage.The field names it.
  • MEDIA_NOT_READY nearly always means complete was called before the PUT finished. Wait for the PUT to return 200, then complete.
  • A PUT that fails with a signature error usually sent different headers from the ones returned. Send the returned Content-Type and length exactly.
  • If the 15 minutes ran out, reserve again. The first reservation is simply never completed.

Use both on one post

mediaUrls and mediaIds can be mixed on one post. The post stores the final list in overads storage in the order given: links first, then ids.

Delete a file

DELETE /media/:id removes the asset and the stored file. A post that already refers to it keeps the address, but the file is gone, so delete only media that no waiting post still needs.

From an AI assistant

The MCP server has the same three steps as tools: get_upload_url, complete_media and delete_media, each needing the media:write permission. An assistant that only has a link can skip them and pass the link to create_post in mediaUrls.

One media list is attached to every target of a post, and each channel's rule is applied to it. When two channels want different media, send two posts.

Common questions

How large a video can I upload through the overads API?

Up to 500 MB by upload, and up to 25 MB when passed as a link. The channel you post to may have a lower cap of its own.

How long is the upload URL valid?

15 minutes from the reserve call. After that, reserve a new one.

Do I have to host my images publicly?

No. The three-call upload sends the file straight to overads storage, so it never needs a public address.

Can I reuse an uploaded file on several posts?

Yes. Pass the same id in mediaIds on each post, for as long as the file has not been deleted.