PATCH
/
v1
/
domains
/
records
/
{recordId}
import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.dns.updateRecord({
    recordId: "rec_2qn7pzrx89yxy34vezpd31y9",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
    requestBody: {
      name: "example-1",
      value: "google.com",
      type: "A",
      ttl: 60,
      srv: {
        target: "example2.com.",
        weight: 97604,
        port: 570172,
        priority: 199524,
      },
      https: {
        priority: 35000,
        target: "example2.com.",
      },
      comment: "used to verify ownership of domain",
    },
  });

  // Handle the result
  console.log(result);
}

run();
{
  "createdAt": 123,
  "creator": "<string>",
  "domain": "<string>",
  "id": "<string>",
  "name": "<string>",
  "recordType": "A",
  "ttl": 123,
  "type": "record",
  "value": "<string>",
  "comment": "<string>"
}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Path Parameters

recordId
string
required

The id of the DNS record

Example:

"rec_2qn7pzrx89yxy34vezpd31y9"

Query Parameters

teamId
string

The Team identifier to perform the request on behalf of.

Example:

"team_1a2b3c4d5e6f7g8h9i0j1k2l"

slug
string

The Team slug to perform the request on behalf of.

Example:

"my-team-url-slug"

Body

application/json
name
string | null

The name of the DNS record

Example:

"example-1"

value
string | null

The value of the DNS record

Example:

"google.com"

type
enum<string> | null

The type of the DNS record

Available options:
A,
AAAA,
ALIAS,
CAA,
CNAME,
HTTPS,
MX,
SRV,
TXT,
NS
Example:

"A"

ttl
integer | null

The Time to live (TTL) value of the DNS record

Required range: 60 <= x <= 2147483647
Example:

"60"

mxPriority
integer | null

The MX priority value of the DNS record

srv
object | null
https
object | null
comment
string

A comment to add context on what this DNS record is for

Maximum length: 500
Example:

"used to verify ownership of domain"

Response

200
application/json
creator
string
required
domain
string
required
id
string
required
name
string
required
recordType
enum<string>
required
Available options:
A,
AAAA,
ALIAS,
CAA,
CNAME,
HTTPS,
MX,
SRV,
TXT,
NS
type
enum<string>
required
Available options:
record,
record-sys
value
string
required
createdAt
number | null
ttl
number
comment
string