Domains

Add, change or delete a DNS record

Without record_id a new record (a new A, AAAA or CNAME replaces the A, AAAA or CNAME on that name); with record_id that record is replaced; with delete true it is deleted. The records that serve the site cannot be changed here. On an active domain, a change that replaces or deletes a live record returns 409 confirmation_required with preflight (what changes, what is live there now, mail_affected) and nothing changes; call again with confirm_overwrite true once the user agreed. Every change keeps the previous state for POST /domains/{id}/dns-records/undo.

post/domains/{id}/dns-records

Request

  • Base URL: https://api.hypamoon.com/api/v1
  • URL: https://api.hypamoon.com/api/v1/domains/{id}/dns-records
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://app.hypamoon.com/oauth/authorize, token URL https://api.hypamoon.com/oauth/token, scopes: sites:write)

Path parameters

idstring uuid required

The id of the domain.

Request body

record_idstring

Optional. The id from list_dns_records of the record to change or delete. Without it, a new record is added.

type'A' | 'AAAA' | 'CNAME' | 'MX' | 'TXT' | 'SRV' | 'CAA' | 'NS' required

The record type.

namestring required

The name: @ for the domain itself, or a subdomain like www, mail or _dmarc.

contentstring

The value: an IP address, a hostname, or the text of a TXT record. For SRV: 'priority weight port target'. For CAA: 'flags tag "value"'.

ttlinteger

Seconds; 1 means automatic.

priorityinteger

For MX: the priority (lower is preferred).

proxiedboolean

For A, AAAA and CNAME: through the CDN (true) or DNS only (false, default).

deleteboolean

true deletes the record with record_id.

confirm_overwriteboolean

Optional, default false. A change that replaces or deletes a record that is live now (on an active domain) is refused first with a preflight: what changes, what is live there now, and whether mail is affected. Show it to the user; only after they agree, call again with true. undo_dns_change reverses it for 30 days.

Response

The record (or deleted: true), what it replaced, and how to undo it.

Changes

No recorded changes to this operation across all 1 revision of this API.