Revoke session tokens
/session-token
The kill switch. Revokes every live session token for one tenant in one environment, and only those — a tenant with the same id in another environment is untouched.
Revocation takes effect immediately: the next request made with a revoked token gets 401, and renewal of it fails the same way.
Tenant existence is deliberately not required. Sessions outlive the row they were minted against, so revoking against a tenant that has since been deleted still works and simply reports how many live sessions it found. There is no 404 on this route — a tenant with no live sessions returns 200 with "revoked_count": 0.
Request Body
The environment to revoke in. Required for user-session auth. Defaults to the API token's own environment for API-token auth.
8a2b104d-74a6-47f2-b93e-c6b611e82391The tenant whose sessions should be revoked. Free-form up to 255 characters, excluding control characters, leading or trailing whitespace, and the dot segments . and ...
acme-1Response Body
How many live sessions were revoked. Zero when the tenant had none.
2Errors
| Status | Description |
|---|---|
400 | Missing or malformed body, a tenant_id outside the allowed pattern, or user-session auth without environment_id. |
401 | No credential, or an expired one. |
403 | The caller is not an API token or user session (a session token cannot revoke its own family), or does not have access to the requested environment. |
curl -X DELETE 'https://api.truto.one/session-token' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json'const response = await fetch('https://api.truto.one/session-token', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer <your_api_token>',
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);import requests
url = "https://api.truto.one/session-token"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
response = requests.delete(url, headers=headers, params=params)
print(response.json())