/ Docs

Authentication

How to authenticate API requests.

How to authenticate API requests.

Token types

Token typeUsed forHeaderSource
Platform tokenManaging every project in your accountAuthorization: Bearer TOKENvolcano login, or the dashboard
Project access tokenManaging one project from CI, a script, or an agentAuthorization: Bearer TOKENPOST /projects/{id}/access-tokens
Anon keyPublic auth endpointsAuthorization: Bearer KEYProject settings
Access tokenUser operationsAuthorization: Bearer TOKENSignup/signin
Service keyAdmin operationsAuthorization: Bearer TOKENCreate via API

Anon key

PropertyValue
PurposeSignup, signin, refresh, logout
SourceProject Settings → Authentication → Anon Keys
Safe to exposeYes (in frontend code)
ScopeSingle project
POST /auth/signup
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Access token

PropertyValue
PurposeInvoking functions, accessing user profile
SourceSignup/signin response (access_token field)
Lifetime1 hour (configurable)
Containsuser_id, email, project_id, role
POST /functions/func-id/invoke
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Platform token

PropertyValue
PurposeManaging projects, functions, databases
Sourcevolcano login (browser sign-in), or the dashboard
ScopeYour account (all projects)
Prefixpk-
GET /projects
Authorization: Bearer pk-...

A platform token reaches every project you own. For automation, create a project access token with it instead of handing it to the job.

Project access token

PropertyValue
PurposeManaging one project from CI, a script, or an agent
SourcePOST /projects/{id}/access-tokens, which requires a platform token
ScopeA single project, at full or read_only
Prefixpt-
RetrievableNo — the secret is returned once, at creation
POST /projects/7c9e6679-7425-40de-944b-e07fc1f90ae7/functions
Authorization: Bearer pt-...

A project token is refused on account-scoped endpoints, on other projects, and on the token-management endpoints themselves, all with 403. A read_only token is refused on mutations, and on the reads that return a credential — service keys, anon keys, variable values, and database connection strings. See Project access tokens and Using the API.

Service key

PropertyValue
PurposeBackground jobs, cron, webhooks
SourcePOST /projects/{id}/service-keys
ScopeSingle project
User contextNone (functions don't receive __volcano_auth)
POST /functions/func-id/invoke
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Header format

All use Bearer authentication:

Authorization: Bearer <token>

Don't include:

  • Extra quotes
  • "Token" prefix
  • Line breaks

Error responses

StatusCause
401 UnauthorizedMissing Authorization header, invalid token, expired token, revoked project access token, or token for wrong project
403 ForbiddenValid token but no permission, project access token out of scope or on the wrong project, CORS blocked, anon key revoked, or account banned

An expired and a revoked project access token both return 401 {"error": "invalid token"}. The response does not distinguish them, so a leaked secret cannot be probed for whether it still exists; read the token's record to find out which it was.

What's next

GuideDescription
Using the APICreate a token and run a workflow with it
Auth endpointsUsing anon keys and access tokens
Token typesDetailed comparison
Project access tokensProject-scoped API credentials
Anon keysAnon key security model

On this page