upload_image
Upload an image to Substack from an HTTP URL or local file path, returning a hosted Substack URL for use in posts and drafts.
Instructions
Host an image on your Substack publication and get back a Substack URL — the one thing image2.src in set_post_body and cover_image in update_draft will actually render. The source is either an http(s) URL, which the server downloads and re-hosts, or path, an absolute path to a local file on the machine running this server, which is read straight from disk: use that for an image you generated or edited locally, with no need to publish it anywhere first. Private and loopback hosts are refused, HEIC is not accepted, max 10 MB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | The http(s) URL of an image to upload. The server downloads it and re-hosts it on Substack. Private, loopback and link-local hosts are refused. Max 10 MB. HEIC is not accepted. Provide exactly one of `url` or `path`. | |
| path | No | Absolute path to an image file on the machine running this server, read directly from disk with no download. Use this for a locally generated or edited image. The path must be absolute — a relative one would resolve against the server's working directory, not the caller's. The type is detected from the file's contents, not its extension: PNG, JPEG, GIF and WebP are accepted, HEIC is not. Max 10 MB. Provide exactly one of `url` or `path`. | |
| post_id | No | Optional id of the post the image belongs to. Its effect is unconfirmed. |