Upload an image
upload_imageUpload an image to Substack's CDN and get back an unlisted URL you can use in a post body or as a cover image. Accepts PNG, JPEG, GIF, WebP up to 10MB.
Instructions
Upload an image to Substack's CDN and get back a URL you can use in a post body or as a cover image.
Give exactly one of url or path. PNG, JPEG, GIF and WebP are accepted, up to 10MB. HEIC and SVG are not.
The returned URL is unlisted rather than secret: anyone who has it can fetch it, even before the post is published.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | An http(s) URL to download and re-host. Private, loopback and link-local addresses are refused. | |
| path | No | Absolute path to an image on the machine running this server. Use this for a locally generated image. Must be absolute, since a relative path would resolve against the server's working directory rather than yours. | |
| post_id | No | Attach the image to a specific post or draft id. | |
| publication | No | Which connected publication to act on, matched loosely against its hostname (for example 'example.substack.com' or just 'example'). Defaults to the first connected publication. |