tokens
Creates, updates, deletes, gets or lists a tokens resource.
Overview​
| Name | tokens |
| Type | Resource |
| Id | vercel.edge_config.tokens |
Fields​
The following fields are returned by SELECT queries:
- get
- list
The Global Config.
| Name | Datatype | Description |
|---|---|---|
id | string | This is not the token itself, but rather an id to identify the token by |
edge_config_id | string | (wire: edgeConfigId) |
created_at | number | (wire: createdAt) |
label | string | |
partial_token | string | A partially-masked representation of the token, safe to display in UIs. The format is the first 3 characters of the token followed by a fixed 8-character * mask (e.g. 550e8400-e29b-41d4-a716-446655440000 → 550********). The mask length is intentionally fixed (not proportional to the original token length) to avoid leaking the token length. Prefer this field for display/reference in UIs and logs. The full, plaintext token is only disclosed once at creation time via POST /v1/edge-config/:edgeConfigId/token; use id to reference a token in subsequent calls (e.g. when deleting). (wire: partialToken) |
token | string | Deprecated: the full, plaintext token. - Returned once by POST /v1/edge-config/:edgeConfigId/token (create). - Still returned by GET /v1/edge-config/:edgeConfigId/token/:token (detail) for backwards compatibility, but scheduled for removal. - Not returned by GET /v1/edge-config/:edgeConfigId/tokens (list); use partialToken for display and id to reference tokens. Do not rely on this field being present on read operations. Prefer partialToken for display and id for references. |
The Global Config.
| Name | Datatype | Description |
|---|---|---|
id | string | This is not the token itself, but rather an id to identify the token by |
edge_config_id | string | (wire: edgeConfigId) |
created_at | number | (wire: createdAt) |
label | string | |
partial_token | string | A partially-masked representation of the token, safe to display in UIs. The format is the first 3 characters of the token followed by a fixed 8-character * mask (e.g. 550e8400-e29b-41d4-a716-446655440000 → 550********). The mask length is intentionally fixed (not proportional to the original token length) to avoid leaking the token length. Prefer this field for display/reference in UIs and logs. The full, plaintext token is only disclosed once at creation time via POST /v1/edge-config/:edgeConfigId/token; use id to reference a token in subsequent calls (e.g. when deleting). (wire: partialToken) |
token | string | Deprecated: the full, plaintext token. - Returned once by POST /v1/edge-config/:edgeConfigId/token (create). - Still returned by GET /v1/edge-config/:edgeConfigId/token/:token (detail) for backwards compatibility, but scheduled for removal. - Not returned by GET /v1/edge-config/:edgeConfigId/tokens (list); use partialToken for display and id to reference tokens. Do not rely on this field being present on read operations. Prefer partialToken for display and id for references. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | edge_config_id, token | team_id, slug | Return meta data about a Global Config token. |
list | select | edge_config_id | team_id, slug | Returns all tokens of a Global Config. |
create | insert | edge_config_id, label | team_id, slug | Adds a token to an existing Global Config. |
delete | delete | edge_config_id | team_id, slug | Deletes one or more tokens of an existing Global Config. |
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 |
|---|---|---|
edge_config_id | string | |
token | string | |
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) |
SELECT examples​
- get
- list
Return meta data about a Global Config token.
SELECT
id,
edge_config_id,
created_at,
label,
partial_token,
token
FROM vercel.edge_config.tokens
WHERE edge_config_id = '{{ edge_config_id }}' -- required
AND token = '{{ token }}' -- required
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;
Returns all tokens of a Global Config.
SELECT
id,
edge_config_id,
created_at,
label,
partial_token,
token
FROM vercel.edge_config.tokens
WHERE edge_config_id = '{{ edge_config_id }}' -- required
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;
INSERT examples​
- create
- Manifest
Adds a token to an existing Global Config.
INSERT INTO vercel.edge_config.tokens (
label,
edge_config_id,
team_id,
slug
)
SELECT
'{{ label }}' /* required */,
'{{ edge_config_id }}',
'{{ team_id }}',
'{{ slug }}'
RETURNING
id,
token
;
# Description fields are for documentation purposes
- name: tokens
props:
- name: edge_config_id
value: "{{ edge_config_id }}"
description: Required parameter for the tokens resource.
- name: label
value: "{{ label }}"
- 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.
DELETE examples​
- delete
Deletes one or more tokens of an existing Global Config.
DELETE FROM vercel.edge_config.tokens
WHERE edge_config_id = '{{ edge_config_id }}' --required
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;