Upload a file to attach to a post
upload_mediaUpload a small file you are holding (an image, or a tiny PDF) straight into the app and get back the permanent public URL for media_urls on schedule_post or update_post. Send the bytes base64-encoded in content_base64. Hard limit 32 KB decoded — inline tool arguments cannot reliably carry more than that, so for ANY normal photo, video or carousel PDF use create_upload_link instead and let the user upload it from their machine. Allowed: JPEG, PNG, WebP, GIF, PDF, MP4, MOV. Pass attach_to_post_id to append the file to an existing post in the same call; a PDF must be that post's only attachment.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | The file's name, e.g. carousel.pdf or hero.png. | |
| content_type | No | MIME type. Inferred from the filename extension when omitted. | |
| content_base64 | Yes | The file's bytes, base64-encoded. Max 5 MB decoded. | |
| attach_to_post_id | No | Optional post id from list_scheduled_posts. Appends this file to that post's existing media instead of replacing it. |