Docs
Live demo

Preview which tokens the longest lifetime would stop

GET/api/v2/api-tokens/policy/preview
Signed-in sessionConsole session only

List the usable tokens of the organization whose lifetime exceeds the given longest lifetimes, and when each would stop working if the limits applied to existing tokens: at its creation time plus the limit, or at once when that moment has passed. The console shows it before an administrator turns on cap_existing or lowers a limit while it is on. Needs security:read. At most 1000 tokens are examined. The summary is returned to every caller. The list of tokens with their names and owners only to a caller who may also read tokens (tokens:read), otherwise items is empty and details_hidden is true.

Shows tokens stopped by a proposed max lifetime. Callers without tokens:read get summary only (items: [], details_hidden: true).

Parameters

Query2 required of 2
max_lifetime_daysintegerqueryrequired

Longest lifetime of a token, in days

min 1 · max 366
security_max_lifetime_daysintegerqueryrequired

Longest lifetime of a token that may make security changes, in days

min 1 · max 366

Responses

200

OK

APITokenCapPreviewResponse · 4 fields
itemsarray of APITokenCapPreviewItemrequired

The affected tokens. Empty when details_hidden is true.

8 fields
idstring · uuidrequired
kindstringrequired
personalorganization
namestringrequired
bound_memberAPITokenMemberRefrequired
2 fields
idstring · uuidrequired

Identity ID. Null when the identity was deleted.

can be null
labelstringrequired
created_atstring · date-timerequired
expires_atstring · date-timerequired
stops_atstring · date-timerequired

When the token stops working under the given limits, its creation time plus the limit.

stops_nowbooleanrequired

True when that moment has passed, so the token stops at once.

truncatedbooleanrequired

True when more than 1000 tokens exceed the limits and the list shows the first 1000 by creation time.

How many of the examined tokens stop working under the given limits, and when the first one stops.

5 fields
tokensintegerrequired
organization_tokensintegerrequired
personal_tokensintegerrequired
stop_at_onceintegerrequired

Tokens whose stop moment has already passed, so they stop as soon as the limits are saved.

next_stop_atstring · date-timerequired

The earliest stop among the tokens that do not stop at once. Null when there is none.

can be null
details_hiddenbooleanrequired

True when the caller can't read tokens (tokens:read), so the response has the summary only.

400

Bad Request: a limit is missing or out of range

401

Unauthorized: no console session or API token

403

Forbidden: the role does not allow reading security settings

Common errors: 429 504. They mean the same for every operation, see Errors.

↑ ↓ to moveEnter to openEsc to close