Domains
Buy, connect and manage domains.
Domains has two methods built for an outside caller. They are the two an AI agent needs to connect an existing domain without ever seeing a nameserver: list what the account already owns, then point one at a project. Everything else the Domains page does (search, buy, DNS records, encryption settings, analytics, transfers) runs from the dashboard.
Connecting a domain you already own
List what you have
agent_domain_list returns how many domains the account holds and, for each one, its name, status, connection type and the project it is attached to, if any. Call this before ever asking someone to type a domain: present the options instead.
Point it at a project
agent_domain_connect takes a domain from that list and an optional subdomain, and attaches it to the project the calling key or session is scoped to. Omit the subdomain to use the apex. Attaching replaces any existing DNS record on that exact hostname. Prefer a subdomain unless the person wants the apex.
Both methods take the account and the project from the key (or from the session the call comes through), not from what the caller writes in the request. Connecting needs a key made from a project: a key with no project can list, but cannot connect.
A refusal comes back with a negative code and a sentence in data, for example when no account or no project is bound to the key, or when the domain is empty.
agent_domain_connect deliberately does not buy a domain, only connects one you already hold. Search and purchase stay behind an explicit confirmation in the Buy a domain window, along with DNS record editing, encryption settings and transfers.
Setting a project's address
To give a project a domain you registered through Xuda from code, use update_domain_setup with domain_setup.type set to registered and domain_setup.registered_domain set to the name. It is a method of the project itself and needs an admin key. The dashboard does the same from Attach to a project.
Earlier guides
Domains in the hosting guide and Connect a domain walk the same job step by step.