Skip to content

CreateTokenRequest

HTTP API schema

← HTTP API reference

Create an expiring, revocable access key for API use or website sign-in.

CreateTokenRequest fields

purposeTokenPurpose

purpose: Reference TokenPurpose

subjectstring

Identity for the token. Use ~self for the current user (resolved to the authenticated principal at create time), or that same principal's full path. Other principals are rejected.

expires_ininteger

Lifetime in seconds, default 3600. Website sign-in keys require a positive lifetime of at most 604800 (seven days).

scopestring

Space-separated scopes. Optional; default no scopes. See scopes documentation for allowed values and semantics.

labelstring

Optional human-readable label for the token (e.g. "CLI token").

View source specification ↗