Skip to main content

records

Creates, updates, deletes, gets or lists a records resource.

Overview​

Namerecords
TypeResource
Idvercel.dns.records

Fields​

The following fields are returned by SELECT queries:

Successful response retrieving a list of paginated DNS records.

NameDatatypeDescription
idstring
namestring
commentstring
creatednumber
created_atnumber (wire: createdAt)
creatorstring
mx_prioritynumber (wire: mxPriority)
prioritynumber
slugstring
ttlnumber
typestring (A, AAAA, ALIAS, CAA, CNAME, HTTPS, MX, NS, SRV, TXT)
updatednumber
updated_atnumber (wire: updatedAt)
valuestring

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectdomainlimit, since, until, team_id, slugRetrieves 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.
getselectrecord_id
createinsertdomain, type, value, name, mx_priority, srv, httpsteam_id, slugCreates a DNS record for a domain.
updateupdaterecord_idteam_id, slugUpdates an existing DNS record for a domain name.
replacereplacedomain
deletedeletedomain, record_idteam_id, slugRemoves an existing DNS record from a domain name.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
domainstring
record_idstring
limitstringMaximum number of records to list from a request.
sincestringGet records created after this JavaScript timestamp.
slugstringThe Team slug to perform the request on behalf of.
team_idstringThe Team identifier to perform the request on behalf of. (wire: teamId)
untilstringGet records created before this JavaScript timestamp.

SELECT examples​

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.

SELECT
id,
name,
comment,
created,
created_at,
creator,
mx_priority,
priority,
slug,
ttl,
type,
updated,
updated_at,
value
FROM vercel.dns.records
WHERE domain = '{{ domain }}' -- required
AND limit = '{{ limit }}'
AND since = '{{ since }}'
AND until = '{{ until }}'
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;

INSERT examples​

Creates a DNS record for a domain.

INSERT INTO vercel.dns.records (
type,
name,
ttl,
value,
comment,
mx_priority,
srv,
https,
domain,
team_id,
slug
)
SELECT
'{{ type }}' /* required */,
'{{ name }}' /* required */,
{{ ttl }},
'{{ value }}' /* required */,
'{{ comment }}',
{{ mx_priority }} /* required */,
'{{ srv }}' /* required */,
'{{ https }}' /* required */,
'{{ domain }}',
'{{ team_id }}',
'{{ slug }}'
RETURNING
uid,
updated
;

UPDATE examples​

Updates an existing DNS record for a domain name.

UPDATE vercel.dns.records
SET
name = '{{ name }}',
value = '{{ value }}',
type = '{{ type }}',
ttl = {{ ttl }},
mx_priority = {{ mx_priority }},
srv = '{{ srv }}',
https = '{{ https }}',
comment = '{{ comment }}'
WHERE
record_id = '{{ record_id }}' --required
AND team_id = '{{ team_id}}'
AND slug = '{{ slug}}'
RETURNING
id,
name,
comment,
created_at,
creator,
domain,
record_type,
ttl,
type,
value;

REPLACE examples​

No description available.

REPLACE vercel.dns.records
SET
-- No updatable properties
WHERE
domain = '{{ domain }}' --required
RETURNING
record_ids;

DELETE examples​

Removes an existing DNS record from a domain name.

DELETE FROM vercel.dns.records
WHERE domain = '{{ domain }}' --required
AND record_id = '{{ record_id }}' --required
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;