Token (Admin)

Update the token policy

Merge-updates the token policy. Only the fields provided in the request body are updated; unspecified fields retain their current values. Requires admin (sudo) privileges. Changes take effect immediately for new token operations.

put/api/admin/tokens/policy

Headers

X-EDH-USERstring required

Admin username

X-EDH-TOKENstring required

Admin authentication token

Request body

max_tokens_per_userinteger

Maximum number of active tokens per user

max_lifetime_hoursinteger

Maximum token lifetime in hours (up to 1 year)

default_lifetime_hoursinteger

Default token lifetime when not specified by user

max_renewalsinteger

Maximum number of renewals per token

renewal_allowedboolean

Whether token renewal is allowed globally

require_expirationboolean

Whether all tokens must have an expiration

global_denyobject

Paths blocked for all scoped tokens. Keys are path patterns (prefix with /api/, suffix with * for wildcard). Values are arrays of HTTP methods.

Response

Policy updated successfully (returns merged policy)

successboolean

Example response

{
  "success": true
}

Changes