Authentication

All authenticated endpoints require a Bearer token in the Authorization header.

curl https://dev.domani.run/api/domains/search?q=example.com \
  -H "Authorization: Bearer domani_sk_xxx"

Get an API key by creating an account or from the dashboard. Some endpoints (search, TLDs, WHOIS) are public but have lower rate limits without auth.

Errors

All errors return a consistent JSON envelope. Use code for programmatic handling and hint for recovery guidance.

{
  "error": "Missing API key",
  "code": "MISSING_API_KEY",
  "hint": "Include 'Authorization: Bearer domani_sk_xxx' header",
  "documentation_url": "https://dev.domani.run/llms.txt"
}
CodeHTTP
MISSING_API_KEY401
INVALID_API_KEY401
MISSING_PARAMETER400
INVALID_DOMAIN400
PAYMENT_REQUIRED402
DOMAIN_UNAVAILABLE409
RATE_LIMIT_EXCEEDED429
USER_EXISTS409
NOT_FOUND404
UNKNOWN_PROVIDER400
UNKNOWN_METHOD400
TARGET_REQUIRED400
INVALID_PARAMETER400
CONTACT_REQUIRED400
INVALID_CONTACT400

Rate Limits

Every response includes rate limit headers:

  • X-RateLimit-Limit — max requests per window
  • X-RateLimit-Remaining — requests left
  • X-RateLimit-Reset — unix timestamp when window resets

When rate limited (HTTP 429), check the Retry-After header for seconds to wait.

Authentication

POST/api/auth/registerPublic

Create a new account

Creates a new user account and returns an API key. Use this key as a Bearer token for all authenticated endpoints. Each account also receives a unique referral code. Pass a ref code to permanently link the new user to a referrer - the referrer earns a commission on all future domain purchases by this user.

Request body

email*string (email)
refstringReferral code - permanently links this user to the referrer. The referrer earns a commission on every domain purchase.

Response 201

api_keystringYour API key - save this securely
referral_codestringYour unique referral code for earning commissions
has_payment_methodbooleanWhether the user has a card on file (always false for new accounts)
userobject

Example response

{
  "api_key": "domani_sk_a1B2c3D4e5F6g7H8i9J0kLmN",
  "referral_code": "x7k9m2",
  "has_payment_method": false,
  "user": {
    "id": "cm5abc123",
    "email": "dev@example.com"
  }
}

Example

curl -X POST https://dev.domani.run/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email": "dev@example.com"}'
POST/api/auth/loginPublic

Send a magic link sign-in email

Sends a sign-in link to the provided email. If the user doesn't exist, creates an account first. The magic link redirects to the dashboard with auth credentials. For programmatic API access, use POST /api/auth/register to get an API key directly.

Request body

email*string (email)

Response 200

okboolean
messagestring

Example response

{
  "ok": true,
  "message": "Check your email for a sign-in link."
}

Example

curl -X POST https://dev.domani.run/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "dev@example.com"}'

Account

GET/api/me

Get current account details

Returns the authenticated user's account information including email, payment status, contact info status, referral code, and usage counts. Agents should call this after authentication to check has_payment_method and has_contact before attempting purchases.

Response 200

idstring
emailstring (email)
has_payment_methodbooleanWhether the user has a card on file (required before buying domains)
has_contactbooleanWhether the user has set WHOIS contact info (required before purchasing domains)
contactRegistrantContactRegistrant contact info (null if not set)
referral_codestringYour unique referral code
referral_rateintegerCommission percentage on referred purchases
domain_countintegerNumber of domains owned
token_countintegerNumber of active API tokens
created_atstring (date-time)

Example response

{
  "id": "cm5abc123",
  "email": "dev@example.com",
  "has_payment_method": true,
  "has_contact": true,
  "referral_code": "x7k9m2",
  "referral_rate": 20,
  "domain_count": 3,
  "token_count": 2,
  "created_at": "2025-01-15T10:30:00.000Z"
}

Example

curl https://dev.domani.run/api/me \
  -H "Authorization: Bearer domani_sk_xxx"
GET/api/me/contact

Get registrant contact info

Returns the authenticated user's WHOIS registrant contact information. Must be set before purchasing or transferring domains.

Response 200

has_contactboolean
contactRegistrantContact

Example response

{
  "has_contact": true,
  "contact": {
    "first_name": "Jane",
    "last_name": "Doe",
    "address1": "123 Main St",
    "city": "New York",
    "state": "NY",
    "postal_code": "10001",
    "country": "US",
    "phone": "+1.2125551234",
    "email": "jane@example.com"
  }
}

