Hanzo
OpenapiPlatform

Attaches a hostname — instantly if you already own it, otherwise with a DNS…

Attaches a hostname — instantly if you already own it, otherwise with a DNS challenge.

POST /v1/platform/projects/{project}/apps/{app}/domains

Addresshttps://api.hanzo.ai/v1/platform/projects/{project}/apps/{app}/domains
MethodPOST
Operationpost_platform_projects_by_project_apps_by_app_domains
AuthAuthorization: Bearer $HANZO_API_KEY

Attaches a hostname — instantly if you already own it, otherwise with a DNS challenge.

It attaches host to the app, and which of two things happens depends on who owns the name. A host inside the caller org's own subtree is structurally owned, so it goes ACTIVE immediately and answers 201. A bring-your-own host is claimed as PENDING and answers the DNS challenge records to publish; it is NOT rendered into the app's ingress until /verify passes.

Claims are globally unique. A host already claimed by another organization is 409, and so is one claimed by a different app in your own; re-adding this app's OWN claim is idempotent and answers its current state at 200. The default host is always attached and re-adding it is 409. A host under the platform's shared apex that is not the caller's own subtree is 403 — it belongs to whoever owns that subtree and can never be grabbed through the custom path.

host must be a valid DNS hostname; anything else is 400. Requires a validated principal; 403 without one.

Request

5 fields, body application/json (required).

FieldInTypeRequiredDescription
projectpathstringyesProject is the project the application lives under, from the path.
apppathstringyesApp is the application's slug, from the path.
appbodystringApp is the application's slug, from the path.
hostbodystringHost is the hostname to attach.
projectbodystringProject is the project the application lives under, from the path.

Response

StatusBodyMeaning
200domainViewok
201domainViewcreated

200 body — 12 fields.

FieldInTypeAlwaysDescription
createdAtbodyintegerCreatedAt is the unix second the custom claim was made.
detailbodystringDetail says why a claim is still pending, in the resolver's own words.
hostbodystringHost is the hostname itself.
kindbodystringKind is default, subtree or custom — how the org came to own it.
primarybodybooleanPrimary marks the app's permanent default host.
recordsbodyRecord[]Records are the DNS records to publish while a custom claim is pending.
records[].namebodystringthe record name the customer creates
records[].typebodystringTXT | CNAME
records[].valuebodystringthe record value
statusbodystringStatus is live, provisioning, pending_deploy or pending, derived from the operator CR and never fabricated.
urlbodystringURL is the host as an HTTPS address.
verifiedbodybooleanVerified is whether ownership is settled — always true for a host the org structurally owns.

Failure carries the platform error shape — see Errors.

Examples

hanzo platform projects apps domains create <project> <app>

Platform API · All Hanzo APIs · Interactive reference

How is this guide?

On this page