Skip to content
Docs

Update an existing DNS record

PATCHhttps://api.vercel.com/v1/domains/records/{recordId}
Updates an existing DNS record for a domain name.
https://api.vercel.com/v1/domains/records/{recordId}
const response = await fetch('https://api.vercel.com/v1/domains/records/recordId?teamId=string&slug=string', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "example-1",
"value": "google.com",
"type": "A",
"ttl": "60",
"mxPriority": "123",
"srv": {
"target": "example2.com.",
"weight": "123",
"port": "123",
"priority": "123"
},
"https": {
"priority": "123",
"target": "example2.com.",
"params": "string"
},
"comment": "used to verify ownership of domain"
}),
});
const data = await response.json();
console.log(data);
Response
{
"id": "icfg_1234567890",
"name": "Example Name",
"type": "record",
"value": "string",
"creator": "string",
"domain": "string",
"ttl": "123",
"comment": "string",
"recordType": "A",
"createdAt": "123"
}
AuthorizationbearerToken

Default authentication mechanism

recordIdstringRequired
The id of the DNS record
teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
application/json
namestringOptional
The name of the DNS record
valuestringOptional
The value of the DNS record
typestringOptional
The type of the DNS record
ttlintegerOptional
The Time to live (TTL) value of the DNS record
mxPriorityintegerOptional
The MX priority value of the DNS record
srvobjectOptional
httpsobjectOptional
commentstringOptional
A comment to add context on what this DNS record is for
200Success
idstringRequired
namestringRequired
typestringRequired
valuestringRequired
creatorstringRequired
domainstringRequired
ttlnumberOptional
commentstringOptional
recordTypestringRequired
createdAtnumberOptional
400One of the provided values in the request body is invalid. One of the provided values in the request query is invalid.
401The request is not authorized.
402The account is missing a payment so payment method must be updated
403You do not have permission to access this resource.
404Error
409Error
410Error