[API] Upsert shift
The Upsert API is designed for suppliers to share shift information for their drivers with Uber.
¶ Use case
By using the Upsert Shift API, suppliers will enable Uber to better manage their drivers such as improving driver-vehicle utilization near end of shift by providing trips that takes them near the vehicle drop-off location, and many other features.
¶ Support for Hierarchical Data
The API operates within the hierarchical structure of the organization linked to the developer’s account at the time of setup.
¶ Supported supplier types
Fleets
¶ Scopes
vehicle_suppliers.shifts.management
¶ Resource
/v1/vehicle-supplier/shifts/driver/:driver_id
¶ HTTP Method
POST
¶ Authorization
¶ Example Request
curl -X POST "https://api.uber.com/v1/vehicle-supplier/shifts/driver/:driver_id" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data '{
"shift": {
"start_time_utc": 1795578688000,
"end_time_utc": 1795593088000,
"metadata": {
"start_location": {
"latitude": 123,
"longitude": 456
},
"end_location": {
"latitude": 123,
"longitude": 456
}
}
}
}'
¶ Request Path Parameters
Name | Type | Description |
---|---|---|
driver_id |
string | Driver ID for whom the shift is planned |
¶ Request Body Parameters
Name | Type | Description |
---|---|---|
shift |
object | details for planned shift |
¶ Example Response
Status-code: 200
{
"shift_upserted": true
}
¶ Response Body Parameters
Name | Type | Description |
---|---|---|
shift_upserted |
bool | flag representing that the operation was successful |
¶ Shift
Name | Type | Description |
---|---|---|
start_time_utc |
int64 | start time of the shift in epoch milliseconds |
end_time_utc |
int64 | end time of the shift in epoch milliseconds |
metadata |
object | additional metadata related to shift |
¶ Metadata
Name | Type | Description |
---|---|---|
start_location |
object | start location of the shift |
end_location |
object | end location of the shift |
¶ Location
Name | Type | Description |
---|---|---|
latitude |
double | latitude of the shift |
longitude |
double | longitude of the shift |
¶ Rate limit
- The rate limit for this endpoint is 1 request per second.
¶ Endpoint Specific Errors
Http Status Code | Code | Message |
---|---|---|
400 |
bad_request | The request parameters are invalid, rate limited, code cancelled etc. |
401 |
unauthorized/permission denied | |
500 |
internal_server_error | Internal server error |
Note
- Shifts are expected to be provided near the time driver goes offline or online
- Latest API call will be treated as authoritative, so any overlapping shift will be replaced
- Overlapping shifts can not be booked
- All the parameters in the request body are mandatory
- Resolution of shifts will be reduced to minutes