Update a vehicle

Changes the owner, make, color or image of a saved vehicle of the application's organization, or adds it to a vehicle group, and returns it.

Input. A JSON body, or multipart/form-data when you upload an image file. vehicleId is required. Every other field is optional and a field you omit keeps its value. owner, make and color take null to clear them (JSON only). groupId adds the vehicle to an existing vehicle group; it stays in its other groups. file or imageUrl replaces the image, with the same rules as Create a vehicle.

Response. 200 with the vehicle as stored.

Notes. The license plate cannot be changed: sending licensePlate answers 400; delete the vehicle and create it with the new license plate. An unsaved vehicle answers 400; save it first. A private vehicle that is not shared with the access token answers 404.

Side effects. When the owner, make or color changes, the vehicle groups that contain the vehicle are sent again to the Cores that use them. A replaced image is deleted. The previous values cannot be restored.

Request examples

PUT /v3/vehicle-api/vehicles

{ "vehicleId": 1093527491036451, "owner": "John Doe" }

PUT /v3/vehicle-api/vehicles

{ "vehicleId": 1093527491036451, "make": null, "color": null, "groupId": "6512bd43d9caa6e02c990b0a" }
PUT /v3/vehicle-api/vehicles  (multipart/form-data)
vehicleId=1093527491036451
[email protected]

Required scope: write:vehicles

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

The vehicle to change and the fields to change, as JSON or as multipart/form-data with an image file.

integer
required
1 to 9007199254740991

The numeric id of the saved vehicle to change, from List vehicles.

string

Not accepted: the license plate of a saved vehicle cannot be changed. Sending it answers 400; delete the vehicle and create it with the new license plate.

string | null

The owner of the vehicle, up to 100 characters. null clears it.

string | null

A make from List vehicle makes, exactly as returned. null clears it.

string | null
enum

A color from List vehicle colors. null clears it.

string

The 24-character id of a vehicle group to add the vehicle to. The vehicle stays in its other groups.

string
length ≤ 2048

A public http(s) URL of a JPEG, PNG or WebP image of up to 10 MB and 50 megapixels. Pass this or file, not both.

file

A JPEG, PNG or WebP image of up to 10 MB and 50 megapixels, as a multipart/form-data part. Pass this or imageUrl, not both.

Headers
string
enum
Defaults to application/json

Generated from available request content types

Allowed:
Responses

400

The body is invalid: a missing or invalid vehicleId, a licensePlate (it cannot be changed), an unsaved vehicle, an owner over 100 characters, an unknown make or color, a groupId that is not a 24-character id, both file and imageUrl, an image that is not a readable JPEG, PNG or WebP file or is over 50 megapixels, or an imageUrl that cannot be downloaded.

404

Vehicle or vehicle group not found in this organization.

413

The image file is larger than 10 MB.

429

Too many requests. Try again later.

500

Internal server error.

Language
Credentials
OAuth2
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
*/*