Create a vehicle

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

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

The vehicle to create, as JSON or as multipart/form-data with an image file.

string
required
length ≤ 20

The license plate. Spaces, tabs, line breaks and dashes are ignored and case does not matter; 2 to 15 letters (of any alphabet) or digits must remain.

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 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.

404

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
*/*