List API tokens
GET
/api/v1/account/tokens
const url = 'http://127.0.0.1:8080/api/v1/account/tokens';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://127.0.0.1:8080/api/v1/account/tokens \ --header 'Authorization: Bearer <token>'Returns safe metadata and the instance token policy, never a token secret. Uses the persisted local-mode user when authentication is disabled. Otherwise an authenticated browser session is required, except for the current account and sign-in. Modifying authenticated requests require the current X-CSRF-Token. Credentials and responses must not be cached.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Operation completed.
Media typeapplication/json
object
policy
required
object
allow_nonexpiring
required
boolean
default_days
required
integer format: int64
maximum_days
required
integer format: int64
key
additional properties
any
tokens
required
Array<object> | null
object
created_at
required
integer format: int64
expires_at
required
integer format: int64
id
required
string
last_used_at
required
integer format: int64
libraries
required
Array<string> | null
name
required
string
revoked_at
required
integer format: int64
scopes
required
Array<string> | null
key
additional properties
any
key
additional properties
any
Examplegenerated
{ "policy": { "allow_nonexpiring": true, "default_days": 1, "maximum_days": 1 }, "tokens": [ { "created_at": 1, "expires_at": 1, "id": "example", "last_used_at": 1, "libraries": [ "example" ], "name": "example", "revoked_at": 1, "scopes": [ "example" ] } ]}No valid session or API token (authentication-required), or the credential sent is invalid (invalid-credentials).
Media typeapplication/problem+json
object
code
required
string
detail
required
string
status
required
integer format: int64
title
required
string
type
required
string
key
additional properties
any
Examplegenerated
{ "code": "example", "detail": "example", "status": 1, "title": "example", "type": "example"}default
Section titled “default”Stable account problem code; authentication, authority, validation or lifecycle conflict.
Media typeapplication/problem+json
object
code
required
string
detail
required
string
status
required
integer format: int64
title
required
string
type
required
string
key
additional properties
any
Examplegenerated
{ "code": "example", "detail": "example", "status": 1, "title": "example", "type": "example"}