Issue a short admin token
const url = 'https://beta-api.plune.ai/v1/admin/tokens';const options = { method: 'POST', headers: { cookie: 'plune_session=<plune_session>', 'Content-Type': 'application/json' }, body: '{"doors":["client-ip"],"expiresInMinutes":30}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
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
How long it lives. 60 (an hour) when not given; more than 1440 (a day) is refused
Example
{ "doors": [ "client-ip" ], "expiresInMinutes": 30}Responses
Section titled “ Responses ”The token, once
object
plune_adm_…. Shown once; only its hash is kept
Example
{ "doors": [ "purge" ]}The body is not valid, or the lifetime is over a day
object
Example generated
{ "error": "example"}An admin token was used (code: session_required)
object
Example generated
{ "error": "example"}Not found
object
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.
object
Example generated
{ "error": "example"}Headers
Section titled “Headers ”Seconds until the window rolls over