---
title: "Create a vehicle"
method: POST
path: "/v1/locations/{locationId}/vehicles"
tags: ["Vehicles"]
---

# Create a vehicle

`POST /v1/locations/{locationId}/vehicles`

## Request

- Base URL: `https://api.cliento.com`
- URL: `https://api.cliento.com/v1/locations/{locationId}/vehicles`
- Auth: HTTP bearer

Creates a vehicle at the location. Send an `externalReference`, your own id for the vehicle, to make the call safe to repeat. When a vehicle at the location already has that reference, that vehicle is returned unchanged with `200` and nothing is created. A vehicle with a registration number that another vehicle at the location already has is normally refused with `duplicate`.

## Path parameters

- `locationId` string, required

## Headers

- `Idempotency-Key` string

## Request body

- VehicleCreate: A vehicle needs a `registrationNumber` or a `description`.
  - `description` string: What the vehicle is called in Cliento, such as `The red van`.
  - `externalReference` string: Your own id for it, at most 100 characters, such as its id in your system. It makes the create safe to repeat and lets you find it again. Compared exactly, letter case included.
  - `notes` string: Staff-facing notes, at most 1000 characters.
  - `registrationNumber` string: The registration number, one to seven characters.

## Response `200`

A vehicle with this `externalReference` already existed.

- Vehicle: Represents a vehicle a location works on. Belongs to one location.
  - `colour` string: From the vehicle register.
  - `createdAt` string, date-time
  - `description` string: What the vehicle is called in Cliento. A lookup in the vehicle register fills it in with the make, model, colour and year; staff can change it.
  - `externalReference` string: Your own id for it, as sent when it was created.
  - `id` string, required
  - `locationId` string, required
  - `make` string: From the Swedish vehicle register, when staff have looked the vehicle up in Cliento. Not set through the API.
  - `model` string: From the vehicle register.
  - `modelYear` integer: From the vehicle register.
  - `notes` string: Staff-facing notes, at most 1000 characters.
  - `registrationNumber` string: The registration number, one to seven characters.
  - `updatedAt` string, date-time

## Other responses

- `201`: The vehicle was created.
- `default`: Any failure. See the Errors section.

---

[API](https://skmtc.dev/cliento/apis/cliento-api.md) · [All operations](https://skmtc.dev/cliento/apis/cliento-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cliento/apis/cliento-api/revisions/29ca811bc061?raw)
