Skip to main content

tokens

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

Overview​

Nametokens
TypeResource
Idvercel.edge_config.tokens

Fields​

The following fields are returned by SELECT queries:

The Global Config.

NameDatatypeDescription
idstringThis is not the token itself, but rather an id to identify the token by
edge_config_idstring (wire: edgeConfigId)
created_atnumber (wire: createdAt)
labelstring
partial_tokenstringA 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)
tokenstringDeprecated: 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:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectedge_config_id, tokenteam_id, slugReturn meta data about a Global Config token.
listselectedge_config_idteam_id, slugReturns all tokens of a Global Config.
createinsertedge_config_id, labelteam_id, slugAdds a token to an existing Global Config.
deletedeleteedge_config_idteam_id, slugDeletes 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.

NameDatatypeDescription
edge_config_idstring
tokenstring
slugstringThe Team slug to perform the request on behalf of.
team_idstringThe Team identifier to perform the request on behalf of. (wire: teamId)

SELECT examples​

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 }}'
;

INSERT examples​

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
;

DELETE examples​

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 }}'
;