Enrol a Driver in Carpool
POST/carpool/drivers
Enrols a driver that already exists and is active in the fleet. The driver
record is not created or changed, only the Carpool link and the department.
A driver that is already enrolled returns 409.
The three flags decide what the driver may do. At least one must be true,
otherwise nothing would be enrolled and the answer is 422.
Each flag belongs to an account setting in the Carpool booking settings.
| Flag | Carpool setting |
|---|---|
can_book_carpool | Drivers can book carpool |
allow_system_auto_booking | Drivers can auto booking |
allow_specific_vehicle_booking | Drivers can book specific vehicles |
A flag only takes effect while its setting is switched on for the account.
Setting a flag to true therefore switches that setting on for the whole
account if it was off, the same as in FleetWeb. These three settings are
not listed or changed by GET /carpool/rules and
PATCH /carpool/rules/{booking_rule_id}, so the API has no way to switch
one back off. Do that in FleetWeb if the account had turned one off on
purpose.
A driver that GET /carpool/drivers would not list, because the subuser who
created the driver has no view permission on drivers, answers 404 and
nothing is written. A listed driver needs the owner subuser to hold both the
view and the edit permission on drivers. Without it the answer is 403 with the reason code
CARPOOL_DRIVER_OWNER_PERMISSION_DENIED and nothing is written. A driver created by
the main account, or by a subuser with no driver permission set, is never
refused for this reason.
This operation is available to the main account only.
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- 422
- 429
- 500
- 503
The enrolled driver.
The request body is declared as JSON but cannot be parsed, or is not a JSON object or array. Nothing was processed.
Unauthorized access. Authentication is required.
Access is forbidden, and nothing was written. Either the caller is not the main account, or the driver is listed by GET /carpool/drivers but the subuser who owns the driver does not hold the permission the operation needs.
The requested resource was not found.
The vehicle or driver is already enrolled in Carpool. Nothing was written.
Request field validation or Carpool business validation failed.
Too Many Requests - the endpoint's rate limit has been exceeded. Retry after the number of seconds in the Retry-After header.
Response Headers
Seconds to wait before retrying. The same value as X-RateLimit-Retry-After-Seconds when that wait is non-negative. If the computed wait is negative, Retry-After is floored at 0.
Unix timestamp of the next earliest successful request.
Seconds until the next earliest successful request.
Internal server error.
Service temporarily unavailable. The request did not complete and can be retried after the number of seconds in the Retry-After header, when one is sent.
Response Headers
Seconds to wait before retrying. Sent with db_busy and db_pool_timeout.