Revoke a session token
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-staging.keystoneos.xyz/v1/sessions/{token_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-staging.keystoneos.xyz/v1/sessions/{token_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)curl --request DELETE \
--url https://api-staging.keystoneos.xyz/v1/sessions/{token_id} \
--header 'Authorization: Bearer <token>'{
"token_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revoked": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
],
"code": "VALIDATION_ERROR",
"docs_url": "https://docs.keystoneos.xyz/guides/error-codes#validation-error"
}Sessions
Revoke a session token
Requires the sessions:write scope (as an M2M scope or a user permission).
Immediately invalidate a session token before it expires. Revocation is scoped to the caller’s own environment, matching minting: the caller must be acting in the environment the token was minted in (for user tokens, the environment selected via the X-Keystone-Environment header). Any credential of that environment may revoke, not only the one that minted the token. A token minted in any other environment returns 404.
DELETE
/
v1
/
sessions
/
{token_id}
Revoke a session token
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-staging.keystoneos.xyz/v1/sessions/{token_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-staging.keystoneos.xyz/v1/sessions/{token_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)curl --request DELETE \
--url https://api-staging.keystoneos.xyz/v1/sessions/{token_id} \
--header 'Authorization: Bearer <token>'{
"token_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revoked": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
],
"code": "VALIDATION_ERROR",
"docs_url": "https://docs.keystoneos.xyz/guides/error-codes#validation-error"
}Authorizations
Auth0 JWT access token. See Authentication for details.