Get a link to send a file
get_upload_linkGives a one-time link to send a file from your own code tool, such as an image you generated or a PDF you made for LinkedIn, so it can go on a post. PUT the file's exact bytes to the link with exactly the headers it gives, call finish_upload for its media_id, then pass that in media_ids on create_draft or update_draft. Use it when the file is in a code tool that can reach the internet. Don't use it for a file on the person's computer: that's attach_media. Up to 64 MB. PDFs post to LinkedIn only. Example: filename "a1b2c3.jpg", bytes 183021, type "image/jpeg".
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": {
"filename": "<filename>",
"bytes": "<bytes>",
"type": "<type>"
},
"name": "get_upload_link"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | The file's type, such as image/jpeg, image/png or video/mp4. PostReach takes JPEG, PNG, GIF, WebP, HEIC, AVIF, MP4, MOV and PDF | |
| bytes | Yes | The file's exact size in bytes, as your code tool reads it | |
| filename | Yes | The file's name, such as a1b2c3.jpg. Folders are left off | |
| workspace_id | No | The workspace the post is for, from get_publishing_context. Left out, the person's only workspace | |
| idempotency_key | No | A unique value for this file, such as a UUID. Asking again with the same key gives the same upload, with a new link if the first ran out |