Supported source files
File contents are validated after upload. Platform publishing rules may impose additional duration, codec, attachment, and caption requirements.
CLI and MCP
upload_media accepts a publicly accessible HTTPS URL. It cannot read a local path. Local stdio MCP can accept a file inside its configured media root.
HTTP upload
- Call
POST /media/uploadswithfilename,contentType, andsizeBytes. - For a single upload, PUT the raw file bytes to
data.uploadUrlwith the matchingContent-Type. - Call
POST /media/MEDIA_ID/completeto validate the uploaded file. - Use the ready media ID in the post’s
mediaIdsarray.
12345 with the actual file size. Set UPLOAD_URL to the returned URL, then upload and complete:
Multipart video uploads
Whenmultipart is true, uploadUrl is empty. Split the file using the returned partSize. Call /media/MEDIA_ID/multipart with operation: "sign" and a one-based partNumber for each part, then PUT its bytes to the returned URL. Use operation: "list" to inspect uploaded parts and operation: "complete" to assemble them. Finally call /media/MEDIA_ID/complete to validate the complete file.
operation: "abort" cancels an unfinished multipart upload. If an upload result is uncertain, inspect the reported media ID before creating another reservation.