Start a direct media upload
media_presignUse this only when you can HTTP PUT the file bytes yourself (a shell or code runtime). Web and mobile chat clients cannot, so do not call it there: for a file on the person's device use media_upload_link, for a public https address use media_from_url. Returns a media id and a one-time uploadUrl. PUT the file bytes to uploadUrl with the same contentType, then call media_complete. Images: image/jpeg, image/png, image/webp, image/gif, up to 20MB. Video: video/mp4, video/quicktime, video/webm, up to 8GB, 43200 seconds, 4096px wide. Aspect ratio up to 20:1. Any image pixel width is fine. Documents for DM automations only (deliver.mediaId), not for posts: application/pdf, application/x-hwp, application/hwp+zip (.pdf, .hwp, .hwpx), up to 25MB. If you can see the image, write altText describing it. The response has mediaExpiresAt: this media id disappears after that time if it was never published, and publish will then fail with media_expired.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bytes | Yes | File size in bytes | |
| width | No | Pixel width, if you know it | |
| height | No | Pixel height, if you know it | |
| altText | No | What the image shows, for people using screen readers. Write it whenever you can see the image. Applied to carousel items. | |
| fileName | Yes | ||
| aiGenerated | No | true when the image or video was generated or substantially changed with AI. Naver Blog photos get its AI-use label; Instagram, YouTube and TikTok get their AI declaration turned on unless you set it to false. Leave it out when unsure. | |
| contentType | Yes | image/jpeg or image/png or image/webp or image/gif or video/mp4 or video/quicktime or video/webm or application/pdf or application/x-hwp or application/hwp+zip | |
| workspaceId | No | Which workspace this is for. Only needed when the account has more than one — the error tells you the ids when it matters. Leave it out if it is already decided; do not ask the person again. |