v4

latestOpenAPI 3.1.1Apache 2.02026-07-31107278570.4 KB
Sessions

Revoke user session

Immediately invalidates a specific user session by session ID, setting its status to 'revoked'. Once revoked, the session cannot be used for any future API requests or application access. Use this endpoint to implement session-level logout, force a user to reauthenticate on a specific device, or terminate suspicious sessions. The revocation is instantaneous and irreversible. Returns the revoked session details including the session ID, user ID, and the revocation timestamp.

post/api/v1/sessions/{session_id}/revoke

Path parameters

session_idstring required

Unique identifier for the session to revoke. Must start with 'ses_' prefix.

Response

Successfully revoked the session. Returns the revoked session details

Example response

{
  "revoked_session": {
    "absolute_expires_at": "2025-01-22T10:30:00Z",
    "created_at": "2025-01-15T10:30:00Z",
    "expired_at": "2025-01-15T12:00:00Z",
    "idle_expires_at": "2025-01-15T11:30:00Z",
    "last_active_at": "2025-01-15T10:55:30Z",
    "logout_at": "2025-01-15T14:00:00Z",
    "session_id": "ses_1234567890123456",
    "status": "revoked",
    "updated_at": "2025-01-15T10:45:00Z",
    "user_id": "usr_1234567890123456"
  }
}