Example

curl https://dev.domani.run/api/me/contact \
  -H "Authorization: Bearer domani_sk_xxx"
PUT/api/me/contact

Set registrant contact info

Set or update your WHOIS registrant contact information. Required by ICANN before purchasing domains. Used as the domain registrant and billing contact. When updated, the new contact is automatically propagated to all active domains at registrars that support contact updates.

Response 200

contactRegistrantContact

Example

curl -X PUT https://dev.domani.run/api/me/contact \
  -H "Authorization: Bearer domani_sk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"first_name":"Jane","last_name":"Doe","address1":"123 Main St","city":"New York","state":"NY","postal_code":"10001","country":"US","phone":"+1.2125551234","email":"jane@example.com"}'

TLDs

GET/api/tldsPublic

List all available TLDs with pricing

Returns all 898+ available TLDs with registration, renewal, and transfer pricing. Supports filtering by price range, searching by TLD name, sorting, and pagination via limit/offset. When paginated, includes a Link header with the next page URL. Public endpoint - no authentication required. Authenticated requests get higher rate limits (60/min vs 30/min).

Parameters

max_pricenumberMaximum registration price in USD
min_pricenumberMinimum registration price in USD
sortstring(tld | price | renewal)Sort field - 'tld' (alphabetical), 'price' (registration), or 'renewal'
orderstring(asc | desc)Sort order
searchstringFilter TLD names containing this string
limitintegerMax results per page
offsetintegerNumber of results to skip

Response 200

tldsTldInfo[]
totalintegerTotal matching TLDs (before pagination)
offsetinteger
limitinteger | null

Example response

{
  "tlds": [
    {
      "tld": "xyz",
      "registration": 4.04,
      "renewal": 4.04,
      "transfer": 4.04
    },
    {
      "tld": "com",
      "registration": 10.88,
      "renewal": 13.08,
      "transfer": 13.08
    },
    {
      "tld": "dev",
      "registration": 15.85,
      "renewal": 15.85,
      "transfer": 15.85
    }
  ],
  "total": 898,
  "offset": 0,
  "limit": null
}

Example

curl https://dev.domani.run/api/tlds?max_price=10&sort=price

Domains

GET/api/domains

List all your registered domains

Returns all domains owned by the authenticated user, ordered by purchase date (newest first). Includes domain name, status, purchase date, and expiration date.

Response 200

domainsDomainRecord[]

Example response

{
  "domains": [
    {
      "domain": "mysite.com",
      "status": "active",
      "purchasedAt": "2025-01-15T10:30:00.000Z",
      "expiresAt": "2026-01-15T10:30:00.000Z"
    },
    {
      "domain": "myapp.dev",
      "status": "active",
      "purchasedAt": "2025-02-01T14:00:00.000Z",
      "expiresAt": "2026-02-01T14:00:00.000Z"
    }
  ]
}

Example

curl https://dev.domani.run/api/domains \
  -H "Authorization: Bearer domani_sk_xxx"
POST/api/domains/buy

Purchase one or more domains

Purchases one or more domains and registers them immediately. Send {"domain": "..."} for single or {"domains": ["...", "..."]} for bulk (max 10). Bulk purchases process each domain independently - failures don't block other purchases. The response includes results (succeeded), errors (failed), and summary with counts. Accepts three payment methods: 1. Card (default): Requires a card on file via POST /api/billing/setup. Charged per domain. 2. USDC (two-step): First call without payment to get a 402 with payment_options.crypto (wallet address, amount, chains). Send USDC on-chain, then retry with payment_tx and payment_chain in the request body. 3. x402 USDC (atomic): Include a PAYMENT-SIGNATURE header with a signed USDC payment on Base. Bulk purchases require a card on file (USDC not supported for multi-domain). If no payment is provided for single domain, returns HTTP 402 with payment instructions.

Request body

domainstringSingle domain to purchase (e.g. mysite.com)
domainsstring[]Array of domains to purchase (max 10, requires card on file)
payment_methodstring(card | usdc)Payment method: 'card' (default) or 'usdc'. When 'usdc', first call returns 402 with payment instructions.
payment_txstringTransaction hash of a USDC payment already sent on-chain. Required on the second call of the two-step USDC flow.
payment_chainstring(base | ethereum)Chain the USDC payment was sent on (e.g. 'base' or 'ethereum').
yearsintegerNumber of years to register (1-10, default 1). Price is multiplied by years.
refstringReferral code (optional) - the referrer earns a commission

