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 for | A file already on the public web | A private file, or a large video |
| Calls | None extra: the link rides on the post | Three, then the post |
| Image size | Up to 15 MB | Up to 15 MB |
| Video size | Up to 25 MB | Up to 500 MB |
| How many per post | Up to 10 links | Up to 10 ids |
| Scope the key needs | posts:write | media:write, then posts:write |
By link
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.
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.
- Reserve. POST
/media/upload-urlwith thekind(imageorvideo), thecontentTypeand the exact size inbytes. The answer carries amediaobject with itsid, anuploadUrland theheadersto send. - Send the bytes. PUT the file to
uploadUrlwith exactly the returned headers. The URL is valid for 15 minutes. - Complete. POST
/media/:id/complete. The asset becomesready. - Attach. Create the post with the id in
mediaIds.
# 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
| Kind | Content types | Largest file |
|---|---|---|
image | image/jpeg, image/png, image/gif, image/webp | 15 MB |
video | video/mp4, video/quicktime, video/webm | 500 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
status | Meaning |
|---|---|
uploading | Reserved. The bytes have not been confirmed yet. It cannot be attached. |
ready | Completed. It can be attached through mediaIds. |
failed | Complete found the stored file over the cap for its kind. |
When a step is refused
| Code | Status | Meaning | Recovery |
|---|---|---|---|
MEDIA_NOT_READY | 409 | The asset has not been completed, or the bytes are not in storage yet. | PUT the file, then POST /media/:id/complete. |
MEDIA_TOO_LARGE | 400 | Over 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_FOUND | 404 | A mediaIds entry is not a media asset in this workspace. | Use the id returned by POST /media/upload-url. |
MEDIA_URL_REFUSED | 400 | The 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_UNAVAILABLE | 503 | Object storage is not configured or not reachable. | Retry later; nothing was written. |
VALIDATION_FAILED | 400 (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_READYnearly 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-Typeand 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.
