Three lines

Uber

Developers

[API] Assign Vehicle

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.

The Assign Vehicle is designed to facilitate the assignment of vehicles to drivers within a vehicle supplier.

Use case

This Assign Vehicle API is particularly useful in scenarios involving Fleets or Rental services where vehicles need to be dynamically assigned to different drivers based on operational requirements. By specifying the vehicle_id and driver_id, the vehicle’s assignment can be updated in the vehicle supplier’s system, ensuring that the vehicle is correctly allocated to the intended driver, with data refreshness time being less than 2 minutes.

Support for Hierarchical Data

The Assign Vehicle API automatically operates within the hierarchical structure of the organization linked to the developer’s account at the time of setup.

Supported supplier types

Fleets/Rentals

Scopes

vehicle_suppliers.vehicles.assignment

Resource

/v1/vehicle-suppliers/vehicles/:vehicle_id/assign

HTTP Method

POST

Authorization

Client Credentials

Example Request
curl -X POST "https://api.uber.com/v1/vehicle-suppliers/vehicles/:vehicle_id/assign" \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
    "driver_id":"driver_id"
}'

Request Path Parameters
Name Type Description
vehicle_id string Vehicle ID returned from Create Vehicle response.

Request Body Parameters
Name Type Description
driver_id string Driver ID returned from Get Driver Info response.

Example Response
Status-code: 204 No Content
{
}
Response Body parameters

None: No data is returned in the body of the response.


Rate limit
  • The rate limit for this endpoint is 3600 requests per hour (RPH).
Endpoint Specific Errors
Http Status Code Code Message
400 bad_request The request parameters are invalid, e.g. vehicle_id is not recognized
401 unauthorized Invalid OAuth 2.0 credentials provided
404 vehicle_not_found The vehicle is not found
404 driver_not_found The driver is not found
422 vehicle_not_active The vehicle is not active, such as missing documents, pending document approval, document rejected, vehicle is deactivated, etc.
422 driver_not_active The driver is not active, such as missing driver documents, pending background check, etc.
422 territory_mismatch The territories of the vehicle owner and the driver mismatch
429 rate_limited Number of requests exceeds allowed limit
500 internal_server_error Internal server error
503 service_unavailable Service unavailable

Notes

  • It is important to ensure that the territories of the vehicle owner and the driver match. If there is a mismatch, the API will return a 422 status code with the error.

Uber

Developers
© 2023 Uber Technologies Inc.