Skip to navigation

Driver Logout (All Devices)

View as Markdown

Revokes all active refresh tokens and increments the session version for the authenticated driver, terminating active sessions across all devices simultaneously.


Endpoint Overview

  • Method: POST

  • Route: /api/v1/driver/auth/logout-all

  • Authentication: Bearer Token (Driver JWT)

  • Content-Type: N/A


Request Headers

HeaderTypeRequiredDescription
AuthorizationstringYesFormat: Bearer

Request Body Schema

None (No request body needed)


Response Body Schema (200 OK)

Top-Level KeyData TypeDescription
messagestringLogout confirmation ("Logged out from all devices successfully")

Response Examples

1. 200 OK — Success

{
"message": "Logged out from all devices successfully"
}

2. 401 Unauthorized — Missing / Expired Token / Revoked Session

{
"error": "Unauthorized",
"message": "Invalid or expired driver access token."
}

3. 401 Unauthorized — Missing Token Header

{
"error": "Unauthorized",
"message": "Driver access token is missing. Header format must be &#x27;Bearer <token>&#x27;."
}

4. 403 Forbidden — Account Blocked / Deactivated

{
"error": "Forbidden",
"message": "Driver account is blocked or deactivated."
}

5. 500 Internal Server Error

{
"error": "Failed to log out from all devices"
}

Status Codes Reference

HTTP Status CodeCondition
200 OKAll active refresh tokens revoked and driver session version incremented.
401 UnauthorizedMissing, invalid, expired token or session already revoked.
403 ForbiddenDriver account is deactivated or blocked.
500 Internal Server ErrorServer or database error while updating token records.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.