---
title: "Delete vehicle"
method: DELETE
path: "/vehicles/{id}"
tags: ["vehicles"]
---

# Delete vehicle

`DELETE /vehicles/{id}`

## Request

- Base URL: `https://api.vepathos.com`
- URL: `https://api.vepathos.com/vehicles/{id}`
- Auth: API key in header `Authorization`

Deletes the vehicle and unlinks it from every fleet that used it; `fleetNames` lists them. With `?strategy=unlink-fleets` the vehicle stays in the catalog and is only removed from fleets. Returns `409` with `code: "vehicle_in_use"` when optimization history still references it.

## Path parameters

- `id` integer, required

## Query parameters

- `strategy` 'unlink-fleets'

## Response `200`

Vehicle deleted or unlinked from fleets (gateway applies transactional FK cleanup).

- VehicleDeleteResponse
  - `code` 'deleted' | 'unlinked' | 'not_in_fleet', required
  - `message` string, required
  - `fleetNames` string[], required: Fleet names the vehicle was removed from (empty if none).

## Other responses

- `401`: Missing, expired or invalid access token.
- `404`: Vehicle not found in tenant scope
- `409`: Vehicle still referenced by optimization history after cleanup (e.g. delivery_path FK).
- `422`: The body or a parameter does not match the schema.

---

[API](https://skmtc.dev/vepathos/apis/vepathos-route-optimization-api.md) · [All operations](https://skmtc.dev/vepathos/apis/vepathos-route-optimization-api/llms.txt) · [OpenAPI document](https://skmtc.dev/vepathos/apis/vepathos-route-optimization-api/revisions/00caa1ca62d9?raw)
