List API tokens
curl --request GET \
--url https://my.server.express/api/v1/user/tokens \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://my.server.express/api/v1/user/tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/user/tokens"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"success": true,
"data": {
"tokens": [
{
"id": "<string>",
"name": "<string>",
"prefix": "<string>",
"scopes": [
"services:read"
],
"expiresAt": "2023-11-07T05:31:56Z",
"expired": true,
"lastUsedAt": "2023-11-07T05:31:56Z",
"lastUsedIp": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"scopes": [
{
"key": "services:read",
"label": "<string>",
"description": "<string>",
"destructive": true
}
]
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}API Tokens
List API tokens
The caller’s live (unrevoked) tokens, newest first, plus the full scope catalogue so the UI needn’t hardcode it. Session only — a token can never manage tokens.
GET
/
v1
/
user
/
tokens
List API tokens
curl --request GET \
--url https://my.server.express/api/v1/user/tokens \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://my.server.express/api/v1/user/tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/user/tokens"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"success": true,
"data": {
"tokens": [
{
"id": "<string>",
"name": "<string>",
"prefix": "<string>",
"scopes": [
"services:read"
],
"expiresAt": "2023-11-07T05:31:56Z",
"expired": true,
"lastUsedAt": "2023-11-07T05:31:56Z",
"lastUsedIp": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
],
"scopes": [
{
"key": "services:read",
"label": "<string>",
"description": "<string>",
"destructive": true
}
]
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}