Import a project from a ZIP file
import_zipImports a multi-file website from a ZIP archive into an existing site. index.html (or the only HTML file in the root) becomes the page and is published; all other files go to assets/ with their folders kept (assets/css/style.css, assets/img/logo.png). Relative paths in index.html are rewritten to assets/ automatically. Send the archive as zip_base64 (base64 string) or zip_url (public http/https link, e.g. a GitHub archive URL). Limits: ZIP up to 20 MB, 300 files, 10 MB per file, the account storage limit. Allowed files: html, css, js, json, images (jpg, png, gif, svg, webp, avif, ico), fonts (woff, woff2, ttf, otf), txt, xml, pdf. Use dry_run=true first to see what would happen. The previous index.html is kept in version history (restore_version).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | Yes | Site id or name, e.g. "my-portfolio" or "my-portfolio.hostilo.page" (from list_sites). | |
| dry_run | No | Only check the archive and report what would be imported; nothing is changed. | |
| zip_url | No | Public http/https URL of the ZIP file (max 20 MB, up to 3 redirects). Use this or zip_base64. | |
| zip_base64 | No | The ZIP file encoded as base64 (max 20 MB decoded). Use this or zip_url. | |
| clear_assets | No | Delete all current files in assets/ before importing. | |
| expected_version | No | Optional: the version from get_site. If the site was saved by someone else since then, nothing is published and you get a version_conflict error (get the site again and merge). |