pagehive

commit_uploads

Write every file staged through one create_upload_urls batch as one draft version.

Draft contentChanges dataAll plansUpdated

What it does

Write every file staged through one create_upload_urls batch as one draft version. Refused, writing nothing, when a file of the batch was not sent (validation_failed reason batch_incomplete, details.missing lists the names), when the batch was already committed (batch_committed) or is past commit_by (batch_expired). Optional base_version must equal the current draft version, or the call fails with validation_failed reason version_conflict. A name already on the site is replaced. uploaded in the response lists each file (name, url, content_type, size_bytes, sha256); files lists what changed in the draft, as for every write. Visitors see nothing until publish_site.

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.
batch_idrequiredstringThe batch_id create_upload_urls returned. Every file of the batch must have been sent.
base_versionintegerOptional: the current draft version. Another number fails with version_conflict.
messagestringA short note for the version history, like a commit message.
verbosebooleantrue lists every file and page of the draft. Otherwise the response lists only what this call changed, plus draft totals.
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 commit_uploads with these arguments:

{
  "site_id": "01a1…",
  "batch_id": "01a1…"
}

Ids like 01a1… stand for your own. list_sites and list_tables give you the real ones.

Related guides