Three lines

Uber

Developers

Create Health Trip

POSThttps://api.uber.com/v1/health/trips

Privileged and Confidential This endpoint design has been confidentially shared with you. It is still under development and is subject to change without notice. Please do not share this document or API endpoint details with anyone who is not authorized to have access. For more information read about scopes.

Use Case

Use this endpoint to create a new trip request.

Scheduled Rides are dispatched before the scheduled pickup_time such that the driver is expected to arrive at the pickup location at pickup_time. New features are under development to make it easier to know when the driver is given the trip offer.

Authorization

OAuth 2.0 Bearer token with the health scope.

Ride Types
Ride Description
Ride on Demand Request a driver for immediate pickup.
Scheduled Ride Automatically send a driver at a specific time in advance. Riders cannot change the pickup time for a scheduled ride without contacting the partner. Only available in certain areas.
Scheduled Ride - Uber Reserve Reserve a driver at a specific time in advance. Uber Reserve differs from normal scheduled rides in that a driver will be pre-assigned prior to the trip pickup time. More details can be found in the reserve_info descriptions in the /v1/health/trips/estimates call. Only available in certain areas.
Hourly Ride Reserve a driver at a specific time in advance, for predetermined duration and distance. Hourly Rides are also Reserve Rides, so the rules for “Scheduled Ride - Uber Reserve” also apply. Only available in certain areas.
Flexible Ride Set up for riders to redeem on a specific day in advance. A text is sent to provide the rider the ability to request a ride when ready on the specified day. Available everywhere with Uber coverage.
Example Requests

For Sandbox only, the run_id will be needed to be passed in as a header (e.g, -H "x-uber-sandbox-runuuid:4c11a40a-950a-4486-baf4-59858300190b") to take interactive trips.

Example Request for a Ride on Demand
curl -X POST \
  -H 'authorization: Bearer $UBER_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
    "guest" : {
  	  "email": "joe@example.com",
      "first_name": "Joe",
      "last_name": "Example",
      "phone_number": "+15551234567"
    },
    "product_id": "a1111c8c-c720-46c3-8534-2fcdd730040d",
    "pickup": {
      "latitude": 37.776,
      "longitude": -122.417
    },
    "dropoff": {
      "latitude": 37.789,
      "longitude": -122.4
    },
    "contacts_to_notify" : [
      {
          "phone_number": "+14155550001",
          "contact_event": ["TRIP_BEGAN"]
      },
      {
          "phone_number": "+14155550002",
          "contact_event": ["DRIVER_PICKUP_COMPLETED"]
      }
    ]
  }' \
  'https://sandbox-api.uber.com/v1/health/trips'
Example Request for an Hourly Ride
curl -X POST \
  -H 'authorization: Bearer $UBER_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
    "guest" : {
      "email": "joe@example.com",
      "first_name": "Joe",
      "last_name": "Example",
      "phone_number": "+15551234567"
    },
    "product_id": "a1111c8c-c720-46c3-8534-2fcdd730040d",
    "pickup": {
      "latitude": 37.776,
      "longitude": -122.417
    },
    "dropoff": {
      "latitude": 37.789,
      "longitude": -122.4
    },
    "contacts_to_notify" : [
      {
          "phone_number": "+14155550001",
          "contact_event": ["TRIP_BEGAN"]
      },
      {
          "phone_number": "+14155550002",
          "contact_event": ["DRIVER_PICKUP_COMPLETED"]
      }
    ],
    "hourly_params": {
      "time_in_mins": 120,
      "distance": 30,
      "distance_unit": "MILE"
    },
    "scheduling": {
      "pickup_time": 1698439444000
    }
  }' \
  'https://sandbox-api.uber.com/v1/health/trips'
