v8

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2025-10-165266542.4 MB
DigitalOcean-public.v2-new_Domain Records

Create a New Domain Record

To create a new record to a domain, send a POST request to /v2/domains/$DOMAIN_NAME/records.

The request must include all of the required fields for the domain record type being added.

See the attribute table for details regarding record types and their respective required attributes.

post/v2/domains/{domain_name}/records

Path parameters

domain_namestring required

The name of the domain itself.

Request body

OR
OR
OR
OR
OR
OR
OR
OR

Example request

{
  "id": 28448429,
  "type": "NS",
  "name": "@",
  "data": "ns1.digitalocean.com",
  "ttl": 1800
}

Response

The response body will be a JSON object with a key called domain_record. The value of this will be an object representing the new record. Attributes that are not applicable for the record type will be set to null. An id attribute is generated for each record as part of the object.

Example response

{
  "domain_record": {
    "id": 28448433,
    "type": "A",
    "name": "www",
    "data": "162.10.66.0",
    "priority": null,
    "port": null,
    "ttl": 1800,
    "weight": null,
    "flags": null,
    "tag": null
  }
}