Create register

Buys a domain for your org and answers the ownership record together with the quote it was bought at.

POST /v1/domain/register

Addresshttps://api.hanzo.ai/v1/domain/register
MethodPOST
Operationpost_domain_register
AuthAuthorization: Bearer $HANZO_API_KEY

Buys a domain for your org and answers the ownership record together with the quote it was bought at.

The order of operations is the product guarantee: quote, refuse anything unpurchasable or unpriced, AUTHORIZE the org's prepaid balance, provision the authoritative zone in Hanzo DNS, register at the registrar already pointing at Hanzo's nameservers, and only then CAPTURE the charge and record ownership. A registrar failure therefore leaves the balance untouched — the org is never billed for a domain it did not get.

It requires a validated principal; that principal's org owns the domain and is the ledger the charge lands on. Re-buying a name the org already holds is 409, not a second purchase.

Refusals are distinct on purpose: 402 when the prepaid balance cannot cover the quoted price, 409 when the name is not available, 503 when the deployment has no registrar credentials, and the registrar's own message with its own 4xx — or 502 for its 5xx — when it rejects the purchase. Zone provisioning is best-effort: if the zone service is down the domain is still registered against Hanzo's nameservers and the zone reconciles afterwards, rather than the purchase failing.

Request

55 fields, body application/json (required).

FieldInTypeRequiredDescription
contactsbodydomain.Contacts—
contacts.adminbodydomain.Registrant—
contacts.admin.address1bodystring—street address
contacts.admin.address2bodystring—second address line
contacts.admin.citybodystring—city or locality
contacts.admin.companyNamebodystring—the organisation the contact acts for
contacts.admin.countrybodystring—ISO-3166 alpha-2, e.g. "US"
contacts.admin.emailbodystring—where WHOIS correspondence is sent
contacts.admin.faxbodystring—fax number, in the same form as phone
contacts.admin.firstNamebodystring—the contact's given name
contacts.admin.lastNamebodystring—the contact's family name
contacts.admin.phonebodystring—+NN.NNNNNNN
contacts.admin.statebodystring—state, province or region
contacts.admin.zipbodystring—postal code
contacts.billingbodydomain.Registrant—
contacts.billing.address1bodystring—street address
contacts.billing.address2bodystring—second address line
contacts.billing.citybodystring—city or locality
contacts.billing.companyNamebodystring—the organisation the contact acts for
contacts.billing.countrybodystring—ISO-3166 alpha-2, e.g. "US"
contacts.billing.emailbodystring—where WHOIS correspondence is sent
contacts.billing.faxbodystring—fax number, in the same form as phone
contacts.billing.firstNamebodystring—the contact's given name
contacts.billing.lastNamebodystring—the contact's family name
contacts.billing.phonebodystring—+NN.NNNNNNN
contacts.billing.statebodystring—state, province or region
contacts.billing.zipbodystring—postal code
contacts.registrantbodydomain.Registrant—
contacts.registrant.address1bodystring—street address
contacts.registrant.address2bodystring—second address line
contacts.registrant.citybodystring—city or locality
contacts.registrant.companyNamebodystring—the organisation the contact acts for
contacts.registrant.countrybodystring—ISO-3166 alpha-2, e.g. "US"
contacts.registrant.emailbodystring—where WHOIS correspondence is sent
contacts.registrant.faxbodystring—fax number, in the same form as phone
contacts.registrant.firstNamebodystring—the contact's given name
contacts.registrant.lastNamebodystring—the contact's family name
contacts.registrant.phonebodystring—+NN.NNNNNNN
contacts.registrant.statebodystring—state, province or region
contacts.registrant.zipbodystring—postal code
contacts.techbodydomain.Registrant—
contacts.tech.address1bodystring—street address
contacts.tech.address2bodystring—second address line
contacts.tech.citybodystring—city or locality
contacts.tech.companyNamebodystring—the organisation the contact acts for
contacts.tech.countrybodystring—ISO-3166 alpha-2, e.g. "US"
contacts.tech.emailbodystring—where WHOIS correspondence is sent
contacts.tech.faxbodystring—fax number, in the same form as phone
contacts.tech.firstNamebodystring—the contact's given name
contacts.tech.lastNamebodystring—the contact's family name
contacts.tech.phonebodystring—+NN.NNNNNNN
contacts.tech.statebodystring—state, province or region
contacts.tech.zipbodystring—postal code
domainbodystringyesDomain is the name to buy.
yearsbodyinteger (int64)—Years is the term to buy, defaulting to 1.

Response

StatusBodyMeaning
200domain.RegisterResultok
defaultproblem-detailsrefused

200 body — 17 fields.

FieldInTypeAlwaysDescription
quotebodydomain.Offer—
quote.availablebodyboolean—whether it can be bought right now
quote.currencybodystring—the currency both prices are in
quote.domainbodystring—the name this quote prices
quote.premiumbodyboolean—whether the registry prices it above the standard rate
quote.priceCentsbodyinteger (int64)—sell (first-term registration)
quote.renewalPriceCentsbodyinteger (int64)—sell (renewal)
quote.tldbodystring—the top-level domain the name sits under
recordbodydomain.Holding—
record.costCentsbodyinteger (int64)—wholesale cost
record.domainbodystring—the name owned
record.expiresAtbodystring—when the registration lapses, RFC3339
record.nameserversbodystring[]—the authoritative nameservers the name points at
record.orderbodyinteger (int64)—registrar order id
record.orgbodystring—the org that owns the domain
record.priceCentsbodyinteger (int64)—what the customer paid (sell)
record.registeredAtbodyinteger (int64)—unix seconds

Failure carries the platform error shape — see Errors.

Examples

hanzo domain register --domain <domain>
import { Configuration, DomainApi } from 'hanzoai';

const api = new DomainApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postDomainRegister({ domain: "<domain>" });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import DomainApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = DomainApi(client).post_domain_register(domain="<domain>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.DomainAPI.PostDomainRegister(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, domain_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = domain_api::post_domain_register(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.DomainApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new DomainApi(client).postDomainRegister();
curl -X POST https://api.hanzo.ai/v1/domain/register \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "domain": "<domain>"
     }'

MCP reaches domain through the domain tool, which names its 7 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "get_domain_availability"
         }
       }
     }'

Domain API · All Hanzo APIs · Interactive reference

Was this page useful?