Sites
Host a static site on Amba — deploy a bundle of files, serve it at a free subdomain, attach your own custom domain with managed TLS, and roll back instantly.
Amba hosts static sites — marketing pages, docs, SPAs, anything that's a
bundle of files. Deploy a directory and Amba serves it at
https://{slug}.app.amba.host with a managed TLS certificate. Attach a
custom domain when you're ready, and roll back to any previous deployment
in one call. Every deployment is immutable, so a rollback is just a
pointer flip — no rebuild.
The fastest paths are the CLI (amba sites deploy ./dist) and the
amba_sites_* MCP tools. The REST surface below is what both wrap.
Concepts
- Site — a named container for deployments. The name must match
^[a-z][a-z0-9_-]{0,49}$and becomes part of the public URL. Public URL:https://{slug}.app.amba.host, whereslugis the first 8 characters of your project id plus the site name. - Deployment — one immutable upload of files. The current deployment serves all traffic; older ones are retained for rollback.
- Custom domain — your own hostname (e.g.
app.example.com) bound to the site, with a TLS certificate Amba provisions and renews for you.
Deploy
The CLI bundles a directory and ships it in one command:
From an agent, amba_sites_deploy creates the site (if needed) and
uploads the files in a single tool call — pass project_id, name, and a
files object mapping each relative path to its content.
Under the hood, deploy is two REST calls — register the site, then upload the bundle as multipart form data (one part per file, keyed by relative path):
| Method | Path | Description |
|---|---|---|
| POST | /admin/projects/:projectId/sites | Register a site. Body { name }. |
| POST | /admin/projects/:projectId/sites/:name/deployments | Upload a deployment (multipart). |
| GET | /admin/projects/:projectId/sites | List sites. |
| GET | /admin/projects/:projectId/sites/:name | Describe a site + its custom domains. |
| PATCH | /admin/projects/:projectId/sites/:name | Set status (active / disabled). |
| POST | /admin/projects/:projectId/sites/:name/rollback | Repoint to a prior deployment. |
| DELETE | /admin/projects/:projectId/sites/:name?confirm=:name | Delete a site (full cascade). |
A successful deploy returns the canonical URL plus file/byte counts:
The per-file cap is 25 MiB. A failed upload leaves your live site untouched — the new deployment is only made current after all files land.
Custom domains
Bind your own hostname, then publish the DNS records Amba returns. Amba registers the hostname and provisions and renews the certificate for you — you don't need any third-party credentials.
Subdomains like app.yourdomain.com are the simplest path. Apex (root) domains such as
yourdomain.com are supported too if your DNS provider flattens CNAME records at the root
(many do) — a root record can't take a plain CNAME per RFC 1034. If your provider doesn't
flatten, A-record apex support is coming soon; use a subdomain in the meantime. Platform domains
(*.amba.host, *.amba.dev) are reserved and rejected.
| Method | Path | Description |
|---|---|---|
| POST | /admin/projects/:projectId/sites/:name/domains | Attach a hostname. |
| GET | /admin/projects/:projectId/sites/:name/domains | List attached hostnames + status. |
| PATCH | /admin/projects/:projectId/sites/:name/domains/:hostname | Update a hostname's cert_status / ownership_status (CLI poll). |
| POST | /admin/projects/:projectId/sites/:name/domains/:hostname/refresh-cert | Re-poll ownership + certificate state. |
| DELETE | /admin/projects/:projectId/sites/:name/domains/:hostname | Detach a hostname. |
The attach response returns the records you publish to verify ownership
(ssl_validation + ownership_verification), the dns_target to point a
CNAME at, an is_apex flag (with dns_note guidance for root domains),
and two independent statuses:
The flow is:
- Publish the verification records. Add the
ssl_validationTXT record(s) and theownership_verificationTXT record at your DNS provider. Ifssl_validationis empty on the immediate response, it populates shortly — re-fetch the live records via therefresh-certendpoint oramba_sites_list_domains. - Point DNS at
dns_target. For a subdomain, add aCNAME. For a root (apex) domain (is_apex: true), point the root at the target if your DNS provider flattensCNAME-at-root; otherwise use a subdomain until A-record apex support ships (seedns_noteon the response). - Wait for both statuses to reach
active.ownership_status(pending → active) confirms you control the hostname;cert_status(pending_validation → pending_issuance → pending_deployment → active) tracks the TLS certificate.
Your domain is live — and the certificate renews automatically — only once
both statuses read active. Poll the list endpoint (or
amba_sites_list_domains), or call refresh-cert to force a re-check.
Rollback
Every deployment is immutable and kept on file. To revert, point the site
back at a previous deployment_id (find ids via amba_sites_get or
GET /sites/:name):
The flip is atomic — the next request serves the prior bundle. You can't
roll back to a failed deployment, and rolling back to the already-current
deployment is rejected.
Pause and delete
PATCH .../sites/:name with { "status": "disabled" } stops the site (and
its custom domains) from serving without losing the deployment history; set
it back to active to resume.
DELETE .../sites/:name?confirm=<name> tears everything down — custom
hostnames are unbound, every deployment's files are removed, and the site
row is archived. The ?confirm=<name> guard is required; the CLI and MCP
tool set it for you. The response reports what was cleaned up:
MCP tools
| Tool | Does |
|---|---|
amba_sites_deploy | Create-or-deploy in one call. |
amba_sites_list | List sites. |
amba_sites_get | Describe a site + its domains. |
amba_sites_delete | Delete a site (cascade). |
amba_sites_add_domain | Attach a custom hostname. |
amba_sites_list_domains | List hostnames + cert status. |
amba_sites_remove_domain | Detach a hostname (idempotent). |
See the CLI reference for the full amba sites command set.