Upload a local file (step 1 of 2)
create_media_uploadFor a file on your machine that has no public URL: reserves the space and returns media_id and a signed upload_url. PUT the file's raw bytes there with exactly the returned headers (content-type, content-length, if-none-match: *) within 30 minutes, then call complete_media_upload with the media_id; until then the media can't go on a post. The file goes straight to Shager's storage, not through this API. Types: JPEG, PNG, WebP, GIF, MP4, MOV, WebM and PDF, up to 2 GB; size_bytes must be the file's exact size. For a file that is already online, upload_media_from_url does it in one call. A video file is deleted 7 days after the time of the posts that use it (a still stays); to post it again later, upload it again.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"workspace_id": "<workspace_id>",
"file_name": "<file_name>",
"mime_type": "<mime_type>",
"size_bytes": "<size_bytes>"
},
"name": "create_media_upload"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_name | Yes | ||
| mime_type | Yes | The file's type: image/jpeg, image/png, image/webp, image/gif, video/mp4, video/quicktime (MOV), video/webm or application/pdf | |
| size_bytes | Yes | The file's exact size in bytes | |
| workspace_id | Yes | Workspace id from list_workspaces |