Request body parameters
Name Type Description
guest object object containing guest information.
pickup object Object containing the location of the trip’s pickup point.
dropoff object Object containing the location of the trip’s dropoff point.
scheduling object Object defining the time the request is scheduled for.
contacts_to_notify array (Optional) List of objects containing information about a third-party contact to text trip link.
product_id string Unique identifier of a product. Product IDs for a specific area can be retrieved using the /v1/health/trips/estimates API.
fare_id string (Optional) The unique ID for a fare estimate from the ride request estimate endpoint (required to lock in an upfront fare), or from one of the fare related errors described below.
deferred_ride_options.pickup_day string (Optional) Allows the rider to request a ride at their convenience on a specific day (YYYY-MM-DD). The ride will be dispatched by the rider after they respond to a text message. Mobile phone numbers only.
expense_memo string (Optional) A free text field to describe the purpose of the trip for expense reporting (maxlength 64). This value will appear in the trip receipt and any configured expense-reporting integrations like Uber For Business or Business Profiles.
sender_display_name string (Optional) Name of the sender providing the ride, to be used by Uber in communications with the customer. Please note that names will be truncated at 26 characters. If not set, defaults to the organization name.
note_for_driver string (Optional) A free text field for a coordinator to enter a message that will be sent to the driver once the driver gets assigned to a trip. Please don’t share any sensitive rider info or any Protected Health Information.
call_enabled boolean (Optional) Uber will call riders with trip details if this option is enabled.
return_trip_params object Object containing the parameters to create the return trip.
hourly_params object Object containing booking parameters for Hourly Rides.
Guest object parameters Back to top
Name Type Description
guest.guest_id string Unique identifier of the guest. (Optional if guest has already been created.)
guest.first_name string Rider’s first name. (Required if guest.guest_id is omitted)
guest.last_name string Rider’s last name. (Required if guest.guest_id is omitted)
guest.phone_number string Phone number of a rider in E.164 (international) format. This must be in international format. ex: +15551234567(Required if guest.guest_id is omitted)
guest.email string Rider’s email address. (Optional)
guest.locale string Locale to use when sending text messages to the rider. If not set, defaults to en_US or the locale used for the last create trip request for this guest.
guest.has_coordinator_consented boolean Co-ordinator consent to verify they have guest’s permission to share their data with Uber. (Required for geographies that requires co-ordinator consent).
Pickup object parameters Back to top
Name Type Description
pickup.latitude float Latitude of the starting location of the trip.
pickup.longitude float Longitude of the starting location of the trip.
pickup.address string Address of the starting location of the trip.
pickup.place.place_id string The place ID in provider’s namespace. For pickups at specialized pickups, should be set to the ID of an access point; see the /v1/health/zones API for more detail.
pickup.place.provider string The name of a provider of location data, e.g. google_places. Should be set to uber_geofences for specialized pickups; see the /v1/health/zones API for more detail.
pickup.place.zone_id string (Optional) For trips at specialized pickups, should be set to the ID of the most immediate parent pickup zone; see the /v1/health/zones API for more detail.
Dropoff object parameters Back to top
Name Type Description
dropoff.place.place_id string The place ID in provider’s namespace.
dropoff.place.provider string The name of a provider of location data, e.g. google_places.
dropoff.latitude float Latitude of the end location of the trip.
dropoff.longitude float Longitude of the end location of the trip.
dropoff.address string Address of the end location of the trip.
Scheduling object parameters Back to top
Name Type Description
scheduling.pickup_time int (Optional) The epoch timestamp (in milliseconds) in the future the request is scheduled for. Required for Scheduled, Reserve and Hourly Rides. If none is provided, the request for a ride will be created immediately.
scheduling.dropoff_time int (Optional) The epoch timestamp (in milliseconds) for predicted pickup time based on the dropoff time provided for Uber ReserveSpecific the Estimated Time of Arrival immediately.
Contacts_to_notify object parameters Back to top
Name Type Description
contact_to_notify[].phone_number string Third-party contact phone number to text trip link.
contact_to_notify[].contact_event array Contact event at which to notify third-party about trip. Acceptable values are TRIP_BEGAN and DRIVER_PICKUP_COMPLETED.
Return_trip_params object parameters Back to top
Name Type Description
return_trip_params.start_location object Object containing pickup location details of the return trip.
return_trip_params.start_location.latitude float The latitude of the pickup location of the return trip.
return_trip_params.start_location.longitude float The longitude of the pickup location of the return trip.
return_trip_params.start_location.address string The address of the pickup location of the return trip.
return_trip_params.start_location.place.place_id string The place ID in provider’s namespace. For pickups at specialized pickups, should be set to the ID of an access point; see the /v1/health/zones API for more detail.
return_trip_params.start_location.place.provider string The name of a provider of location data, e.g. google_places. Should be set to uber_geofences for specialized pickups; see the /v1/health/zones API for more detail.
return_trip_params.end_location object Object containing dropoff location details of the return trip.
return_trip_params.end_location.latitude float The latitude of the dropoff location of the return trip.
return_trip_params.end_location.longitude float The longitude of the dropoff location of the return trip.
return_trip_params.end_location.address string The address of the dropoff location of the return trip.
return_trip_params.end_location.place.place_id string The place ID in provider’s namespace. For pickups at specialized pickups, should be set to the ID of an access point; see the /v1/health/zones API for more detail.
return_trip_params.end_location.place.provider string The name of a provider of location data, e.g. google_places. Should be set to uber_geofences for specialized pickups; see the /v1/health/zones API for more detail.
return_trip_params.scheduling.pickup_time int The timestamp (in milliseconds) in the future the return trip is scheduled for.
return_trip_params.deferred_ride_options.pickup_day string Allows the rider to request a return ride at their convenience on a specific day (YYYY-MM-DD). The return ride will be dispatched by the rider after they respond to a text message. Mobile phone numbers only.
return_trip_params.product_id string Unique identifier of a product. Product IDs for a specific area can be retrieved using the /v1/health/trips/estimates API.
return_trip_params.fare_id string (Optional) The unique ID for a fare estimate from the ride request estimate endpoint (required to lock in an upfront fare), or from one of the fare related errors described below.
return_trip_params.note_for_driver string (Optional) A free text field for a coordinator to enter a message that will be sent to the driver once the driver gets assigned to a trip. Please don’t share any sensitive rider info or any Protected Health Information.
Hourly_params object parameters Back to top
Name Type Description
hourly_params.time_in_mins int Time to be booked, in minutes. Time and distance must match one of the hourly tier objects, as returned by the /v1/health/trips/estimates API.
hourly_params.distance int Distance to be booked. Time and distance must match one of the hourly tier objects, as returned by the /v1/health/trips/estimates API.
hourly_params.distance_unit string Unit for distance to be booked. Possible values are MILE and KM. Time and distance must match one of the hourly tier objects, as returned by the /v1/health/trips/estimates API.
Example Response
{
  "eta": 7,
  "guest": {
    "email": "joe@example.com",
    "first_name": "Joe",
    "guest_id": "OVmNxPG1ENYSwn8QonwLapF3ZJl2KJipkUc0AP3C74U=",
    "last_name": "Example",
    "phone_number": "+15551234567"
  },
  "product_id": "a1111c8c-c720-46c3-8534-2fcdd730040d",
  "request_id": "def481ba-f21b-43f8-9ab3-5bdbc603af0c",
  "status": "processing"
}
Name Type Description
eta int (deprecated) Estimated time of vehicle arrival in minutes. Null if no drivers available at time of request.
guest object Root guest object containing an array of guests.
guest.guest_id string Unique identifier of a rider.
guest.first_name string Rider’s first name.
guest.last_name string Rider’s last name.
guest.email string Rider’s email address.
guest.phone_number string Phone number of a rider in E.164 (international) format.
guest.locale string The locale that will be used for text messages sent to the rider for this trip.
estimate_info.pickup_time int The timestamp (in milliseconds) for predicted pickup time based on the dropoff time provided for Uber ReserveSpecific the Estimated Time of Arrival
estimate_info.eta int The estimated time of vehicle arrival in minutes. Null if no drivers available at time of request.
product_id string Unique identifier of a product.
request_id string Unique identifier of a trip.
status string Current status of the trip, processing most of the time.
surge_multiplier float The surge pricing multiplier used to calculate the increased price of a trip request. A multiplier of 1.0 means surge pricing is not in effect.
pickup object Pickup details are snapped to an Access Point when a trip is created. If the pickup location isn’t snapped, the details will be omitted.

