Skip to main content
POST
/
v1
/
sessions
/
revoke
C#
// POST /v1/sessions/revoke
const stytch = require('stytch');

const client = new stytch.Client({
  project_id: '${projectId}',
  secret: '${secret}',
});

const params = {
  session_token: "${sessionToken}",
};

client.Sessions.Revoke(params)
  .then(resp => { console.log(resp) })
  .catch(err => { console.log(err) });
{
  "request_id": "<string>",
  "status_code": 123
}
Revoke a Session, immediately invalidating its session token. You can revoke a session in three ways: using its ID, its session token, or one of its JWTs. This endpoint requires exactly one of those to be included in the request. It will return an error if multiple are present.

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json

Request type

session_id
string

The session_id to revoke.

session_token
string

The session token to revoke.

session_jwt
string

A JWT for the session to revoke.

Response

Successful response

request_id
string
required

Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.

status_code
integer<int32>
required

The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.