Skip to content

Revoke an API token

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

Takes effect on the token’s next request, which then answers 401 TOKEN_REVOKED. The row stays in the list so the revocation is auditable.

Session only. An org API token is refused here with 403 SESSION_REQUIRED: a token must not be able to mint or revoke tokens.

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.

id
required

The token id from the token list — not the secret.

string
Example
b3f1c8a2

The token id from the token list — not the secret.

Revoked.

Media typeapplication/json
object
ok
required
boolean
revokedAt
required
string | null
Example
{
"ok": true
}

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"
}

No such token, or it is not visible to this session.

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"
}