Upload a site
Publish a directory, a .zip or a file from your own computer as a static site, from the CLI, the account pages, the MCP server or the API, without a sandbox.
A site does not need a sandbox: you can upload its files from your own computer. The upload becomes a new version of the site and goes live at once, exactly like a publish from a sandbox.
pols publish ./dist # a new site with a generated name, private
pols publish ./dist --site my-docs # publish to my-docs (made if it does not exist yet)
pols publish site.zip --site launch --access public
pols publish report.html --site q3-report --access link
Without a sandbox name, pols publish DIR reads DIR on your computer. A directory is uploaded with its contents, a .zip as it is, and a single file is published on its own. --site and --access work as for a publish from a sandbox; --access applies only to a site the command makes, and an existing site keeps its own (the CLI refuses a differing --access).
Drop
Drop on the account pages does the same in the browser: pick a folder, files or a .zip, or drag them onto the window, and publish them to a new site (with a generated or chosen name, and its access) or to one you already have. The page shows the upload’s progress.
Over the API and MCP
POST /v1/sites/{site}/upload publishes the request body, a tar (Content-Type: application/x-tar) or zip (application/zip) archive, as the site’s new live version:
tar -C dist -cf - . | curl -X POST "https://api.pols.so/v1/sites/my-docs/upload?create=true" \
-H "Authorization: Bearer $POLS_API_KEY" \
-H "Content-Type: application/x-tar" \
--data-binary @-
- With
create=true, a site your org does not have yet is made with that name, or with a generated name when{site}is-. It is private unlessaccesssays otherwise. Withoutcreate, the site must exist. - An
accessthat differs from an existing site’s is refused with409 conflict. - The answer is the site, its new version and whether the upload made the site (
created).
The MCP server’s site_upload uploads a local directory, .zip or file the same way, making the site if it is new.
What gets published
The same rules as for a publish from a sandbox apply:
- Only regular files are published. Symbolic and hard links, devices, files and directories whose names start with a dot (except a
.well-known/directory at the top) and paths with a..are left out and counted as skipped. - A zip whose files all sit in one folder publishes that folder’s contents, so a zipped
dist/works as it is. - A file that holds the value of one of your org’s vault entries is refused with
400 bad_request, so a secret is not published by mistake. - The limits of a version and of your org’s sites apply: 10,000 files and 100 MiB per version, 2 GiB for all sites, and 30 publishes an hour, uploads and publishes from sandboxes together. An archive larger than a version may hold, plus 4 KiB for each file (140 MiB by default), is refused with
413.
If an upload fails, a site made for it is deleted again; its name stays your org’s.