Hanzo
OpenapiProjects

Attaches one or more CUSTOM public hostnames to this org's site.

Attaches one or more CUSTOM public hostnames to this org's site.

POST /v1/projects/{slug}/domains

Addresshttps://api.hanzo.ai/v1/projects/{slug}/domains
MethodPOST
Operationpost_projects_by_slug_domains
AuthAuthorization: Bearer $HANZO_API_KEY

Attaches one or more CUSTOM public hostnames to this org's site.

Binding a host you do not own would let you shadow it at the edge, so which outcome you get depends on whether ownership is already established: a SuperAdmin vouches (the operator manages the customer's DNS, so its bind IS the proof) and binds VERIFIED immediately; every other caller, INCLUDING an admin of the deployment's own brand org, has the host CLAIMED as pending and gets the DNS challenge back in bound[].records. A pending claim HOLDS the name so nobody else can take it, but it does not route until POST .../domains/{host}/verify proves control.

A hostname we operate is refused to a non-vouched caller (those are assigned by the platform, never claimed), a host another site already holds is a 409, and a name the platform holds is a 400 for EVERY caller — a vouch skips the ownership proof, never the host table's own invariant. Claims and binds are idempotent for the same (org, slug), and re-claiming returns the SAME token rather than invalidating a record the customer has already published. The edge cache-tag is flushed afterwards so a newly-verified host serves the current build immediately.

Scope: a validated principal is required (403 without one) and the site is resolved within that principal's org, so another tenant's slug is a 404.

Request

3 fields, body application/json (required).

FieldInTypeRequiredDescription
slugpathstringyesSlug is the site the hosts attach to, from the path.
domainsbodystring[]Domains are the custom hostnames to attach, in order.
slugbodystringSlug is the site the hosts attach to, from the path.

Response

StatusBodyMeaning
200projectsBoundDomainsok

200 body — 14 fields.

FieldInTypeAlwaysDescription
boundbodyprojectsDomain[]Bound is the result of THIS call, one row per host in the request: live for an already-vouched host, pending with the DNS records to publish otherwise.
bound[].createdAtbodyintegerCreatedAt is when the host was claimed, as Unix seconds — not when it went live.
bound[].detailbodystringDetail is what is holding the claim up, in words a person can act on.
bound[].hostbodystringHost is the custom hostname claimed for this site.
bound[].recordsbodyRecord[]Records are EXACTLY the DNS records to publish to prove ownership and route the host.
bound[].records[].namebodystringthe record name the customer creates
bound[].records[].typebodystringTXT | CNAME
bound[].records[].valuebodystringthe record value
bound[].statusbodystringStatus is live when the edge answers for this host now, pending while the claim is waiting on DNS proof of ownership.
bound[].urlbodystringURL is where the host will serve once it is live — present on a pending claim too, so a console can show the destination before it works.
bound[].verifiedbodybooleanVerified is the same fact as a boolean, for a caller that only needs the yes or no.
domainsbodystring[]Domains are the hostnames that are VERIFIED and routing right now, after this bind.
orgbodystringOrg is the organisation that owns the site.
slugbodystringSlug is the site the hosts were bound to.

Failure carries the platform error shape — see Errors.

Examples

hanzo projects domains create <slug>

Projects API · All Hanzo APIs · Interactive reference

How is this guide?

On this page