What it does
Upload a file from your own disk without its bytes passing through a tool call. Returns a single-use upload_url for curl -sS -X PUT --data-binary @<file> "<upload_url>". The cost is a few hundred tokens whatever the file size, up to max_file_bytes. No API key and no Content-Type are needed. The link works once and expires after 10 minutes (expires_at). Optional sha256 (64 hex, as sha256sum prints it) makes it accept only that exact file. The curl reply is the same as upload_file's, and the file shows as /files/name after publish_site. Same names and types as upload_file. Needs a shell that can reach pagehive.io; upload_file with source_url fetches a file that is already online.
Plans
Works on every plan: Free, Basic, Pro and Ultra.
Parameters
| Name | Type | About |
|---|---|---|
site_idrequired | string | The id of the site. list_sites gives the ids of your sites. |
namerequired | string | The file name. It is served at /files/<name> after the next publish. |
sha256 | string | Optional checksum (64 hex characters, as sha256sum prints it). The link then accepts only that exact file. |
message | string | A short note for the version history, like a commit message. |
idempotency_key | string | Any unique string (1-200 printable ASCII). A retry with the same key and arguments returns the first call's result instead of running again. Same as the Idempotency-Key header. |
Example
Call create_upload_url with these arguments:
{
"site_id": "01a1…",
"name": "intro.mp4"
}
Ids like 01a1… stand for your own. list_sites and list_tables give you the real ones.
Related guides
- Images, fonts, PDFs and videoUpload files and use them on your pages.