duty-status
Toggles the real-time availability and duty state of the driver (ONLINE, OFFLINE, or ON_TRIP).
⚠️ Business Rule: A driver can only go
ONLINEif their account status isAPPROVED. If the account status isPENDING_ONBOARDING,PENDING_APPROVAL,REJECTED, orSUSPENDED, the backend rejects the request with HTTP403 APPROVAL_REQUIRED.
Endpoint Overview
-
Method:
PATCH -
Route:
/api/v1/driver/duty-status -
Authentication:
Bearer Token (Driver JWT) -
Content-Type:
application/json
Request Headers
Request Body Schema
Example Request Body (Going Online)
Example Request Body (Going Offline)
Response Body Schema (200 OK)
driver Object Fields
Response Examples
1. 200 OK — Duty Status Updated (Online)
2. 403 Forbidden — Approval Required to Go Online
Returned when an unapproved driver (e.g. PENDING_ONBOARDING or PENDING_APPROVAL) attempts to set duty_status: "ONLINE":
3. 400 Bad Request — Validation Error (Invalid Duty Status)
4. 401 Unauthorized — Missing / Expired Token / Session Revoked
5. 404 Not Found — Driver Not Found
6. 500 Internal Server Error
Status Codes Reference
Authentication
AuthorizationBearer
Bearer authentication of the form Bearer <token>, where token is your auth token.