Update Health Trip
PUThttps://api.uber.com/v1/health/trips/{trip_id}
¶ Use Case
Makes changes to a trip, which will be updated to whatever values are set for each field in the request. This means that not setting certain fields will delete any existing values for those fields.
NOTE: Update trip feature is only available for On-demand trips at the moment. Update is not supported yet for Scheduled/Flex/Reserve trip types.
¶ To update an active ride (a trip dispatched to a driver)
Only the destination and intermediate stops can be updated for active rides. You will need to ensure any fields other than the destination and the requested stops are the same as what they were set to when the trip was created. You can call GET /v1/health/trips/{trip_id} to retrieve those fields.
After updating them, subsequent calls to GET /v1/health/trips/{trip_id} will show the latest destination and requested stops updated in the destination
and stop
fields of the response.
¶ Authorization
OAuth 2.0 Bearer token with the health
scope.
¶ Request Parameters
Name | Type | Description |
---|---|---|
trip_id |
string |
(Required) The unique ID of the ride request. |
end_location |
object |
(Required) All fields can be updated before a trip has reached a terminal state. Object containing destination details. |
end_location.latitude |
float |
(Required) The destination latitude |
end_location.longitude |
float |
(Required) The destination longitude |
end_location.place |
struct |
(Optional) This controls the address shown to the driver. If not set, the address shown will be reverse geocoded by Uber using the latitude/longitude. |
end_location.place.place_id |
string |
(Required if setting place ) The place ID in provider’s namespace. |
end_location.place.provider |
string |
(Required if setting place ) The name of a provider of location data, e.g. google_places |
expense_memo |
string |
(Optional) Can only be updated before a trip has been dispatched to a driver. |
note_for_driver |
string |
(Optional) Can only be updated before a trip has been dispatched to a driver. |
product_id |
string |
(Required) The unique ID of the product being requested. Product IDs for a specific area can be retrieved using the /v1/guests/trips/estimates API. Can only be updated for a flexible ride before the trip has been redeemed by the rider. |
requested_stops |
array |
(Optional) An array of objects containing the location of the trip’s intermediate stops. |
requested_stops[].latitude |
float |
(Required if setting requested_stops ) The intermediate stop latitude |
requested_stops[].longitude |
float |
(Required if setting requested_stops ) The intermediate stop longitude |
requested_stops[].place |
struct |
(Optional) This controls the address shown to the driver. If not set, the address shown will be reverse geocoded by Uber using the latitude/longitude. |
requested_stops[].place.place_id |
string |
(Required if setting place ) The place ID in provider’s namespace. |
requested_stops[].place.provider |
string |
(Required if setting place ) The name of a provider of location data, e.g. google_places |
start_location |
object |
(Required) Can only be changed for flexible rides before they have been redeemed. Object containing pickup location details. |
start_location.latitude |
float |
(Required) The pickup location latitude |
start_location.longitude |
float |
(Required) The pickup location longitude |
start_location.place |
struct |
(Optional) This controls the address shown to the driver. If not set, the address shown will be reverse geocoded by Uber using the latitude/longitude. |
start_location.place.place_id |
string |
(Required if setting place ) The place ID in provider’s namespace. |
start_location.place.provider |
string |
(Required if setting place ) The name of a provider of location data, e.g. google_places |
¶ Example Request
curl -X PUT \
-H "authorization: Bearer $UBER_TOKEN" \
-H 'content-type: application/json' \
-d '{
"start_location": {
"latitude": 40.753,
"longitude": -73.9867
},
"end_location": {
"latitude": 40.7484,
"longitude": -73.9857
},
"requested_stops": [
{
"latitude": 40.7284,
"longitude": -73.9357
},
{
"latitude": 40.7322,
"longitude": -73.9682
}
],
"product_id":"b8e5c464-5de2-4539-a35a-986d6e58f186"
}' \
https://$api_url/v1/health/trips/{trip_id} | jq .
A successful request will receive a 200 with an empty response.
¶ Expected Errors
{
"code": "validation_failed",
"data": {
"invalid_field_changed": "start_location"
},
"message": "Only destination can be updated for active rides"
}
{
"code": "bad_request",
"message": "The ride that has reached a final state and cannot be updated."
}
{
"message": "You can only adjust your pickup point within the area shown.",
"data": {
"statusCode": "400"
},
"errCode": "pickup_cannot_be_updated"
}
{
"message": "Sorry, you are not eligible for a pickup location change!",
"data": {
"statusCode": "400"
},
"errCode": "pickup_cannot_be_updated"
}
¶ Internal Server Errors
{
"message": "Something went wrong - please try again.",
"data": {
"statusCode": "500"
},
"errCode": "internal_server_error"
}