Start a direct image upload
media_presignStep 1 of attaching an image or video. 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, up to 8MB. Video: video/mp4, video/quicktime, up to 1GB, 300 seconds, 1920px wide. Aspect ratio up to 10:1. Any image pixel width is fine. 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 | ||
| contentType | Yes | image/jpeg or image/png or video/mp4 or video/quicktime | |
| 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. |