Report Incident
POST/v1/incidents/report¶ Use Case
The Report Incident endpoint sends Uber a road incident that your application detected, for example an accident, slow traffic, a speed check, or roadworks.
Uber adds the incident to its own incident data and shows it to Uber drivers on that road. Drivers who pass the incident can confirm it or say that it is gone. Use Report Status to read those votes and to see when the incident expires.
See the Traffic & Incidents introduction for base URLs and developer guides.
¶ Authorization
OAuth 2.0 Bearer token with the maps.partner.incidents scope. Uber must also enable your application for incident reporting. See Authentication.
¶ Request Parameters
All request fields are required.
| Name | Type | Description |
|---|---|---|
incident_type |
IncidentType | Kind of incident. |
location_reference |
LocationReference | Road where the incident is. |
¶ IncidentType Options
| Name | Description |
|---|---|
INCIDENT_TYPE_ACCIDENT |
A collision or a broken-down vehicle on the road. |
INCIDENT_TYPE_TRAFFIC |
Slow or stopped traffic. |
INCIDENT_TYPE_SPEED_CHECK |
A police speed check or a speed camera. |
INCIDENT_TYPE_ROADWORKS |
Construction or maintenance work on the road. |
Any other type returns HTTP 400.
¶ LocationReference Parameters
| Name | Type | Description |
|---|---|---|
openlr |
string | Base64-encoded binary OpenLR line location reference. |
¶ Notes on the location
- Encode the OpenLR reference in the direction of travel that the incident affects.
- The location must be on a road, in a country that your application is approved for. Otherwise the request returns HTTP 400 or 403. See Errors.
¶ Required Headers
| Name | Value |
|---|---|
Authorization |
Bearer <ACCESS_TOKEN> with the maps.partner.incidents scope |
Content-Type |
application/json |
Accept: application/json is optional.
¶ Example Request
$api_url is api.uber.com in production, or test-api.uber.com if Uber has provisioned sandbox access for your application.
curl -X POST \
-H "authorization: Bearer $UBER_TOKEN" \
-H 'content-type: application/json' \
https://$api_url/v1/incidents/report -d \
'{
"incident_type": "INCIDENT_TYPE_ACCIDENT",
"location_reference": {
"openlr": "<BASE64_OPENLR_LINE_LOCATION>"
}
}'
¶ Response body parameters
| Name | Type | Description |
|---|---|---|
report_id |
string | UUID of the report. Keep it to check the status. |
status |
string | Always PARTNER_INCIDENT_STATUS_ACCEPTED. |
Status-code: 200 OK
Illustrative response; the UUID is example data:
{
"report_id": "44b0ba31-6c1e-3d7a-9b52-0f6f2a1c9e10",
"status": "PARTNER_INCIDENT_STATUS_ACCEPTED"
}
¶ Notes on the response
ACCEPTEDmeans that Uber received the report. Call Report Status to find out when Uber shows it to drivers.- If you report the same incident type at the same location while the first report is still live, you get the
report_idof the first report. It is safe to retry a request. - A report of a different type at the same location is a new report.
¶ Report lifetime
| Incident type | Expires after |
|---|---|
INCIDENT_TYPE_ROADWORKS |
4 hours |
| All other types | 1 hour |
A report can expire earlier, for example when drivers say that the incident is gone. To keep an incident live after it expires, report it again. You get a new report_id.
¶ Errors
See Errors for HTTP status codes and how to handle them, and Rate Limits for quotas.