Response 201

domainstring
statusstring
expiresstring (date-time)
pricenumber
currencystring
yearsintegerNumber of years registered
payment_methodstringHow the domain was paid for
payment_txstringOn-chain transaction hash (present for USDC payments)

Example response

{
  "domain": "mysite.com",
  "status": "active",
  "expires": "2026-02-18T00:00:00.000Z",
  "price": 10.88,
  "currency": "USD",
  "years": 1,
  "payment_method": "card"
}

Example

curl -X POST https://dev.domani.run/api/domains/buy \
  -H "Authorization: Bearer domani_sk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"domain": "mysite.com"}'
GET/api/domains/{domain}

Get detailed information about a domain you own

Returns comprehensive information about a domain: status, purchase date, expiry, payment method, security lock, WHOIS privacy, auto-renew status, and registration dates. The registrar object may be null if extended data is unavailable.

Parameters

domain*stringDomain name you own

Response 200

domainstring
statusstring
auto_renewbooleanWhether auto-renew is enabled
purchased_atstring (date-time)
expires_atstring (date-time)
days_until_expiryintegerDays until domain expiry
payment_methodstringHow the domain was paid for
payment_txstring | nullOn-chain tx hash (USDC payments)
registrarobject | nullDomain registration details (null if unavailable)

Example response

{
  "domain": "mysite.com",
  "status": "active",
  "auto_renew": true,
  "purchased_at": "2025-06-01T12:00:00.000Z",
  "expires_at": "2026-06-01T12:00:00.000Z",
  "days_until_expiry": 365,
  "payment_method": "card",
  "registrar": {
    "security_lock": true,
    "whois_privacy": true,
    "auto_renew": true,
    "create_date": "2025-06-01T12:00:00Z",
    "expire_date": "2026-06-01T12:00:00Z"
  }
}

Example

curl https://dev.domani.run/api/domains/mysite.com \
  -H "Authorization: Bearer domani_sk_xxx"
PUT/api/domains/{domain}/settings

Update domain settings

Update settings for a domain you own. Supports auto_renew, whois_privacy, and security_lock. At least one field must be provided.

Parameters

domain*stringDomain name you own

Request body

auto_renewbooleanWhether to enable auto-renew for this domain
whois_privacybooleanWhether to enable WHOIS privacy protection
security_lockbooleanWhether to lock the domain against transfers

Response 200

domainstring
auto_renewboolean
whois_privacyboolean
security_lockboolean
hintstring

Example

curl -X PUT https://dev.domani.run/api/domains/mysite.com/settings \
  -H "Authorization: Bearer domani_sk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"auto_renew": false}'
PUT/api/domains/{domain}/parking

Update parking settings

Update parking and listing settings for a domain you own. Enable/disable the parking page and set a 'For Sale' listing price. When parking is enabled, visitors to the domain see a branded page. When a listing price is set, visitors see a 'For Sale' page with a contact form.

Parameters

domain*stringDomain name

Request body

enabledbooleanWhether to enable the parking page
listing_pricenumber | nullSale price in USD, or null to remove listing

Response 200

domainstring
parking_enabledboolean
listing_pricenumber | null
hintstring
GET/api/domains/{domain}/analytics

Get parking analytics

Get visitor analytics for a parked domain - page views, inquiries, conversion rate, 30-day daily breakdown, and recent inquiries.

Parameters

domain*stringDomain name

Response 200

domainstring
views_7dintegerTotal page views in the last 7 days
views_30dintegerTotal page views in the last 30 days
inquiries_30dintegerTotal inquiries in the last 30 days
conversion_ratenumberInquiry-to-view ratio as percentage
daily_viewsobject[]Daily view counts for the last 30 days
recent_inquiriesobject[]5 most recent inquiries
hintstring

Example response

{
  "domain": "example.com",
  "views_7d": 42,
  "views_30d": 156,
  "inquiries_30d": 3,
  "conversion_rate": 1.92,
  "daily_views": [
    {
      "date": "2026-02-25",
      "views": 7
    }
  ],
  "recent_inquiries": [
    {
      "email": "buyer@example.com",
      "offer": 500,
      "date": "2026-02-25T10:00:00Z"
    }
  ],
  "hint": "example.com received 156 views and 3 inquiries in the last 30 days (1.92% conversion)."
}
GET/api/domains/{domain}/auth-code

Get EPP auth code

Get the EPP/auth code needed to transfer a domain to another registrar. Automatically unlocks the domain if it's locked.

Parameters

