Create a DNS record
POST
https://api.vercel.com/v2/domains/{domain}/recordsCreates a DNS record for a domain.
https://api.vercel.com/v2/domains/{domain}/records
const response = await fetch('https://api.vercel.com/v2/domains/domain/records?teamId=string&slug=string', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', }, body: JSON.stringify({ "type": "A", "name": "subdomain", "ttl": "60", "value": "192.0.2.42", "comment": "used to verify ownership of domain" }),});
const data = await response.json();console.log(data);Response
{ "uid": "example_id", "updated": "123"}AuthorizationbearerToken
Default authentication mechanism
application/json
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