sgeraDocs
Reseller

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.

FieldTypeDescription
domainrequiredstringDomain to register, e.g. example.com.
yearsrequiredintegerRegistration term, 1-10.
contactrequiredobjectRegistrant contact. See the fields below.
privacybooleanWHOIS privacy. Defaults to true.
idempotencyKeyuuidReuse the same key when retrying so the wallet is never charged twice.
contact
FieldTypeDescription
firstNamerequiredstring1-80 characters.
lastNamerequiredstring1-80 characters.
organizationstring1-120 characters.
address1requiredstring1-120 characters.
address2string1-120 characters.
cityrequiredstring1-80 characters.
statestring1-80 characters.
postalCoderequiredstring1-20 characters.
countryrequiredstringISO 3166-1 alpha-2, uppercase, e.g. US.
emailrequiredstringRegistrant email address.
phonerequiredstringE.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.

items[]
FieldTypeDescription
typerequiredstringA, AAAA, CNAME, MX, TXT, SRV, CAA or NS.
namerequiredstringHost name, @ for the apex.
valuestringRecord value. Every record needs value or address.
addressstringIP address for A and AAAA records.
ttlinteger60-86400 seconds. Defaults to 3600.
preferenceintegerMX priority. Defaults to 0.
service, protocol, port, weight, targetSRV fieldsUsed 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

See the error codes for INSUFFICIENT_FUNDS, DOMAIN_UNAVAILABLE, DOMAIN_PRICE_UNAVAILABLE and the rest. Full schemas are in the API reference.