domain*stringDomain name you own

Response 200

domainstring
auth_codestringEPP auth code to give to the new registrar
was_unlockedbooleanWhether the domain was auto-unlocked
hintstring
next_stepsstring[]
GET/api/domains/{domain}/transfer-away

Get outbound transfer status

Check the status of an outbound domain transfer. Use after getting an auth code and initiating the transfer at the new registrar.

Parameters

domain*stringDomain name you own

Response 200

domainstring
statusstring
gaining_registrarstring
request_datestring (date-time)
hintstring
GET/api/domains/{domain}/transfer-status

Check inbound transfer status

Check the status of an inbound domain transfer. Returns detailed status with actionable hints. Use after initiating a transfer with POST /api/domains/transfer.

Parameters

domain*stringDomain name you own

Response 200

domainstring
statusstring
timestampstringTimestamp of last status update
hintstringActionable guidance based on the current status
POST/api/domains/import

Import an external domain

Import a domain you own at another registrar (GoDaddy, Namecheap, Cloudflare, etc.) to manage through domani.run. Free, no transfer needed. Returns a TXT record for DNS-based ownership verification.

Request body

domain*stringDomain to import

Response 200

domainstring
statusstring
tokenstring
txt_recordobject
hintstring
POST/api/domains/import/verify

Verify and complete domain import

Verify DNS TXT record and complete domain import. Call after adding the TXT record returned by POST /api/domains/import. Uses Cloudflare DNS-over-HTTPS to check propagation.

Request body

domain*stringDomain to verify

Response 201

domainstring
statusstring
expiresstring (date-time)
registrarstring
payment_methodstring
hintstring
POST/api/domains/transfer

Transfer domain from another provider

Initiate a domain transfer-in. Requires the authorization/EPP code from the current provider. Transfer typically takes 1-5 days to complete. Payment is charged upfront via card or USDC (two-step: get 402, send USDC, retry with payment_tx + payment_chain).

Request body

domain*stringDomain to transfer, e.g. mysite.com
auth_code*stringAuthorization/EPP code from the current provider
payment_methodstring(card | usdc)Payment method: 'card' (default) or 'usdc'.
payment_txstringTransaction hash of a USDC payment already sent on-chain.
payment_chainstring(base | ethereum)Chain the USDC payment was sent on.

Response 202

domainstring
statusstring
expiresstring (date-time)
pricenumber
currencystring
payment_methodstring
payment_txstring
hintstring

Example

curl -X POST https://dev.domani.run/api/domains/transfer \
  -H "Authorization: Bearer domani_sk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"domain": "mysite.com", "auth_code": "EPP-AUTH-CODE"}'
POST/api/domains/{domain}/renew

Renew a domain

Renew a domain you own for additional years (1-10). Payment is charged upfront. The new expiry date is returned in the response.

Parameters

domain*stringDomain name you own

Request body

yearsintegerNumber of years to renew (default 1)
payment_methodstring(card | usdc)Payment method: 'card' (default) or 'usdc'.
payment_txstringTransaction hash of a USDC payment already sent on-chain.
payment_chainstring(base | ethereum)Chain the USDC payment was sent on.

Response 200

domainstring
renewed_yearsinteger
new_expirystring (date-time)
pricenumber
currencystring
payment_methodstring
payment_txstring

Example

curl -X POST https://dev.domani.run/api/domains/mysite.com/renew \
  -H "Authorization: Bearer domani_sk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"years": 1}'

DNS

GET/api/domains/{domain}/dns

Get DNS records for a domain you own

Returns all DNS records configured for a domain you own. Includes A, AAAA, CNAME, MX, TXT, NS, and other record types.

Parameters

domain*stringDomain name you own

Response 200

domainstring
recordsDnsRecord[]

Example response

{
  "domain": "mysite.com",
  "records": [
    {
      "type": "A",
      "name": "@",
      "value": "76.76.21.21",
      "ttl": 3600
    },
    {
      "type": "CNAME",
      "name": "www",
      "value": "mysite.com",
      "ttl": 3600
    },
    {
      "type": "MX",
      "name": "@",
      "value": "mail.example.com",
      "ttl": 3600,
      "priority": 10
    }
  ]
}

Example

curl https://dev.domani.run/api/domains/mysite.com/dns \
  -H "Authorization: Bearer domani_sk_xxx"
PUT/api/domains/{domain}/dns

Set DNS records for a domain you own

Replaces all DNS records for a domain you own. Send the complete set of records - any existing records not included will be removed.

Parameters

