POST
/v1/mgmt/user/logout/session

Authorization

Descope Project ID and Management Key
AuthorizationBearer <token>

Project ID:Management Key as bearer token.

In: header

Request Body

application/json

loginId?string

The user's login identifier (external ID). Provide either loginId or userId.

userId?string

The user's ID. Provide either loginId or userId.

sessionId*string

The session to log out: the fti claim of the session's session JWT or refresh JWT, or the refresh JWT's jti when it has no fti. A session JWT's own jti is not a session id.

Length1 <= length

Log a user out of a single session, identified by user and session id, using a valid management key. The user's other sessions keep working. Use this to end one device's session - for troubleshooting or in response to a suspected compromise - when you do not hold that session's refresh token; to end every session of a user, use the logout endpoint instead. Identify the user by loginId or userId, and name the session with its sessionId: the fti claim of the session's session JWT or refresh JWT (the session JWT carries it when the project's JWT template adds a jti), or the refresh JWT's jti when it has no fti. A session JWT's own jti is not a session id. Once logged out the session can no longer refresh, and already-issued session JWTs for it are rejected by online validation rather than only lapsing at expiration. Only a session the endpoint can identify is logged out: one of the user's most recent active sessions, which Descope tracks (the last 5 by default). Any other sessionId - one that is unknown, expired, or older than the tracked sessions - is refused with a not-found error and nothing is logged out. Repeating the call for a session that was already logged out succeeds without changing anything, and the response's alreadyRevoked field is true.

curl -X POST "https://api.descope.com/v1/mgmt/user/logout/session" \  -H "Content-Type: application/json" \  -d '{    "sessionId": "string"  }'
{  "alreadyRevoked": true}
export interface Response {/** * True when the session was already logged out before this call, so the request changed nothing. False when this call logged it out. */alreadyRevoked?: boolean}
Was this helpful?