Create and protect a token
Activate account Advanced in Plans before creating a personal access token in the signed-in API & CLI dashboard area. Every API and CLI request requires active Advanced, including requests using existing tokens. Premium has no API or CLI access and is not grandfathered.
Treat a token like a password. Store it in a secret manager or CI secret, never in source control, browser code, screenshots, or a public ZIP.
- Open API & CLI in the Dashboard.
- Create a token with only the access you need.
- Use it in an Authorization Bearer header or through the CLI login command.
- Revoke it from the Dashboard when it is no longer needed.
Advanced access and renewal
Buying credit packs alone does not enable API or CLI access. Activate or renew account Advanced through Account Plans.
If Advanced expires, an existing token returns 403 advanced_required. An unrevoked token becomes usable again after Advanced renewal. Token inspection and revocation remain available without Advanced.
Losing API access does not itself suspend hosted sites or cancel already accepted imports. Free accounts can still publish and manage Free Spaces through the dashboard.
Use the CLI
The CLI accepts exactly one readable .zip file. It can list Spaces, start an asynchronous deployment, inspect an import, and optionally wait for the import to finish.
Tips and limits
- For CI, set HTMLSPACE_TOKEN in the CI secret store. It takes precedence over stored CLI credentials and is not written to the CLI config file.
- Use --json for machine-readable CLI output.
- Use --wait when an automation step needs the completed hosted URL before continuing.
htmlspace deploy ./site.zip --wait
HTMLSPACE_TOKEN=... htmlspace spaces list --json
Know the boundaries
Tips and limits
- If Advanced expires or becomes inactive, requests return 403 advanced_required. Renew Advanced in Account Plans to restore access. You can still inspect and revoke tokens, manage Free Spaces in the browser, and keep existing hosted sites online under their normal hosting policies.
- The CLI does not accept directories, zip folders, watch or synchronize files, edit Live Workspace files, activate Releases, or make billing changes.
- API ZIP imports accept one public ZIP URL or one multipart local ZIP. They are asynchronous and should be polled until a terminal status.
- The API base URL is https://htmlspace.com/api/v1. Consult the API reference for endpoint payloads and error envelopes.