domain*stringDomain name you own

Request body

records*DnsRecord[]

Response 200

successboolean
domainstring
recordsDnsRecord[]

Example response

{
  "success": true,
  "domain": "mysite.com",
  "records": [
    {
      "type": "A",
      "name": "@",
      "value": "76.76.21.21",
      "ttl": 3600
    },
    {
      "type": "CNAME",
      "name": "www",
      "value": "cname.vercel-dns.com",
      "ttl": 3600
    }
  ]
}

Example

curl -X PUT https://dev.domani.run/api/domains/mysite.com/dns \
  -H "Authorization: Bearer domani_sk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"records": [
    {"type": "A", "name": "@", "value": "76.76.21.21", "ttl": 3600},
    {"type": "CNAME", "name": "www", "value": "cname.vercel-dns.com", "ttl": 3600}
  ]}'

Connect

POST/api/domains/{domain}/connect

Connect a domain to a hosting or email provider

Connects a domain to a hosting or email provider by auto-detecting the provider from a target URL or accepting an explicit provider name. For domains managed through the platform, DNS records are set automatically (status: dns_set). For imported domains (external registrar), returns the records as instructions to add manually at your registrar (status: manual_setup_required, records have status pending). Supported hosting providers: vercel, netlify, cloudflare-pages, github-pages, railway, fly. Supported email providers: google-workspace, fastmail, proton. Use GET /api/domains/{domain}/connect to list all available providers and methods.

Parameters

domain*stringDomain name you own

Request body

targetstringTarget URL for auto-detection (e.g. my-app.vercel.app)
providerstringExplicit provider name (e.g. vercel, google-workspace)
methodstringConnection method if provider has multiple (e.g. cname-only)

Response 200

domainstring
providerstring
categorystring
methodstring
recordsDnsRecord[]
docsstring (uri)
statusstringdns_set = records written automatically. manual_setup_required = imported domain, add records at your registrar.
hintstring
next_stepsstring[]Provider-specific actions to complete after DNS records are set

Example

curl -X POST https://dev.domani.run/api/domains/mysite.com/connect \
  -H "Authorization: Bearer domani_sk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"target": "my-app.vercel.app"}'
GET/api/domains/{domain}/connect

List available providers for connecting a domain

Returns all supported hosting and email providers with their connection methods. Use this to discover what providers are available before calling POST.

Parameters

domain*stringDomain name you own

Response 200

domainstring
providersobject
POST/api/domains/{domain}/verify

Verify that a provider connection is working

Runs the provider's verification check to confirm DNS records have propagated and the connection is active. Use after POST /api/domains/{domain}/connect to verify.

Parameters

domain*stringDomain name you own

Request body

targetstringTarget for auto-detection
providerstringProvider name
methodstringMethod name

Response 200

domainstring
providerstring
methodstring
verifiedboolean
messagestring
hintstring
next_stepsstring[]Provider-specific troubleshooting steps (only when verified is false)

Example

curl -X POST https://dev.domani.run/api/domains/mysite.com/verify \
  -H "Authorization: Bearer domani_sk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"target": "my-app.vercel.app"}'

Status

GET/api/domains/{domain}/status

Check domain health: DNS, SSL, email, expiry

Checks the health of a domain via DNS-over-HTTPS: A/AAAA/CNAME/MX/TXT/NS records, SSL certificate status, email configuration, and expiry date. Supports SSE streaming via Accept: text/event-stream - closing the connection cancels in-flight DNS/SSL checks server-side. Use this after connecting to verify DNS propagation.

Parameters

domain*stringDomain name you own

Response 200

domainstring
statusstring
expiresstring (date-time)
days_until_expiryinteger
dnsobject
sslobject
emailobject

Example response

{
  "domain": "mysite.com",
  "status": "active",
  "expires": "2027-02-18T00:00:00.000Z",
  "days_until_expiry": 365,
  "dns": {
    "propagated": true,
    "a": [
      "76.76.21.21"
    ],
    "aaaa": [],
    "cname": [],
    "mx": [],
    "txt": [],
    "ns": [
      "ns1.porkbun.com",
      "ns2.porkbun.com"
    ],
    "registrar_records": [
      {
        "type": "A",
        "name": "@",
        "value": "76.76.21.21",
        "ttl": 3600
      }
    ]
  },
  "ssl": {
    "active": true
  },
  "email": {
    "configured": false,
    "mx": []
  }
}

Example

curl https://dev.domani.run/api/domains/mysite.com/status \
  -H "Authorization: Bearer domani_sk_xxx"

