Create a new driver
POST/v1/drivers
Creates a new driver account in the system. If no supplierId is provided, the first company of the fleet will be used. Passwords are automatically hashed.
Request
- 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:
Notes
Ability to switch to any vehicle
Responses
- 201
- 400
- 409
Driver successfully created
- 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
}
Invalid input data
Phone number already exists