What it does
Upload up to 20 files from your own disk as one draft version, without their bytes passing through a tool call. files lists each { name, sha256? } (same names and types as upload_file; sha256 as sha256sum prints it pins the exact file). Returns batch_id, commit_by and one single-use upload_url per file for curl -sS -X PUT --data-binary @<file> "<upload_url>"; no API key and no Content-Type are needed. The links expire after 10 minutes (links_expire_at). A sent file is staged, not yet in the draft: the curl reply says staged true and lists the batch's files still missing. Then commit_uploads with batch_id, before commit_by (an hour after this call), writes every file as one draft version. All files of a batch together may hold at most 100 MB; each counts against max_file_bytes, and staged files count against the account's storage until the batch is committed or closes. Needs a shell that can reach pagehive.io.
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. |
filesrequired | array of objects | Up to 20 files, each { name } or { name, sha256 }. Names follow upload_file; sha256 (64 hex characters, as sha256sum prints it) makes that link accept only that exact file. |
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_urls with these arguments:
{
"site_id": "01a1…",
"files": [
{
"name": "hero.webp"
},
{
"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.