---
title: "Create a project access token"
method: POST
path: "/projects/{id}/access-tokens"
tags: ["Project Access Tokens"]
---

# Create a project access token

`POST /projects/{id}/access-tokens`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/projects/{id}/access-tokens`
- Auth: HTTP bearer

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.

## Path parameters

- `id` string, uuid, required

## Request body

- CreateProjectAccessTokenRequest
  - `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 `201`

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

- CreatedProjectAccessToken
  - [`ProjectAccessToken`](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9/schema?at=%2Fcomponents%2Fschemas%2FProjectAccessToken)
  - 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.

## Other responses

- `400`: Bad request - invalid name, scope, or expiry
- `401`: Unauthorized - invalid or missing token
- `403`: Forbidden - not the project owner, or a project access token was used
- `404`: Project not found
- `409`: Duplicate name, token limit reached, or the project is being deleted. Tell them apart with `code`, which is one of `access_token_name_exists`, `access_token_limit_reached`, or `project_deleting` — the message text is not a contract.

## Changes

- **2026-10-07** `23e7875e7c4c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/projects/:id/access-tokens/post.md)

---

[API](https://skmtc.dev/kong/apis/volcano-api.md) - [All operations](https://skmtc.dev/kong/apis/volcano-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9?raw)
