Skip to main content

project_tokens

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

Overview​

Nameproject_tokens
TypeResource
Idrailway.projects.project_tokens

Fields​

The following fields are returned by SELECT queries:

One row per ProjectToken.

NameDatatypeDescription
idstring
namestring
environment_idstring
project_idstring
created_atstring (date-time)
display_tokenstring
environmentobjectEnvironment object
projectobjectProject object

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectproject_idGet all project tokens for a project. Backed by the Railway GraphQL query projectTokens.
createinsertenvironment_id, name, project_idCreate a token for a project that has access to a specific environment. Backed by the Railway GraphQL mutation projectTokenCreate.
deletedeleteidDelete a project token. Backed by the Railway GraphQL mutation projectTokenDelete.

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
project_idstring
environment_idstring
idstring
namestring

SELECT examples​

Get all project tokens for a project. Backed by the Railway GraphQL query projectTokens.

SELECT
id,
name,
environment_id,
project_id,
created_at,
display_token,
environment,
project
FROM railway.projects.project_tokens
WHERE project_id = '{{ project_id }}' -- required
;

INSERT examples​

Create a token for a project that has access to a specific environment. Backed by the Railway GraphQL mutation projectTokenCreate.

INSERT INTO railway.projects.project_tokens (
environment_id,
name,
project_id
)
SELECT
'{{ environment_id }}' /* required */,
'{{ name }}' /* required */,
'{{ project_id }}' /* required */
RETURNING
result
;

DELETE examples​

Delete a project token. Backed by the Railway GraphQL mutation projectTokenDelete.

DELETE FROM railway.projects.project_tokens
WHERE
id = '{{ id }}' --required
;