Email

GET/api/domains/{domain}/email/check

Check email DNS health (MX, SPF, DMARC, DKIM)

Checks email DNS configuration for a domain: MX records, SPF, DMARC, and DKIM. Auto-detects the email provider from MX records (Google Workspace, Proton, Fastmail).

Parameters

domain*stringDomain name you own

Response 200

domainstring
providerstring | nullAuto-detected email provider (google-workspace, proton, fastmail) or null
mxobject
spfobject
dmarcobject
dkimobject

Example response

{
  "domain": "mysite.com",
  "provider": "google-workspace",
  "mx": {
    "configured": true,
    "records": [
      "1 aspmx.l.google.com",
      "5 alt1.aspmx.l.google.com"
    ]
  },
  "spf": {
    "configured": true,
    "value": "v=spf1 include:_spf.google.com ~all"
  },
  "dmarc": {
    "configured": true,
    "value": "v=DMARC1; p=quarantine; rua=mailto:dmarc@mysite.com"
  },
  "dkim": {
    "configured": true,
    "selectors": [
      "google"
    ]
  }
}

Example

curl https://dev.domani.run/api/domains/mysite.com/email/check \
  -H "Authorization: Bearer domani_sk_xxx"

Verify Service

POST/api/domains/{domain}/verify-service

Add DNS records to verify domain ownership for a third-party service

Adds the correct DNS records (TXT, CNAME) to prove domain ownership to a third-party service. Supports Stripe, Google Search Console, AWS SES, Postmark, Resend, Facebook, HubSpot, and Microsoft 365. Unknown service names fall back to a generic TXT record. Records are merged with existing DNS - existing records are preserved.

Parameters

domain*stringDomain name you own

Request body

service*stringService name (e.g. stripe, google-search-console, aws-ses, postmark, resend, facebook, hubspot, microsoft-365)
token*stringVerification token provided by the service

Response 200

domainstring
servicestring
service_display_namestring
known_serviceboolean
records_addedDnsRecord[]
total_recordsinteger
docsstring (uri) | null
hintstring

Example response

{
  "domain": "mysite.com",
  "service": "stripe",
  "service_display_name": "Stripe",
  "known_service": true,
  "records_added": [
    {
      "type": "TXT",
      "name": "@",
      "value": "stripe-verification=abc123def456",
      "ttl": 3600
    }
  ],
  "total_records": 3,
  "docs": "https://docs.stripe.com/identity/verification-checks/selfie#domain-verification",
  "hint": "Stripe verification records added. Return to Stripe to complete verification."
}

Example

curl -X POST https://dev.domani.run/api/domains/mysite.com/verify-service \
  -H "Authorization: Bearer domani_sk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"service": "stripe", "token": "abc123def456"}'
GET/api/domains/{domain}/verify-service

List supported services for domain verification

Returns all known services with their names, descriptions, and documentation URLs. Unknown services fall back to a generic TXT record.

Parameters

domain*stringDomain name you own

Response 200

domainstring
servicesobject[]
hintstring

Discovery

GET/api/domains/whoisPublic

Look up domain registration data via RDAP

Queries the RDAP (Registration Data Access Protocol) network for domain registration data. Returns registrar, creation/expiry/update dates, days until expiry, status codes, nameservers, DNSSEC status, and contact information (registrant, admin, tech, billing, abuse). Works for any domain - no ownership required. RDAP is the modern, JSON-native replacement for WHOIS. Falls back to WHOIS (port 43) for TLDs without RDAP, and supplements RDAP with WHOIS referral data when contacts are missing (common post-GDPR). Contact information may be partially or fully redacted due to GDPR or privacy protection services. Public endpoint - no authentication required. Authenticated requests get higher rate limits (30/min vs 10/min).

Parameters

q*stringDomain to look up (e.g. example.com)

Response 200

domainstring
registeredbooleanWhether the domain is currently registered
registrarstring | nullCurrent registrar name
registrar_urlstring | nullRegistrar website URL
registrar_iana_idstring | nullRegistrar IANA ID (from RDAP publicIds)
createdstring | nullRegistration date (YYYY-MM-DD)
expiresstring | nullExpiration date (YYYY-MM-DD)
updatedstring | nullLast updated date (YYYY-MM-DD)
days_until_expiryinteger | nullDays until expiry (null if not registered)
statusstring[]EPP status codes
nameserversstring[]Authoritative nameservers
dnssecbooleanWhether DNSSEC is enabled
redactedbooleanWhether WHOIS/RDAP data is redacted for privacy (GDPR)
contactsobjectContact information by role (null when no data available, fields may be null when redacted)

