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 |
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 |
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 |
¶ 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"
}
¶ Endpoint Possible Errors
HTTP Status | Code | Description |
---|---|---|
400 | validation_failed | This error occurs when the product_id field is omitted in the request body. product_id is a mandatory field when updating a guest trip. |
400 | no_product_found | This error occurs when a product_id different from the one used during the trip creation. To avoid this error, ensure the same product_id used during trip creation is passed when updating the trip |
401 | unauthorized | Authorization failed. The client lacks valid auth credentials for the requested resource. |
403 | forbidden | The client does not have permission to access the requested resource. |
404 | not_found | The requested resource or entity could not be found on the server. |
500 | internal_server_error | An unexpected error occurred on the server while processing the request. |