my-domain-api

$npx mdskill add myapihq/myapi/my-domain-api

Register and manage custom domains with DNS, CDN, and security settings.

  • Register new domains or import existing ones for funnels and containers.
  • Depends on ICANN WHOIS data and credit deduction for registration.
  • Checks domain availability, assigns to org, and monitors DNS propagation.
  • Returns domain status and enables SSL, CDN, and security configuration.

SKILL.md

.github/skills/my-domain-apiView on GitHub ↗
---
name: my-domain-api
version: 1.0.0
description: >
  Register new domains and manage edge settings. Required before a funnel can go live on a custom URL.
triggers: [domain, register domain, dns, custom domain, edge, cdn, security level, browser check, renew, namecheap]
checksum: sha256-pending
---

# MyDomainAPI

Handles domain registration, assignment to orgs, and edge (CDN/security) settings. DNS is fully managed — you never touch nameservers manually.

## Capabilities
<!-- llm:start -->
Domains are how you take a funnel from `your-org.makeautonomous.com` to `your-real-brand.com`. The flow is: check availability, register (deducts credits), assign to an org, watch status until DNS propagates. From that point, your org's funnel serves at `https://yourdomain.com`. SSL provisions automatically a few minutes after status flips to `active`.

A registered domain isn't only for funnels: a **deployed container** can be served on a custom domain or subdomain too — bind it with `myapi container domain <id> <domain>` (see `my-container-api`). Funnels are static sites; containers are dynamic apps. Either way, the parent domain must be registered here first.

You can also import existing domains (without re-registering) and tune CDN/security settings per-domain.

Without a domain, funnels still work on the free `*.makeautonomous.com` preview subdomain.

### Registrant (ICANN requirement)

Every `myapi domain register` call needs WHOIS contact info — name, email, phone, address, country code (ISO alpha-2). State is required for US/CA registrants.

The CLI stores this locally so you only enter it once:

```bash
# One-time interactive setup (human)
myapi account registrant set

# Or non-interactive (agent)
myapi account registrant set --registrant-json '{
  "name":"Simon Janin", "email":"[email protected]", "phone":"+33612345678",
  "street":"1 rue de la Paix", "city":"Paris",
  "postal_code":"75001", "country_code":"FR"
}'
```

Resolution at register time (highest wins): `--registrant-json` → per-field flags (`--registrant-name`, …) → stored config → interactive TTY prompt → error. Stored contact info is never sent to the backend except as a per-request field on register.
<!-- llm:end -->

## Commands
<!-- generated:start -->
| Command | What it does |
|---|---|
| `myapi domain check <domain>` | Check availability and yearly price |
| `myapi domain register <domain> [--years N] <registrant flags>` | Register a new domain (deducts credits). Requires ICANN WHOIS contact info — store once with `myapi account registrant set`, or pass per-call via `--registrant-json` / `--registrant-*` flags |
| `myapi domain renew <domain> [--yes]` | Renew a registered domain for another period. Charges the org balance; asks for confirmation — pass `--yes` in non-interactive runs |
| `myapi domain list [--filter all\|unassigned\|org]` | List domains in your account |
| `myapi domain assign <domain> --org <id>` | Assign domain to an org. **Also the reassign path** — re-running moves a domain already assigned elsewhere. Pre-flight with `myapi domain list --filter all` and always pass `--org` explicitly |
| `myapi domain unassign <domain>` | Remove domain from its org |
| `myapi domain import <domain>` | Bring-your-own-domain. Snapshots current DNS, returns nameservers to set at your existing registrar — no registrar credentials needed |
| `myapi domain status <domain> [--watch]` | Registration + DNS propagation status. `--watch` polls until terminal (10s × 30 → 30s × 60) |
| `myapi domain settings <domain>` | View edge/CDN settings |
| `myapi domain update-settings <domain>` | Change security level, browser check, purge cache |
| `myapi domain records list <domain> [--type T]` | List DNS records in the zone |
| `myapi domain records get <domain> <id>` | Fetch one record |
| `myapi domain records create <domain> --type T --name n --content c` | Create a record (priority required for MX) |
| `myapi domain records update <domain> <id> [--content c] [...]` | Update a record (type cannot change) |
| `myapi domain records delete <domain> <id> --yes` | Delete a record |
| `myapi domain email-setup <domain> [--subdomain <label>]` | Opt in to MyAPI-managed email on a subdomain (default: `mail.<domain>`). Apex is never touched |
| `myapi domain retry-provisioning <domain>` | Re-run provisioning when status=infra_error and error_detail.retryable=true |
<!-- generated:end -->

## Examples
<!-- llm:start -->
```bash
# One-time: store your WHOIS contact info (used by every register call)
myapi account registrant set

# Register and bring online
myapi domain check example.com
myapi domain register example.com
myapi domain assign example.com --org <org_id>   # explicit --org: assign also reassigns
myapi domain status example.com   # poll until status = active

# Renew before expiry (charges the org balance; --yes for non-interactive runs)
myapi domain renew example.com --yes

# Tune the edge for AI bot traffic
myapi domain update-settings example.com \
  --security=essentially_off --browser-check=off --purge-cache

# Bring an existing domain — works with any registrar (Namecheap, GoDaddy, CF Registrar, etc.)
myapi domain import example.com
# → Returns nameservers; set them at your current registrar.
myapi domain status example.com --watch
# → Polls until active. Backend live-checks Cloudflare each poll.

# Fix a record after import (e.g. clean up SPF)
myapi domain records list example.com --type TXT
myapi domain records delete example.com <bad-id> --yes
myapi domain records create example.com --type TXT --name @ \
  --content 'v=spf1 include:_spf.google.com ~all'

# Opt in to MyAPI email on a subdomain (apex Google Workspace stays untouched)
myapi domain email-setup example.com                # → mail.example.com
myapi domain email-setup example.com --subdomain=notifications

# Recover from infra_error
myapi domain status example.com                     # CLI prints the retry hint
myapi domain retry-provisioning example.com
```

Security levels: `essentially_off` · `low` · `medium` · `high` · `under_attack`.

Set `essentially_off` + `browser-check=off` to allow AI crawlers and training bots through without challenge pages.
<!-- llm:end -->

## Notes

- `register`, `renew`, `assign`, and `unassign` always require an explicit domain argument — they don't fall back to a stored default, to prevent accidental destructive actions.
- All commands default to `--org` from your saved config (set with `myapi config set-org <id>`).
- `402 INSUFFICIENT_FUNDS` = empty wallet → `myapi billing topup <amount>` (or keep it funded automatically: `myapi billing auto-recharge set`). `402 SPEND_CAP_EXCEEDED` = you hit your account spend ceiling → raise it with `myapi billing spend-cap`.

Run `myapi domain --help` or `myapi domain <subcommand> --help` for full flag reference.

More from myapihq/myapi