Host

Overview

One host: deploy to it, roll it back, attach a domain, read what it is using.

7 methodsdomainsslug is fixed
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

MemberDoes
deploy(options)Puts files, or code, online.
update({ label })Renames it — the label only.
deploys()The history.
rollback(deployId)Puts an earlier deploy back online.
usage()What it uses.
remove()Deletes it.
domainsattach · list · detach.
const site = await api.hosts.get(id);

await site.deploy({ files: "./out" });
await site.domains.attach("www.example.com");
site = api.hosts.get(host_id)

site.deploy(files="./out")
site.domains.attach("www.example.com")

The slug cannot change

It is the address. Changing it would break shared links, the attached domain and the certificate — update() changes the label only, and another address means another host.

Deploying is not building

Build where the code is; send the result here. A deploy pointed at a source folder publishes sources, successfully — which is what makes it worth saying twice.