CreateTokenRequest
HTTP API schema
← HTTP API referenceView source specification ↗
Create an expiring, revocable access key for API use or website sign-in.
CreateTokenRequest fields
- purposeTokenPurpose
purpose: Reference TokenPurpose
- subject
string 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_in
integer Lifetime in seconds, default 3600. Website sign-in keys require a positive lifetime of at most 604800 (seven days).
- scope
string Space-separated scopes. Optional; default no scopes. See scopes documentation for allowed values and semantics.
- label
string Optional human-readable label for the token (e.g. "CLI token").