Skip to content

List API tokens

GET
/orgs/{org}/tokens
curl --request GET \
--url https://api.sloose.com/orgs/org_9f3c/tokens \
--header 'Authorization: Bearer <token>'

Every token the org has issued, revoked ones included, with its prefix, creator, last use, expiry and revocation. Never the secret — the server keeps only a hash, so a lost token is replaced, not recovered.

org
required

The org id the session was issued for. A token for one org can never read another.

string
Example
org_9f3c

The org id the session was issued for. A token for one org can never read another.

Every token, revoked ones included.

Media typeapplication/json
object
tokens
required
Array<object>

Never includes the secret — the server keeps only a hash of it.

object
id
required
string
orgId
required
string
name
required
string
prefix
required

The token’s leading characters, for recognising it in a list.

string
role
required
string
createdByUserId
required
string
lastUsedAt
required
string | null
expiresAt
required
string | null
revokedAt
required
string | null
createdAt
required
string
Examplegenerated
{
"tokens": [
{
"id": "example",
"orgId": "example",
"name": "example",
"prefix": "example",
"role": "example",
"createdByUserId": "example",
"lastUsedAt": "example",
"expiresAt": "example",
"revokedAt": "example",
"createdAt": "example"
}
]
}

No bearer, or one that is expired, revoked or no longer resolves to a member.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

The bearer’s role is too low, or it was issued for a different org.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}