records
Creates, updates, deletes, gets or lists a records resource.
Overview​
| Name | records |
| Type | Resource |
| Id | vercel.dns.records |
Fields​
The following fields are returned by SELECT queries:
- list
- get
Successful response retrieving a list of paginated DNS records.
| Name | Datatype | Description |
|---|---|---|
id | string | |
name | string | |
comment | string | |
created | number | |
created_at | number | (wire: createdAt) |
creator | string | |
mx_priority | number | (wire: mxPriority) |
priority | number | |
slug | string | |
ttl | number | |
type | string | (A, AAAA, ALIAS, CAA, CNAME, HTTPS, MX, NS, SRV, TXT) |
updated | number | |
updated_at | number | (wire: updatedAt) |
value | string |
| Name | Datatype | Description |
|---|---|---|
id | string | |
name | string | |
comment | string | |
created_at | number | (wire: createdAt) |
creator | string | |
domain | string | |
record_type | string | (A, AAAA, ALIAS, CAA, CNAME, HTTPS, MX, NS, SRV, TXT) (wire: recordType) |
ttl | number | |
type | string | (A, AAAA, ALIAS, CAA, CNAME, HTTPS, MX, NS, SRV, TXT) |
value | string |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | domain | limit, since, until, team_id, slug | 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. |
get | select | record_id | ||
create | insert | domain, type, value, name, mx_priority, srv, https | team_id, slug | Creates a DNS record for a domain. |
update | update | record_id | team_id, slug | Updates an existing DNS record for a domain name. |
replace | replace | domain | ||
delete | delete | domain, record_id | team_id, slug | Removes 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.
| Name | Datatype | Description |
|---|---|---|
domain | string | |
record_id | string | |
limit | string | Maximum number of records to list from a request. |
since | string | Get records created after this JavaScript timestamp. |
slug | string | The Team slug to perform the request on behalf of. |
team_id | string | The Team identifier to perform the request on behalf of. (wire: teamId) |
until | string | Get records created before this JavaScript timestamp. |
SELECT examples​
- list
- get
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 }}'
;
No description available.
SELECT
id,
name,
comment,
created_at,
creator,
domain,
record_type,
ttl,
type,
value
FROM vercel.dns.records
WHERE record_id = '{{ record_id }}' -- required
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: records
props:
- name: domain
value: "{{ domain }}"
description: Required parameter for the records resource.
- name: type
value: "{{ type }}"
description: |
The type of record, it could be one of the valid DNS records.
valid_values: ['A', 'AAAA', 'ALIAS', 'CAA', 'CNAME', 'HTTPS', 'MX', 'SRV', 'TXT', 'NS']
- name: name
value: "{{ name }}"
description: |
A subdomain name or an empty string for the root domain.
- name: ttl
value: {{ ttl }}
description: |
The TTL value. Must be a number between 60 and 2147483647. Default value is 60.
- name: value
value: "{{ value }}"
description: |
The record value must be a valid IPv4 address.
- name: comment
value: "{{ comment }}"
description: |
A comment to add context on what this DNS record is for
- name: mx_priority
value: {{ mx_priority }}
- name: srv
value:
priority: "{{ priority }}"
weight: "{{ weight }}"
port: "{{ port }}"
target: "{{ target }}"
- name: https
value:
priority: "{{ priority }}"
target: "{{ target }}"
params: "{{ params }}"
- name: team_id
value: "{{ team_id }}"
description: The Team identifier to perform the request on behalf of.
description: The Team identifier to perform the request on behalf of.
- name: slug
value: "{{ slug }}"
description: The Team slug to perform the request on behalf of.
description: The Team slug to perform the request on behalf of.
UPDATE examples​
- update
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​
- replace
No description available.
REPLACE vercel.dns.records
SET
-- No updatable properties
WHERE
domain = '{{ domain }}' --required
RETURNING
record_ids;
DELETE examples​
- delete
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 }}'
;