Get an API key
Host

domains.attach()

host.domains.attach(name) → Promise<Domain>

Serves this host at a domain of your own. The domain must be attached to the account — we only write in a zone we hold.

POSTthe domain must be attacheda new certificate
Using Python?

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

await host.domains.attach("www.example.com");
host.domains.attach("www.example.com")

The domain must be attached first

domain_not_attached, and that is the point

Serving a name means writing in its zone. We only write in a zone we hold — so the domain goes through api.domains.add() first, and its nameservers must point here.

It does both halves

The record, and the registration that makes the platform accept the name. A record alone gives an address that resolves and refuses — which is the same reason domain.serve() exists for things hosted elsewhere.

A new name means a new certificate

It takes a moment, and until it is active the address refuses the connection. Read certificate on the host before telling anyone the address works.

Several names, one host

await host.domains.attach("example.com");
await host.domains.attach("www.example.com");
host.domains.attach("example.com")
host.domains.attach("www.example.com")

Each gets its own record and its own certificate. The host's own address keeps working alongside them.

Errors

CodeStatusWhen
domain_not_attached409The domain is not on this account.
invalid_name400Not a usable hostname.