Domain

serve()

domain.serve({ name, pages }) → Promise<Served>

Makes a hostname actually serve: it writes the record and registers the name with the platform that will answer. Both halves, together.

both halvespages from servers()a record alone is not enough
Using Python?

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

const servers = await api.domains.servers();

const served = await domain.serve({ name: "docs", pages: servers[0].name });
// { hostname, target, project, status, certificate, note }
servers = api.domains.servers()

served = domain.serve(name="docs", pages=servers[0]["name"])
# {"hostname", "target", "project", "status", "certificate", "note"}
namestringrequired

The hostname, relative to the zone — docs, www.

pagesstringrequired

What will serve it, from servers().

Why it is one call

A DNS record never makes a hostname serve anything

The platform on the other end must recognise the name as well, or its edge refuses the connection — which reads as an outage. Writing the record alone is the mistake this call exists to prevent.

The certificate takes a moment

certificate comes back as its state. Until it is active the connection fails — a wait, not a fault. Check it before telling anyone the address works.

For a host created here, use the host

host.domains.attach() is the one for something hosted on IaGenify. This one is for serving a name from something else on the account.

Undoing it

unserve() removes both halves — the registration and the record.