Add files to a staging session
add_filesAppend files to an open staging session. Call as many times as needed; commit_deploy applies them all at once. Validates path/extension/encoding on every call so a bad file fails fast. Same 500 MB cap as single-call deploys, but cumulative across the session. LARGE TEXT FILES: a file that looks too big to inline (100-250 KB of HTML/CSS/JS) usually still fits in ONE call — gzip it locally, base64 the result, send with encoding:'gzip+base64' (text compresses 3-5×, so ~250 KB of source ≈ ~70 KB on the wire). Prefer that over add_file_chunk: one call, no ordering hazards. Only chunk when a single file exceeds ~250 KB of source even after gzip, or when you have no way to gzip locally. If your environment can run shell but can't reach this host, gzip+base64 via add_files is the fastest path; if it CAN reach this host, begin_deploy's uploadUrl (tarball POST, 100 MB) beats everything.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | Files to append to the staging scratch dir. Same wire shape as deploy_site/update_site — array form supports binary via encoding:'base64'; map form is utf8-only. Re-adding a path overwrites the previously staged version. Cumulative cap across the whole session: 500 MB. | |
| deployId | Yes | Session id returned by begin_deploy. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deployId | Yes | ||
| warnings | No | ||
| filesAdded | Yes | Files written by this call. | |
| request_id | No | Server-assigned request correlation id. Quote it when contacting support. | |
| totalBytes | Yes | Total bytes staged so far across all add_files calls. | |
| totalFiles | Yes | Total files now in the scratch dir. | |
| remainingBudget | Yes | Bytes still available before hitting the 500 MB cap. |