Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

Tokens

API tokens (admin).

GET /api/v1/tokens

Live tokens, everyone's (never their secrets). Admin.

Who may call it: an admin.

Answers

POST /api/v1/tokens

Create a service token (it belongs to nobody). Its secret is in this answer only. Admin.

Who may call it: an admin.

Body (application/json): NewToken

Answers

DELETE /api/v1/tokens/{name}

Revoke a token: it stops working at once. Admin.

Who may call it: an admin.

Parameters

InType
name (required)pathtextToken name.

Answers

Shapes

The JSON bodies the operations above take and return.

CreatedToken

FieldType
secrettextThe token itself: shown this once, never stored (only its hash is).
tokenTokenInfo

ErrorBody

FieldType
errortextWhat went wrong, in plain words.

NewToken

FieldType
nametextWho or what uses it, e.g. ci or monitoring.
permissions (optional)list of text or nullpayloads and/or audit. None by default: a token can't read message payloads unless it is given the permission.
role (optional)text or nullviewer (default), operator or admin.

TokenInfo

FieldType
created_attime (RFC 3339)
last_used_at (optional)time (RFC 3339) or nullTo the minute.
nametext
owner (optional)text or nullThe user it belongs to; none for a service token made by an admin.
permissionslist of textpayloads, audit (admins' tokens have all).
roletextviewer, operator or admin.