Three lines

Uber

Developers

Status Change Notification

WEBHOOK: POSThttps://<YOUR_WEBHOOK_URI> event_type: health.status_changed

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.

Event indicating that the status of a trip has changed.

Retry Attempts

If for some reason the Uber API cannot reach the webhook URL you specified either due to networking issues or application issues on your end, the webhooks service will retry to make a request.

We have implemented an exponential back-off algorithm with a back-off multiplier of 30 seconds which will make up to 7 attempts. This means we will attempt to request your webhook URL up to 7 times across roughly 1 hour.

Webhook Headers

The Uber API will insert specialized headers for all requests made to your webhook URL to help your application utilize them appropriately.

Header Description
X-Environment Indicates if this request is coming from the production or sandbox API.
X-Uber-Signature SHA256 hash of the request body, computed using the app’s signing key as the key.

Webhook Security

Webhook messages are signed so that your app can verify that the sender is Uber. Webhooks requests contain an X-Uber-Signature header. The value of this field is a hexadecimal HMAC signature of the webhook HTTP request body, using signing key of primary webhook url as a key and SHA256 as the hash function.

Python Example

digester = hmac.new(signing_key, webhook_body, hashlib.sha256)
return digester.hexdigest()

Due to a strict interpretation of the JSON specification by JavaScript, if there are backslashes sent in the POST body, they will be removed upon parsing. This prevents webhook receivers implemented in NodeJS from verifying the webhook signature accurately. We are working on removing all backslashes from the payload in order to avoid this situation and will remove this note when that work is done.

Webhook Event Structure

Name Type Description
event_id string Unique event identifier, which can be used to ensure that events are only digested once.
event_time integer Unix timestamp of the time the event occurred.
event_type string The type of event that occurred.
resource_href string The URL of the resource being referenced. This URL can be called with your App’s bearer token to retrieve the full payload.
meta object The object containing additional information that is specific to the event_type.
meta.user_id string Unique identifier of the user this event was generated for.
meta.org_uuid string The unique UUID of the Uber for Business organization for which the ride was requested.
meta.resource_id string Unique identifier of the resource this event has been generated for.
meta.status string The current status of the resource.

Status Values

The status values tell you the latest information about a trip, eliminating the need to poll the API for checking when a ride status changes or when a receipt is ready. The status values are different for the different event_types supported and are outlined in the table below.

The guests.trips.status_changed event_type can have a number of different values that will be surfaced in the meta.status field as the ride progreses. Below is a list of all possible status’ a trip can have for this event_type.

Status Description
processing The request is matching to the most efficient available driver.
no_drivers_available The request was unfulfilled because no drivers were available.
accepted The request has been accepted by a driver and is “en route” to the start location (i.e. start_latitude and start_longitude).
arriving The driver has arrived or will be shortly.
in_progress The request is “en route” from the start location to the end location.
driver_canceled The request has been canceled by the driver.
rider_canceled The request canceled by rider.
completed The request has been completed by the driver.
driver_redispatched The driver has been redispatched and the driver should be arriving shortly.
upfront_driver_assigned The driver has been pre-assigned to a reserve trip. This can happen up to 7 days in advance before the pickup day.
Example Webhook
{
  "event_id": "3a3f3da4-14ac-4056-bbf2-d0b9cdcb0777",
  "event_time": 1427343990,
  "event_type": "health.status_changed",
  "meta": {
    "user_id": "d13dff8b-das-asd-1212e",
    "org_uuid": "43142cf0-073f-4542-81e2-c3cf520fccea",
    "resource_id": "5152dcc5-b88d-4754-8b33-975f4067c943",
    "status": "accepted"
  },
  "resource_href": "https://api.uber.com/v1/health/trips/5152dcc5-b88d-4754-8b33-975f4067c943"
}
{
  "event_id": "3a3f3da4-14ac-4056-bbf2-d0b9cdcb0888",
  "event_time": 1427343993,
  "event_type": "health.status_changed",
  "meta": {
    "user_id": "d13dff8b-das-asd-1212e",
    "org_uuid": "43142cf0-073f-4542-81e2-c3cf520fccea",
    "resource_id": "5152dcc5-b88d-4754-8b33-975f4067c943",
    "status": "arriving"
  },
  "resource_href": "https://api.uber.com/v1/health/trips/5152dcc5-b88d-4754-8b33-975f4067c943"
}
{
  "event_id": "3a3f3da4-14ac-4056-bbf2-d0b9cdcb0000",
  "event_time": 1427343998,
  "event_type": "health.status_changed",
  "meta": {
    "user_id": "d13dff8b-das-asd-1212e",
    "org_uuid": "43142cf0-073f-4542-81e2-c3cf520fccea",
    "resource_id": "5152dcc5-b88d-4754-8b33-975f4067c943",
    "status": "completed"
  },
  "resource_href": "https://api.uber.com/v1/health/trips/5152dcc5-b88d-4754-8b33-975f4067c943"
}
{
  "event_id": "3a3f3da4-14ac-4056-bbf2-d0b9cdcb0000",
  "event_time": 1427344008,
  "event_type": "health.trips.status_changed",
  "meta": {
    "user_id": "d13dff8b-das-asd-1212e",
    "resource_id": "5152dcc5-b88d-4754-8b33-975f4067c943",
    "org_uuid": "4a2c7244-63ec-41a1-bb1f-9dff711dd492",
    "status": "upfront_driver_assigned"
  },
  "resource_href": "https://api.uber.com/v1/health/trips/5152dcc5-b88d-4754-8b33-975f4067c943"
}

Uber

Developers
© 2023 Uber Technologies Inc.