Skip to content

Issue a short admin token

POST
/v1/admin/tokens
curl --request POST \
--url https://beta-api.plune.ai/v1/admin/tokens \
--header 'Content-Type: application/json' \
--cookie plune_session=<plune_session> \
--data '{ "doors": [ "client-ip" ], "expiresInMinutes": 30 }'

For the operator to call the admin doors without pasting the session cookie into a command (ADR 0055, B; docs/RUNBOOK.md §4d). Send it as Authorization: Bearer plune_adm_… to the doors it names. It lives an hour unless expiresInMinutes says otherwise, at most a day; it opens only the doors listed and can neither issue tokens nor change roles (403, session_required). Shown once. Every call made with it is a row of the admin journal. The owner’s session alone; anyone else is told 404. Ten a minute.

Media type application/json
object
doors
required

The admin doors the token opens, named after the route. The roles door and the token doors are not in the list: no token opens them

Array<string>
>= 1 items
Allowed values: purge file-unfiled reindex-tags reindex-steps tiers tier-grants usage retention client-ip sso-switch-off
expiresInMinutes

How long it lives. 60 (an hour) when not given; more than 1440 (a day) is refused

integer
>= 1 <= 1440
Example
{
"doors": [
"client-ip"
],
"expiresInMinutes": 30
}

The token, once

Media type application/json
object
id
required
string
token
required

plune_adm_…. Shown once; only its hash is kept

string
prefix
required
string
doors
required
Array<string>
Allowed values: purge file-unfiled reindex-tags reindex-steps tiers tier-grants usage retention client-ip sso-switch-off
createdAt
required
string format: date-time
expiresAt
required
string format: date-time
Example
{
"doors": [
"purge"
]
}

The body is not valid, or the lifetime is over a day

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

An admin token was used (code: session_required)

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

Not found

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

Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). 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