post/v2/domains/{domain}/records

Creates a DNS record for a domain.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v2/domains/example.com/records?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"body": {
3
"name": "subdomain",
4
"type": "A",
5
"ttl": 60,
6
"value": "192.0.2.42",
7
"comment": "used to verify ownership of domain"
8
},
9
"headers": {
10
"Authorization": "Bearer <TOKEN>"
11
},
12
"method": "post"
13
})
Path Params
Query Params
Body Params
Path ParameterDescription

domain

string

required
The domain used to create the DNS record.
Example:example.com
  • One of the following objects
  • One of
CodeDescription
200Successful response showing the uid of the newly created DNS record.
400
  • One of the provided values in the request body is invalid.

  • One of the provided values in the request query is invalid.

401
402
  • The account was soft-blocked for an unhandled reason.

  • The account is missing a payment so payment method must be updated

403You do not have permission to access this resource.
404
409
get/v4/domains/{domain}/records

Retrieves a list of DNS records created for a domain name. By default it returns 20 records if no limit is provided. The rest can be retrieved using the pagination options.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v4/domains/example.com/records?limit=20&since=1609499532000&slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE&until=1612264332000", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "get"
6
})
Path Params
Query Params
Path ParameterDescription

domain

string

required
Example:example.com
  • One of the following objects
  • One of
CodeDescription
200Successful response retrieving a list of paginated DNS records.
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
404
delete/v2/domains/{domain}/records/{recordId}

Removes an existing DNS record from a domain name.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v2/domains/example.com/records/rec_V0fra8eEgQwEpFhYG2vTzC3K?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"headers": {
3
"Authorization": "Bearer <TOKEN>"
4
},
5
"method": "delete"
6
})
Path Params
Query Params
Path ParameterDescription

domain

string

required
Example:example.com

recordId

string

required
Example:rec_V0fra8eEgQwEpFhYG2vTzC3K
  • object
CodeDescription
200Successful response by removing the specified DNS record.
400One of the provided values in the request query is invalid.
401
403You do not have permission to access this resource.
404
patch/v1/domains/records/{recordId}

Updates an existing DNS record for a domain name.

Optional params

fetch-request

1
await fetch("https://api.vercel.com/v1/domains/records/rec_2qn7pzrx89yxy34vezpd31y9?slug=SOME_STRING_VALUE&teamId=SOME_STRING_VALUE", {
2
"body": {
3
"comment": "used to verify ownership of domain",
4
"https": {
5
"priority": "SOME_INTEGER_VALUE",
6
"target": "example2.com.",
7
"params": "SOME_STRING_VALUE"
8
},
9
"mxPriority": "SOME_INTEGER_VALUE",
10
"name": "example-1",
11
"srv": {
12
"target": "example2.com.",
13
"weight": "SOME_INTEGER_VALUE",
14
"port": "SOME_INTEGER_VALUE",
15
"priority": "SOME_INTEGER_VALUE"
16
},
17
"ttl": "60",
18
"type": "A",
19
"value": "google.com"
20
},
21
"headers": {
22
"Authorization": "Bearer <TOKEN>"
23
},
24
"method": "patch"
25
})
Path Params
Query Params
Body Params
Path ParameterDescription

recordId

string

required
The id of the DNS record
Example:rec_2qn7pzrx89yxy34vezpd31y9
  • commentstring
  • createdAtnumber or null
  • creatorstringRequired
  • domainstringRequired
  • idstringRequired
  • namestringRequired
  • recordTypestringRequired
    One of: A | AAAA | ALIAS | CAA | CNAME | HTTPS | MX | SRV | TXT | NS
  • ttlnumber
  • typestringRequired
    One of: record | record-sys
  • valuestringRequired
CodeDescription
200
400
  • One of the provided values in the request body is invalid.

  • One of the provided values in the request query is invalid.

401
402
  • The account was soft-blocked for an unhandled reason.

  • The account is missing a payment so payment method must be updated

403You do not have permission to access this resource.
404
409
Last updated on December 25, 2024