Project Access Tokens

Create a project access token

Changed on

Creates a project access token and returns its secret.

The secret is in this response and nowhere else. Only its hash is stored, so it cannot be retrieved, displayed, or recovered later — save it when you create it.

The name must be unique within the project, so a retry cannot mint a second credential. It cannot recover the first one either. A retry that returns 409 with code access_token_name_exists means the original create committed and its secret is unrecoverable: list the project's tokens, revoke the one holding that name, and create it again.

Requires a platform token.

post/projects/{id}/access-tokens

Request

  • Base URL
    https://api.volcano.dev
  • Auth
    HTTP bearer

Path parameters

id, string uuid required

Project ID

Request body

CreateProjectAccessTokenRequest required
name, string required

Held by any of the project's tokens you have not revoked, including one that has expired. Creating a duplicate returns 409 with code access_token_name_exists; revoking the holder frees the name, so a rotation can keep the name its caller already references.

scope, 'full' | 'read_only' required

What a project access token may do within its project.

full is everything you can do to that one project, up to and including deleting it. It cannot manage access tokens, so a leaked token cannot mint a replacement or erase the record of its own use, but for a CI or agent credential that only deploys, prefer read_only where the job allows it.

read_only refuses mutations. It is enforced by route classification rather than HTTP method, so the log and metrics query endpoints remain available even though they are POST requests that carry body filters.

read_only also refuses the reads that return a credential — service keys, anon keys, variable values, and database connection strings. Those grant write access over the project's data and keep working after the token that fetched them is revoked, so returning one to a read-only credential would make the scope a formality. An anon key is included because its permissions are chosen per key and may include uploading, deleting, and publishing.

expires_at, string date-time

Omit for a token that does not expire.

Response

Token created - save the secret now, it cannot be retrieved again

CreatedProjectAccessToken required
object
token, string required

The secret. Returned only here, and not recoverable afterwards: the server stores a hash rather than the value. Save it now.

Changes