Creates a DNS record for a domain.
Optional params
fetch-request
1await 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 Parameter | Description |
---|---|
domain | string requiredThe domain used to create the DNS record. Example: example.com |
One of the following objects
Code | Description |
---|---|
200 | Successful response showing the uid of the newly created DNS record. |
400 |
|
401 | |
402 |
|
403 | You do not have permission to access this resource. |
404 | |
409 |
Optional params
fetch-request
1await 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})
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
1await 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 Parameter | Description |
---|---|
domain | string requiredExample: example.com |
One of the following objects
Code | Description |
---|---|
200 | Successful response retrieving a list of paginated DNS records. |
400 | One of the provided values in the request query is invalid. |
401 | |
403 | You do not have permission to access this resource. |
404 |
Optional params
fetch-request
1await 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})
Removes an existing DNS record from a domain name.
Optional params
fetch-request
1await 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 Parameter | Description |
---|---|
domain | string requiredExample: example.com |
recordId | string requiredExample: rec_V0fra8eEgQwEpFhYG2vTzC3K |
object
Code | Description |
---|---|
200 | Successful response by removing the specified DNS record. |
400 | One of the provided values in the request query is invalid. |
401 | |
403 | You do not have permission to access this resource. |
404 |
Optional params
fetch-request
1await 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})
Updates an existing DNS record for a domain name.
Optional params
fetch-request
1await 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 Parameter | Description |
---|---|
recordId | string requiredThe 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
Code | Description |
---|---|
200 | |
400 |
|
401 | |
402 |
|
403 | You do not have permission to access this resource. |
404 | |
409 |
Optional params
fetch-request
1await 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})
Was this helpful?