Example

curl "https://dev.domani.run/api/domains/whois?q=google.com"
GET/api/domains/{domain}/ogPublic

Get website preview metadata for a domain

Returns Open Graph metadata (title, description, image, favicon) for a domain. Data is lazily fetched and cached for 7 days. First request for a domain may take 1-5s (live fetch); subsequent requests are instant (cache hit). Returns null fields if the site is unreachable or has no OG tags. Public endpoint - no authentication required.

Parameters

domain*stringDomain to fetch metadata for (e.g. google.com)

Response 200

titlestring | nullPage title (og:title > twitter:title > <title>)
descriptionstring | nullPage description (og:description > meta description)
imagestring | nullOG image URL (absolute)
faviconstring | nullFavicon URL (absolute)

Example

curl "https://dev.domani.run/api/domains/google.com/og"

API Tokens

GET/api/tokens

List your API tokens

Returns all API tokens for the authenticated user. Keys are masked for security (first 12 + last 4 characters visible). Use this to audit active tokens.

Response 200

tokensTokenInfo[]

Example response

{
  "tokens": [
    {
      "id": "cm5abc123",
      "name": "Default",
      "key": "domani_sk_a...wxyz",
      "lastUsed": "2025-02-18T10:30:00.000Z",
      "createdAt": "2025-01-15T10:30:00.000Z"
    },
    {
      "id": "cm5def456",
      "name": "CI/CD",
      "key": "domani_sk_b...vwxy",
      "lastUsed": null,
      "createdAt": "2025-02-01T14:00:00.000Z"
    }
  ]
}

Example

curl https://dev.domani.run/api/tokens \
  -H "Authorization: Bearer domani_sk_xxx"
POST/api/tokens

Create a new API token

Creates a new API token. The full key is returned only in this response - store it securely. You can create multiple tokens to separate access for different applications.

Request body

namestringHuman-readable name to identify this token

Response 201

idstring
namestring
keystringFull API key - save this, it won't be shown again
createdAtstring (date-time)

Example response

{
  "id": "cm5ghi789",
  "name": "CI/CD Pipeline",
  "key": "domani_sk_x1Y2z3A4b5C6d7E8f9G0hIjK",
  "createdAt": "2025-02-18T10:30:00.000Z"
}

Example

curl -X POST https://dev.domani.run/api/tokens \
  -H "Authorization: Bearer domani_sk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"name": "CI/CD Pipeline"}'
DELETE/api/tokens/{id}

Revoke an API token

Permanently revokes an API token. Any applications using this token will immediately lose access. This action cannot be undone.

Parameters

id*stringToken ID (from GET /api/tokens response)

Response 200

successboolean

Example response

{
  "success": true
}

Example

curl -X DELETE https://dev.domani.run/api/tokens/cm5abc123 \
  -H "Authorization: Bearer domani_sk_xxx"

Billing

POST/api/billing/setup

Get checkout URL for adding a payment method

Creates a checkout session for adding a credit card. Redirect the user to the returned URL. This is required before purchasing domains. After the user completes checkout, they are redirected back to the dashboard.

Response 200

urlstring (uri)Checkout URL - redirect user here

Example response

{
  "url": "https://checkout.domani.run/session/cs_abc123..."
}

Example

curl -X POST https://dev.domani.run/api/billing/setup \
  -H "Authorization: Bearer domani_sk_xxx"
GET/api/billing/invoices

List payment invoices

Returns a list of paid invoices with invoice number, amount, date, and links to view or download the PDF. Invoices are generated automatically for every domain purchase, renewal, and transfer.

Parameters

limitintegerMax invoices to return

Response 200

invoicesobject[]
has_moreboolean
hintstring

Example

curl https://dev.domani.run/api/billing/invoices \
  -H "Authorization: Bearer domani_sk_xxx"

Referrals

GET/api/referrals

Get referral earnings and history

Returns your unique referral code, commission rate (20%), earnings breakdown (total, paid, pending), and a history of all referred purchases. Share your referral code with others - when they register with your code (via the ref parameter), you earn a commission on all their future domain purchases automatically.

Response 200

referral_codestringYour unique referral code to share
referral_rateintegerCommission percentage (currently 20%)
total_earned_centsintegerTotal earnings in cents
total_paid_centsintegerTotal paid out in cents
total_pending_centsintegerPending payout in cents
referralsobject[]

Example response

