Skip to content

Mint a CLI API token

POST
/v1/tokens
curl --request POST \
--url https://beta-api.plune.ai/v1/tokens \
--cookie plune_session=<plune_session>

Account → API tokens on the dashboard (api.ts → createToken). No body: a token is the account’s, not a named thing, and it writes for good to the project X-Plune-Project names — the one picked beside Generate — else to your default one; a project you are not in answers 404, one you only read 403. The plaintext comes back once, in this response, and is what goes into PLUNE_TOKEN for the CLI and into {{token}} in the collection; the server keeps only its hash. Session-only on purpose: a leaked API token must not be able to mint more of them. An account holds at most limit live tokens (see GET /v1/tokens) — past it the answer is 409, and revoking one is the only way on.

Created — plaintext token shown once

Media type application/json

The token plaintext is returned ONCE, here; the server stores only its sha256.

object
id
required
string format: uuid
token
required
string
prefix
required

Display prefix (first chars) — safe to show in a UI.

string
createdAt
required
string format: date-time
expiresAt

When it stops working by itself — shown once, beside the token.

string format: date-time
nullable
projectId

The project the token was minted in and writes to (B8-team). Every request with it lands there, whatever X-Plune-Project says.

string
nullable
Example
{
"token": "plune_XxYy…"
}

No / invalid session

read-only member of the project named — a reader cannot mint for it

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

The project named is not one you are in (the same answer as an id nobody has)

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

The account already holds the maximum of live tokens; the body names the ceiling. Not temporary — waiting changes nothing, revoking does

Media type application/json
object
error
required
string
Example
{
"error": "you already hold 10 live tokens (maximum 10) — revoke one before minting another",
"limit": 10
}

Rate-limited: either the per-route throttle or a tenant quota. Retry-After carries the seconds until the window rolls over.

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}
Retry-After
integer

Seconds until the window rolls over