Start a media upload (step 1)
prepare_media_uploadInitiates media upload by generating a short-lived presigned URL. Put raw file bytes to that URL, then finalize to obtain a hosted public URL for scheduling posts.
Instructions
STEP 1 of the media upload flow (use this for any real image/video; upload_media is only for tiny files). Returns a short-lived PRESIGNED upload URL you PUT the raw file bytes to yourself, outside MCP, with NO credentials (the signature is in the URL). Then call finalize_media_upload to register it and get the hosted publicUrl for schedule_post mediaUrls.
Flow:
prepare_media_upload { filename, contentType, size } -> { key, uploadUrl, publicUrl }
PUT the bytes to uploadUrl, e.g.
curl -X PUT --data-binary @day01.mp4 -H "Content-Type: video/mp4" "<uploadUrl>". Send RAW bytes, do NOT base64-encode.finalize_media_upload { key, contentType, size }.
size must be the exact byte size. The uploadUrl expires shortly, so PUT immediately (prepare/PUT/finalize one file at a time). CAPABILITY: draft — creates content that cannot reach an audience on its own. Safe for a draft-only agent token.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | Yes | Exact file size in bytes. | |
| filename | Yes | Original filename incl. extension, e.g. "day01.mp4". | |
| contentType | Yes | MIME type: image/jpeg|image/png|image/gif|image/webp|video/mp4|video/quicktime. |