---
title: "Create fleet"
method: POST
path: "/fleets"
tags: ["fleets"]
---

# Create fleet

`POST /fleets`

## Request

- Base URL: `https://api.vepathos.com`
- URL: `https://api.vepathos.com/fleets`
- Auth: API key in header `Authorization`

Returns `403` with `reason: "max_fleets"` when the account holds its plan's fleets, or `reason: "max_fleet_units"` when `vehicles[].qty` adds up past the plan's units per fleet.

## Request body

- FleetCreate
  - `name` string, required
  - `vehicles` FleetVehicleCreate[], required
    - `qty` integer, required: Units of this vehicle type. The sum across the fleet counts against your plan's units per fleet.
    - `id` string, required: Vehicle id from `/vehicles`.
    - `alias` string, nullable: Name for this entry, unique within the fleet. Lets the same vehicle type appear more than once with different route or behavior limits.
    - `route` VehicleRouteConfig
      - `stops_min` integer, nullable
      - `stops_max` integer, nullable
      - `distance_min` number, nullable
      - `distance_max` number, nullable
      - `distance_unit` 'CENTIMETER' | 'METER' | 'KILOMETER' | 'INCH' | 'FEET' | 'MILE'
      - `time_min` number, nullable
      - `time_max` number, nullable
      - `time_unit` 'SECOND' | 'MINUTE' | 'HOUR'
    - `behavior` VehicleBehaviorConfig
      - `priority` integer, nullable: Dispatch priority. Higher values are used first when types are interchangeable.
      - `overflow_vehicle` boolean, nullable: Hold this type back until the primary types are full.

## Response `201`

The created fleet.

- FleetResponse
  - `name` string, required
  - `vehicles` FleetVehicleResponse[], required
    - `name` string, required
    - `volume` integer, nullable
    - `volume_unit` 'CUBIC_CENTIMETER' | 'CUBIC_METER' | 'LITER' | 'CUBIC_INCH' | 'CUBIC_FEET' | 'GALLON'
    - `weight` integer, nullable
    - `weight_unit` 'GRAMS' | 'KILOGRAMS' | 'OUNCES' | 'POUNDS'
    - `consumption` integer, nullable
    - `consumption_unit` 'LITERS_PER_100KM' | 'KILOMETERS_PER_LITER' | 'MILES_PER_GALLON' | 'GALLONS_PER_MILE'
    - `category_type` 'TRUCK' | 'VAN' | 'PICKUP' | 'MOTORCYCLE' | 'BICYCLE'
    - `engine_type` 'GASOLINE' | 'DIESEL' | 'CNG' | 'ELECTRIC' | 'HYBRID' | 'MECHANIC'
    - `id` union, required
      - string
      - integer
    - `qty` integer, required
    - `alias` string, nullable: Name for this entry, unique within the fleet. Lets the same vehicle type appear more than once with different route or behavior limits.
    - `route` VehicleRouteConfig
      - `stops_min` integer, nullable
      - `stops_max` integer, nullable
      - `distance_min` number, nullable
      - `distance_max` number, nullable
      - `distance_unit` 'CENTIMETER' | 'METER' | 'KILOMETER' | 'INCH' | 'FEET' | 'MILE'
      - `time_min` number, nullable
      - `time_max` number, nullable
      - `time_unit` 'SECOND' | 'MINUTE' | 'HOUR'
    - `behavior` VehicleBehaviorConfig
      - `priority` integer, nullable: Dispatch priority. Higher values are used first when types are interchangeable.
      - `overflow_vehicle` boolean, nullable: Hold this type back until the primary types are full.
  - `id` union, required
    - string
    - integer

## Other responses

- `401`: Missing, expired or invalid access token.
- `403`: A plan quota or optimization option blocks the request. `reason` names the limit. Nothing is reserved or charged.
- `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)
