POST Logout
/openmlbb/user/auth/logout
API Path: /api/user/auth/logout
Invalidate the player's session using the JWT obtained from /api/user/auth/login. This endpoint terminates the current authenticated session, ensuring that the JWT can no longer be used for authorized requests.
Headers:
- Authorization:
Bearer <jwt>(JWT obtained during login).
The response confirms whether the logout was successful:
- code: Status code (0 indicates success).
- data: Empty string (no payload returned).
- msg: Message string (e.g., 'ok').
Note: Although the login response also includes a token field, only the JWT is required for logout. The server uses the JWT to invalidate the session.
This endpoint requires JWT. Pass the token via the SDK call argument jwt="YOUR_JWT".
Python Example
from OpenMLBB import OpenMLBB
client = OpenMLBB()
response = client.user.logout(jwt="YOUR_JWT")
print(response)