{
  "referral_code": "x7k9m2",
  "referral_rate": 20,
  "total_earned_cents": 400,
  "total_paid_cents": 200,
  "total_pending_cents": 200,
  "referrals": [
    {
      "id": "cm5ref001",
      "domains": [
        "friend-site.com"
      ],
      "earned_cents": 200,
      "paid_out": true,
      "created_at": "2025-01-20T10:00:00.000Z"
    },
    {
      "id": "cm5ref002",
      "domains": [
        "another.dev"
      ],
      "earned_cents": 200,
      "paid_out": false,
      "created_at": "2025-02-10T15:30:00.000Z"
    }
  ]
}

Example

curl https://dev.domani.run/api/referrals \
  -H "Authorization: Bearer domani_sk_xxx"

Webhooks

GET/api/webhooks

List webhooks

List all webhook endpoints configured for your account. Returns URL, subscribed events, and active status for each webhook. Secrets are never returned after creation.

Response 200

webhooksobject[]
hintstring

Example response

{
  "webhooks": [
    {
      "id": "cm5wh001",
      "url": "https://example.com/webhooks/domani",
      "events": [
        "domain.purchased",
        "dns.updated"
      ],
      "active": true,
      "created_at": "2026-02-25T10:00:00.000Z"
    }
  ],
  "hint": "1 webhook(s)."
}

Example

curl https://dev.domani.run/api/webhooks \
  -H "Authorization: Bearer domani_sk_xxx"
POST/api/webhooks

Create webhook

Register a new webhook endpoint. The URL must use HTTPS. Choose which event types to subscribe to. The webhook secret is returned only once at creation - save it to verify incoming payloads with HMAC-SHA256. Maximum 5 webhooks per account.

Request body

url*string (uri)HTTPS URL that will receive webhook POST requests
events*string[]Event types to subscribe to. Use GET /api/webhooks/events to list available types.

Response 200

idstring
urlstring (uri)
eventsstring[]
secretstringHMAC-SHA256 signing secret (shown once)
activeboolean
created_atstring (date-time)
hintstring

Example response

{
  "id": "cm5wh001",
  "url": "https://example.com/webhooks/domani",
  "events": [
    "domain.purchased",
    "dns.updated"
  ],
  "secret": "whsec_aBcDeFgHiJkLmNoPqRsTuVwXyZ012345",
  "active": true,
  "created_at": "2026-02-25T10:00:00.000Z",
  "hint": "Webhook created. Save the secret - it won't be shown again. Use it to verify incoming payloads with HMAC-SHA256."
}

Example

curl -X POST https://dev.domani.run/api/webhooks \
  -H "Authorization: Bearer domani_sk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/hook","events":["domain.purchased","dns.updated"]}'
PATCH/api/webhooks/{id}

Update webhook

Update a webhook's URL, subscribed events, or active status. Send only the fields you want to change.

Parameters

id*stringWebhook ID

Request body

urlstring (uri)New HTTPS URL
eventsstring[]New list of event types
activebooleanSet false to pause, true to resume

Response 200

idstring
urlstring (uri)
eventsstring[]
activeboolean
hintstring
DELETE/api/webhooks/{id}

Delete webhook

Delete a webhook endpoint. All pending deliveries will be cancelled. This cannot be undone.

Parameters

id*stringWebhook ID

Response 200

successboolean
hintstring
GET/api/webhooks/{id}/deliveries

List webhook deliveries

Get recent delivery attempts for a webhook. Shows event type, HTTP status, number of attempts, and any errors. Useful for debugging failed deliveries.

Parameters

id*stringWebhook ID
limitintegerMaximum number of deliveries to return

Response 200

deliveriesobject[]
hintstring

Example response

{
  "deliveries": [
    {
      "id": "cm5del001",
      "event_type": "domain.purchased",
      "status": "delivered",
      "http_status": 200,
      "attempts": 1,
      "last_error": null,
      "created_at": "2026-02-25T10:05:00.000Z"
    }
  ],
  "hint": "1 delivery(ies) for this webhook."
}
GET/api/webhooks/events

List webhook event types

List all available webhook event types with descriptions. No authentication required.

Response 200

eventsobject[]

Example response

{
  "events": [
    {
      "type": "domain.purchased",
      "description": "A new domain was successfully registered"
    },
    {
      "type": "dns.updated",
      "description": "DNS records were changed for a domain"
    },
    {
      "type": "transfer.completed",
      "description": "A domain transfer completed successfully"
    }
  ]
}

Example

curl https://dev.domani.run/api/webhooks/events