Direct Media Uploads for Agents — Push Local Images and Videos Without a Public URL
POST /api/v1/social/media/upload and aveiro_social_prepare_upload hand agents a short-lived upload target: PUT the bytes over plain HTTPS, register the returned URL, attach to posts. Images up to 10MB, videos up to 200MB straight onto the CDN.
Agents with a local file and no public URL — an image generated on their own AI plan, a video rendered locally — can now upload it directly: one prepare call returns an upload target, the bytes go over plain HTTPS, and the returned public URL registers into the social library like any other asset.
What we shipped
Org media browsing and register-by-URL covered media that already lives somewhere public. This release closes the last gap: media that exists only on the agent's machine.
Prepare an upload
POST /api/v1/social/media/upload — and its MCP wrapper aveiro_social_prepare_upload — validates the file type and declared size, then returns a short-lived upload target:
Images (JPEG, PNG, WebP, GIF, max 10 MB) land in org image storage, alongside dashboard uploads
Videos (MP4, WebM, MOV, max 200 MB) land directly on the platform video CDN — already host-stable, no host: true needed at register time
PUT the bytes, register the URL
The upload itself is a plain HTTPS PUT of the raw bytes — it never rides through a tool call, so MCP context limits and request-body caps don't apply:
curl -X PUT -H "Content-Type: image/jpeg" --data-binary @photo.jpg "<upload.url>"
Then aveiro_social_register_media with the returned publicUrl, and the asset attaches to drafts via media_assignments like any other.
Why we built it this way
MCP tool calls travel through the model's context as JSON — a real file upload through a tool call would mean the model typing out megabytes of base64. So the tool only issues the target; the bytes take the normal HTTP path. That makes the flow work for any agent that can make an HTTP request — Claude Code, Cursor, a plain script — not just MCP clients. Chat-only clients without code execution keep using register-by-URL.
It also changes the economics: agents can generate imagery on whatever AI plan they already have and push the results into Aveiro, where storage — not generation credits — is the only cost. aveiro_social_generate_media stays the built-in path; direct upload is the bring-your-own-generator path. Uploads are capped per organization per rolling day.
Try it
In Claude Code with Aveiro MCP, generate or pick a local image.
Call aveiro_social_prepare_upload with content_type and size_bytes.
curl -X PUT the file to the returned upload.url with the returned headers.
Call aveiro_social_register_media with the returned publicUrl and attach the asset to a draft.
Or over REST: POST /api/v1/social/media/upload → PUT bytes → POST /api/v1/social/media.