Update a driver
PATCH/v1/drivers/:id
Updates driver information. Password will be hashed if provided. Username uniqueness is validated.
Request
Path Parameters
Driver ID
- application/json
Body
required
0- Male1- Female2- Other
Supplier ID
Operation zone IDs
First name
Last name
Phone
Password
Home address
City
State
Zip code
Date of birth
Possible values: [0, 1, 2]
Default value: 0
Gender of the driver:
Notes
Ability to switch to any vehicle
Responses
- 200
- 404
- 409
Driver updated successfully
- application/json
- Schema
- Example (from schema)
Schema
The ID of the driver
The supplier ID of the driver
The rating of the driver
The zone IDs of the driver
The first name of the driver
The last name of the driver
The full name of the driver
The phone of the driver
The username of the driver
The email of the driver
The home address of the driver
The city of the driver
The state of the driver
The zip code of the driver
The date of birth of the driver
The gender of the driver
The notes of the driver
The avatar of the driver
Whether the driver is active
{
"_id": "672d07188234567890123456",
"supplierId": "672d07188234567890123456",
"rating": 4.5,
"zoneIds": [
"672d07188234567890123456"
],
"firstName": "John",
"lastName": "Doe",
"fullName": "John Doe",
"phone": "+1234567890",
"username": "john.doe",
"email": "john.doe@example.com",
"homeAddress": "123 Main St",
"city": "New York",
"state": "NY",
"zipCode": "10001",
"dateOfBirth": "1990-01-01",
"gender": 0,
"notes": "This is a note",
"avatar": "https://example.com/avatar.png",
"isActive": true
}
Driver not found
Phone number already exists