upload_media
Upload media and get back a reusable media_id. Two modes: (1) pass url to upload from a publicly accessible URL (preferred for anything over a few MB), or (2) pass data (base64-encoded file bytes) plus mime_type to upload bytes directly from the model context. Supports images (PNG/JPEG), videos (MP4/MOV), and PDFs (application/pdf). A PDF returns a document-kind media_id — pass it to create_post on a LinkedIn account to publish a native LinkedIn document post (PDF carousel); set platform_configurations.linkedin.document_title to control the title. Use the returned media_id with the media param on create_post/update_post. HEIC/HEIF images are not supported — convert to JPEG or PNG first. Direct data uploads are capped at 3MB raw because of serverless request-body limits — for larger files, host at a public URL and use url mode, or upload via the dashboard.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Publicly accessible URL of the image or video to upload. Provide either `url` or `data`, not both. | |
| data | No | Base64-encoded file contents. Requires `mime_type`. Capped at 3MB raw (serverless request-body limit). For larger files, host the file at a public URL and pass it as `url` instead. Provide either `data` or `url`, not both. | |
| name | No | Optional filename to store (defaults to the URL's filename, or 'file' for direct uploads) | |
| mime_type | No | Required when using `data`. One of: image/png, image/jpeg, video/mp4, video/quicktime, application/pdf. |