Domains API
Price, check, register, renew, and manage DNS for domains you resell.
Domain endpoints live under /v1/developer/domains and need an API key from an active reseller account, sent as X-API-Key. Prices are in USD cents, already at your reseller rate, and are debited from your wallet.
List extensions and prices
GET /tlds returns each extension with its register and renew price per year. Filter with q and paginate with page and pageSize (max 200).
curl "https://api.msgera.io/v1/developer/domains/tlds?q=com" \
-H "X-API-Key: $MSGERA_KEY"Check availability
POST /check quotes a single domain. When purchasable is false the extension cannot be sold right now and both prices are null.
curl -X POST https://api.msgera.io/v1/developer/domains/check \
-H "X-API-Key: $MSGERA_KEY" \
-H "Content-Type: application/json" \
-d '{"domain":"example.com"}'Register a domain
POST /register charges priceCents × years from your wallet and waits for the registrar to confirm, which can take up to about 30 seconds. If the registrar fails, the charge is refunded and the request returns an error.
| Field | Type | Description |
|---|---|---|
domainrequired | string | Domain to register, e.g. example.com. |
yearsrequired | integer | Registration term, 1-10. |
contactrequired | object | Registrant contact. See the fields below. |
privacy | boolean | WHOIS privacy. Defaults to true. |
idempotencyKey | uuid | Reuse the same key when retrying so the wallet is never charged twice. |
| Field | Type | Description |
|---|---|---|
firstNamerequired | string | 1-80 characters. |
lastNamerequired | string | 1-80 characters. |
organization | string | 1-120 characters. |
address1required | string | 1-120 characters. |
address2 | string | 1-120 characters. |
cityrequired | string | 1-80 characters. |
state | string | 1-80 characters. |
postalCoderequired | string | 1-20 characters. |
countryrequired | string | ISO 3166-1 alpha-2, uppercase, e.g. US. |
emailrequired | string | Registrant email address. |
phonerequired | string | E.164, e.g. +14155550123. |
curl -X POST https://api.msgera.io/v1/developer/domains/register \
-H "X-API-Key: $MSGERA_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "example.com",
"years": 1,
"privacy": true,
"idempotencyKey": "7f9c2b1e-4d3a-4c8b-9e2f-1a5b6c7d8e9f",
"contact": {
"firstName": "Jane",
"lastName": "Doe",
"organization": "Acme Inc",
"address1": "1 Market St",
"city": "San Francisco",
"state": "CA",
"postalCode": "94105",
"country": "US",
"email": "[email protected]",
"phone": "+14155550123"
}
}'Renew a domain
POST /:name/renew extends the expiry by years (default 1) and charges the renew price for each year. Pass an idempotencyKey to make retries safe.
curl -X POST https://api.msgera.io/v1/developer/domains/example.com/renew \
-H "X-API-Key: $MSGERA_KEY" \
-H "Content-Type: application/json" \
-d '{"years":2,"idempotencyKey":"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"}'List domains
GET / returns every domain on your account, newest first. status is one of PENDING, ACTIVE, FAILED or EXPIRED; nameserverMode is MSGERA or CUSTOM.
curl https://api.msgera.io/v1/developer/domains \
-H "X-API-Key: $MSGERA_KEY"Get a domain
GET /:name returns one domain, or 404 DOMAIN_NOT_FOUND if it is not on your account.
curl https://api.msgera.io/v1/developer/domains/example.com \
-H "X-API-Key: $MSGERA_KEY"Manage DNS
DNS can be read and edited while the domain uses Msgera nameservers. Records in the product group are maintained by Msgera for connected services such as mailboxes and cannot be changed.
List records
curl https://api.msgera.io/v1/developer/domains/example.com/dns \
-H "X-API-Key: $MSGERA_KEY"Save records
PUT /:name/dnswrites 1-500 records and returns the domain's full record list. Records that conflict with the ones you send are overwritten; records you leave out are kept.
| Field | Type | Description |
|---|---|---|
typerequired | string | A, AAAA, CNAME, MX, TXT, SRV, CAA or NS. |
namerequired | string | Host name, @ for the apex. |
value | string | Record value. Every record needs value or address. |
address | string | IP address for A and AAAA records. |
ttl | integer | 60-86400 seconds. Defaults to 3600. |
preference | integer | MX priority. Defaults to 0. |
service, protocol, port, weight, target | SRV fields | Used for SRV records. |
curl -X PUT https://api.msgera.io/v1/developer/domains/example.com/dns \
-H "X-API-Key: $MSGERA_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{ "type": "A", "name": "@", "address": "203.0.113.10", "ttl": 3600 },
{ "type": "CNAME", "name": "www", "value": "example.com" },
{ "type": "TXT", "name": "@", "value": "v=spf1 include:_spf.example.net ~all" }
]
}'Errors
INSUFFICIENT_FUNDS, DOMAIN_UNAVAILABLE, DOMAIN_PRICE_UNAVAILABLE and the rest. Full schemas are in the API reference.