Enable or disable an API token

Moves the token between active and disabled by setting state. Disabling takes effect
immediately: the token stops authenticating until it is re-enabled. Setting the state a
token already has succeeds and changes nothing.

The two directions are not symmetric. Disabling a token whose expiry has passed succeeds,
but re-enabling an expired token returns 422 — expiry is final, and a new token has to be
created instead. deleted and expired are not accepted values: a token is deleted through
the delete operation, and expires on its own.

With dryRun=true nothing is written and the response body is the token as it would look
after the change, so a 422 here means a real request would also be refused. Requires the
serviceAccountManager permission.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required
length ≥ 1

ID of the service account that owns the token, as returned in the id field by the service account list and create operations.

string
required
length ≥ 1

API token ID, as returned in the id field by the token list and create operations.

Query Params
boolean
Defaults to false

If true, validates the request and returns the would-be result without applying it. The response then carries the X-Dry-Run header.

Body Params

The state to move the token to.

The state to move an API token to.

string
enum
required

active to enable the token, disabled to stop it authenticating. Any other value, deleted and expired included, returns 400. Re-enabling a token whose expiry has passed returns 422.

Allowed:
Headers
string
required
length between 1 and 255

Client-generated key (UUID v4 or ULID recommended). Retrying with the same key and request returns the stored response instead of repeating the operation; the key is kept for 24 hours.

string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
application/problem+json