Pickup object response

The following table provides a detailed breakdown of the pickup location.

Field Type Description
pickup.address string The address of the pickup location.
pickup.is_refined boolean Indicates whether the pickup location is snapped.
pickup.latitude float The latitude coordinate of the pickup location.
longitude float The longitude coordinate of the pickup location.
pickup.timezone string The timezone of the pickup location.
pickup.title string A brief title or name for the pickup location.
pickup.subtitle string A subtitle or additional information about the pickup location.
pickup.status string The current status of the pickup.
pickup.update_details string Additional details or updates about the pickup.
pickup.rider_wayfinding_note string Notes to assist the rider in finding the pickup location.
pickup.place object Contains details about the place.
pickup.place.place_id string Unique identifier for the place.
pickup.place.provider string The provider of the place information, e.g., “uber_places”.
pickup.place.zone_id string An identifier for the zone, if applicable.
Errors

A trip request can fail due to higher than normal fares which will require the request to be retried to acknowledge the new fare. The request will fail with a 409 status code and the error body will include a fare_id to use in a subsequent trip request. A fare_id can also expire if the time between the estimate and trip request is too long. fare_display could be null if fares are unavailable.

To avoid 409 errors altogether, you can get a current fare_id from the /trips/estimates call and pass it in with your trip request. By passing in the fare_id, it means you are implicitly accepting the current surge, since it is already present in the estimate that you received.

Error Metadata
Name Type Description
fare_id string A new unique fare ID that should be used to re-request the ride
fare_display string The price estimate range. Could be null if fare estimates are unavailable.
multiplier float The surge pricing multiplier used to calculate the increased price of a ride request. A multiplier of 1.0 means surge pricing is not in effect.
expires_at int Timestamp in seconds. Only non-null if there is a surge multiplier greater than 1.

Example error 1:

Status-code: 409 Conflict

{
  "code": "surge",
  "message": "Fare is higher than normal, request again to confirm",
  "metadata": {
    "fare_id": "dcf8a733-7f11-4544-a9c7-ddea71e46146",
    "fare_display": "$12-15",
    "multiplier": 1.4,
    "expires_at": 1501684062
  }
}

Example error 2:

Status-code: 409 Conflict

{
  "code": "fare_expired",
  "message": "The fare estimate has expired, request again to confirm",
  "metadata": {
    "fare_id": "dcf8a733-7f11-4544-a9c7-ddea71e46146",
    "fare_display": "$9-11",
    "multiplier": 1,
    "expires_at": 1501684062
  }
}

Uber

Developers
© 2023 Uber Technologies Inc.