Skip to main content

Create an upload

POST https://useshareable.com/api/v1/uploads Use this when an agent has the file on disk and a shell. It’s the fastest way to publish any HTML page over ~50 KB, and the way to send a PDF or image over ~3 MB without hosting it somewhere first. Inline html or file_base64 is slow for large files because the model types every byte, and it is capped at ~4 MB by the request-body limit. With an upload, one curl sends the file from disk to storage, and you publish it by passing the upload_id. The MCP servers expose this as the create_upload tool.
string
required
The file’s name with its extension. It sets the type: .html/.htm makes a page, and .pdf/.png/.jpg/.webp/.gif makes a file. It can be a path; the returned curl reads exactly what you pass, and only the base name is kept.
integer
required
The file’s exact size in bytes. The uploaded file must match it exactly. A PDF/image can be up to your plan’s per-file cap (Free 5 MB, Pro 50 MB). An HTML page is limited to 7 MB for now, because larger pages time out when saved. For a bigger page, move images out into a deck as assets.
string
Optional hex SHA-256 of the file. If given, an HTML upload whose bytes don’t match is refused with 422 when you use it.
string
Optional. Overrides the type inferred from filename.
Then:
  1. Send the file. Run the returned curl, or PUT the raw bytes to upload_url with the given headers.
  2. Use it. Pass upload_id in place of the content:
    • an HTML upload to POST /pages to create a page, or to PATCH /pages/{id} to replace a page’s draft HTML;
    • a PDF/image upload to POST /pages to publish it.
    The other create options (title, access, controls) work as usual. HTML writes return received: { bytes, sha256 }, so you can confirm the server got exactly your file.

Rules

  • An upload_id belongs to the account that created it and expires after 30 minutes.
  • It works once: using it consumes the stored file. Retrying a PDF/image publish with the same id returns the page it already created.
  • If a write fails (for example a duplicate title), the upload is kept, so you can retry with the same id.
  • Files are stored in a private staging area until they are used. Unused uploads are deleted automatically.

Errors