Saves a new vehicle in the application's organization, optionally with an image and in a vehicle group, and returns it.
Input. A JSON body, or multipart/form-data when you upload an image file. licensePlate is required: spaces, tabs, line breaks and dashes are ignored and case does not matter, and 2 to 15 letters (of any alphabet) or digits must remain. owner is up to 100 characters. make is a value from List vehicle makes and color a value from List vehicle colors. groupId adds the vehicle to an existing vehicle group. An image is optional: pass either file (a multipart part) or imageUrl (a public http(s) URL), not both; it must be a JPEG, PNG or WebP image of up to 10 MB and 50 megapixels.
Response. 201 with the new vehicle, saved: true. Its vehicleId is derived from the license plate. thumbnailUrl is a time-limited link to the uploaded image when one was sent.
Notes. A license plate that is already saved answers 409 with code: VEHICLE_EXISTS and the existing details.vehicleId. A license plate that cameras of the organization read in the last 7 days and that is not saved is an unsaved vehicle: it answers 409 with code: VEHICLE_UNSAVED_USE_SAVE and its details.vehicleId; save it with Save a vehicle instead. A missing or hidden groupId, an invalid image or an image URL that cannot be downloaded fails the request before anything is created. In a multipart request every field is text, so null cannot be sent there.
Side effects. The vehicle is visible to the organization; adding it to a vehicle group sends the group to the Cores that use it. Undo with Delete a vehicle.
Request examples
POST /v3/vehicle-api/vehicles
{ "licensePlate": "AB-123-CD" }POST /v3/vehicle-api/vehicles
{ "licensePlate": "AB-123-CD", "owner": "Jane Doe", "make": "Toyota", "color": "WHITE", "groupId": "6512bd43d9caa6e02c990b0a", "imageUrl": "https://images.example.com/vehicles/ab123cd.jpg" }POST /v3/vehicle-api/vehicles (multipart/form-data)
licensePlate=AB-123-CD
owner=Jane Doe
[email protected]
Required scope: write:vehicles
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
400The body is invalid: a missing or invalid licensePlate, 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.
404Vehicle group not found in this organization.
413The image file is larger than 10 MB.
429Too many requests. Try again later.
500Internal server error.
