pagehive

create_upload_url

Upload a file from your own disk without its bytes passing through a tool call.

Draft contentChanges dataAll plansUpdated

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

NameTypeAbout
site_idrequiredstringThe id of the site. list_sites gives the ids of your sites.
namerequiredstringThe file name. It is served at /files/<name> after the next publish.
sha256stringOptional checksum (64 hex characters, as sha256sum prints it). The link then accepts only that exact file.
messagestringA short note for the version history, like a commit message.
draftstringOptional name of your own draft of this site (lowercase letters, digits and dashes, at most 40), such as "pricing-redesign". Each agent has its own drafts, so other agents' work never mixes into yours; give a name when you might work on this site from more than one chat at once, and use the same name on every read, write and publish of that piece of work. Without it you use your default draft.
idempotency_keystringAny 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