# MyDomainAPI > Domain registration and DNS infrastructure for developers Base URL: https://api.mydomainapi.com Authentication: `Authorization: Bearer ` Use this service to manage the lifecycle of your domains. You can search for availability, purchase new domains, and configure DNS records. This is a foundational service; many other APIs (like myfunnelapi.com or myemailapi.com) require a domain managed here to function correctly. ## Key Blog Posts - [DNS as Code: Automating Global Infrastructure](https://mydomainapi.com/blog/dns-as-code-automating-global-infrastructure): Why manual DNS management is an operational liability, and how programmatic Anycast routing is the only way to scale modern SaaS platforms. - [Surviving ITP/ETP: Using First-Party Subdomains](https://mydomainapi.com/blog/surviving-itp-etp-first-party-subdomains): A deep technical dive into browser privacy caps and how server-side CNAME cloaking preserves first-party cookie persistence. - [The Registrar Paradox: Programmatic Registration](https://mydomainapi.com/blog/registrar-paradox-programmatic-registration): Why white-labeling domain registration for large-scale SaaS platforms is incredibly difficult, and how programmatic APIs solve the provisioning bottleneck. - [DNSSEC and the Modern Trust Chain](https://mydomainapi.com/blog/dnssec-and-the-modern-trust-chain): Cryptographic proof for domain ownership: Securing the root of the internet against cache poisoning and interception attacks. - [Edge-Routed Blue/Green Deployments](https://mydomainapi.com/blog/edge-routed-blue-green-deployments): Zero-downtime rollouts via Anycast DNS: How to shift massive traffic loads safely without touching application load balancers. ## Agent Onboarding To use this or any other MyAPIHQ service as an autonomous agent, follow these steps: 1. **Register an Agent Account**: Create an agent account. Returns `account_id`, `pin`, and a `token` (JWT) in one call — no email or human required. ```bash curl -X POST https://api.myapihq.com/hq/account/agent/create \ -H "Content-Type: application/json" \ -d '{"label": "my-agent"}' ``` 2. **Create a Permanent API Key**: Use the `token` from step 1 to create a workspace-scoped API key (`hq_live_...`). ```bash curl -X POST https://api.myapihq.com/hq/account/create/key \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"name": "my-agent-key"}' ``` 3. **Authenticate**: All subsequent requests must include: `Authorization: Bearer `. The JWT token from step 1 is valid for account and billing endpoints only. All service calls (orgs, funnels, email, domains) require the API key from step 2. ## Endpoints ### GET /domain/check/{domain} **Check Domain Availability** Check if a domain is available for registration and get current pricing. **Parameters:** - `domain` (path): Full domain name (e.g. example.com) (type: string, Required) **Response (JSON):** ```json { "available": boolean, "domain": string, "price_cents": integer, "currency": string } ``` ### POST /domain/register **Register a Domain** Purchase a domain and automatically provision a managed DNS zone and email infrastructure. **Request Body (JSON):** ```json { "domain": string (Required), "years": integer } ``` **Response (JSON):** ```json { "domain": string, "status": string, "domain_id": string, "nameservers": Array, "expires_at": string, "price_cents": integer, "total_cents": integer } ``` ### GET /domain/list/me **List Domains** List all domains registered to this account with status and expiry. **Response (JSON):** ```json Array<{ "domain": string, "status": string, "expires_at": string, "days_until_expiry": integer, "email_infra_ready": boolean }> ``` ### GET /domain/status/{domain} **Get Domain Status** Check the provisioning status and completed infrastructure setup steps for a domain. **Parameters:** - `domain` (path): (type: string, Required) **Response (JSON):** ```json { "domain": string, "status": string (provisioning|active|infra_error), "email_infra_ready": boolean, "steps_completed": Array } ``` ### POST /domain/renew/{domain} **Renew a Domain** Renew a domain registration for 1 or more years. **Parameters:** - `domain` (path): (type: string, Required) **Request Body (JSON):** ```json { "years": integer } ``` **Response (JSON):** ```json { "domain": string, "expires_at": string, "years": integer, "price_cents": integer, "total_cents": integer } ``` ### POST /hq/billing/setup-payment **Setup Payment Method** Generates a Stripe Checkout Session URL to save a card. The user must visit this URL, enter their card, and complete the setup. A webhook will automatically save the card to the account. **Response (JSON):** ```json { "success": boolean, "data": { "url": string }, "error": string, "meta": object } ``` ## Pricing Domains at cost + 10% platform fee. No hidden markups. --- ## Ecosystem Integration This service is part of the MyAPIHQ ecosystem. You authenticate using an API Key generated from your MyAPIHQ account. To view the full list of available services (like domain registration, funnel building, transactional email, object storage, etc.), fetch [https://myapihq.com/llms.txt](https://myapihq.com/llms.txt).