B2B Saas Authentication

/

API reference

/

Session management

/

Revoke Session

Revoke Session

POSThttps://test.stytch.com/v1/b2b/sessions/revoke

Revoke a Session and immediately invalidate all its tokens. To revoke a specific Session, pass either the member_session_id, session_token, or session_jwt. To revoke all Sessions for a Member, pass the member_id.


Body parameters


member_session_idstring

session_tokenstring

session_jwtstring

member_idstring

Response fields


request_idstring

status_codeint
curl --request POST \
  --url https://test.stytch.com/v1/b2b/sessions/revoke \
  -u 'PROJECT_ID:SECRET' \
  -H 'Content-Type: application/json' \
  -H "X-Stytch-Member-Session: mZAYn5aLEqKUlZ_Ad9U_fWr38GaAQ1oFAhT8ds245v7Q" \
  -d '{
    "member_id": "member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f"
  }'

RESPONSE

200
{
  "status_code": 200,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141"
}

Common Error Types