POST/v2/domains/{domain_name}/records

Create a domain record

Creates a DNS record for the specified domain. Supply type and the attributes required for that record type, such as name and data where applicable. The response includes the created record with its generated id.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 10 body fields
domain_namestringrequired
The name of the domain to add the record to.

Domain record details. Include type and the attributes required for that record type.

idintegeroptional
A unique identifier for each domain record.
typestringrequired
The type of the DNS record. For example: A, CNAME, TXT, ...
namestringrequired
The host name, alias, or service being defined by the record.
datastringrequired
Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the CA being granted permission to issue certificates.
priorityintegeroptional
The priority for SRV and MX records.
portintegeroptional
The port for SRV records.
ttlintegeroptional
This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.
weightintegeroptional
The weight for SRV records.
flagsintegeroptional
An unsigned integer between 0-255 used for CAA records.
tagstringoptional
The parameter tag for CAA records. Valid values are "issue", "issuewild", or "iodef"

6 status codes
201Returns a JSON object containing the created `domain_record`, including its generated `id`; attributes that do not apply to the record type are set to `null`.
domain_recordobjectoptional
401Returned when authentication fails because the credentials are invalid.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404Returned when the requested resource is not found.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429Returned when the API rate limit has been exceeded.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500Returned when a server error occurs.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
defaultReturned when an unexpected error occurs.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.

Error handling

A 401 is returned when authentication credentials are invalid. A 404 is returned when the domain or another required resource is not found. A 429 is returned when the API rate limit is exceeded, and a 500 indicates a server error. The domain_name path parameter must identify an existing domain; the body must include type and the attributes required for that record type.