fr
Équipe & Flotte›Add a vehicle to the fleet

Add a vehicle to the fleet

Registers a van, truck or car in the business's own fleet. Vehicles are what a confirmed job's crew travels in: at confirm, Crisphive auto-selects one vehicle for the whole crew from the lead technician's vehicles, then from unowned fleet vehicles, and blocks a vehicle already booked for an overlapping job. `name` is the only required field, so a bulk fleet import needs nothing else; brand, model, year, plate_number, current_mileage and vehicle_type (van, truck or car) can be filled in later with updateVehicle. Names and plate numbers must be unique in the business (VEHICLE_DUPLICATE_NAME / VEHICLE_DUPLICATE_PLATE). `owner_id` records who has CLAIMED the vehicle as their primary one. The owner must be a lead technician or a management role; a buddy- or float-tier profile is refused with VEHICLE_OWNER_TIER_NOT_ALLOWED, an unknown profile with VEHICLE_INVALID_OWNER. Deciding which vehicles a technician may USE is a separate relation: use replaceTechnicianVehicles for that, not this tool. Send an Idempotency-Key header (the `idempotency_key` argument over MCP) so a retried call replays the original response instead of creating a duplicate vehicle.

Arguments

Idempotency-Keystringheaderoptionnel
Unique key making retries safe: a repeat send with the same key replays the original response (header Idempotent-Replayed: true) instead of re-running the operation. Reusing a key with a different body returns 422 IDEMPOTENCY_KEY_REUSE.
brandstringbodyoptionnel
Manufacturer / make. Optional.
current_mileageintegerbodyoptionnel
Odometer reading. Optional; must be >= 0 when sent.
modelstringbodyoptionnel
Model name. Optional.
namestringbodyrequis
Vehicle display name (required). The only mandatory field — a fleet import needs nothing but names to get vehicles into the system.
owner_idstringbodyoptionnel
UUID of the technician who owns (has claimed) this vehicle. Optional. The owner must be a lead technician or a management role — a buddy- or float-tier profile is refused with VEHICLE_OWNER_TIER_NOT_ALLOWED. Assigning which vehicles a technician USES is a different relation: PUT /technicians/{id}/vehicles.
plate_numberstringbodyoptionnel
License plate. Optional.
vehicle_typeenumbodyoptionnel
yearintegerbodyoptionnel
Model year. Optional.
POST/v1/vehicles
curl -X POST "https://api.crisphive.com/v1/vehicles" \
  -H "Authorization: Bearer chsk_test_4eC8xQ9mZ2pL7Ka0rT" \
  -H "Content-Type: application/json" \
  -d '{
  "brand": "Ford",
  "current_mileage": 50000,
  "model": "Transit",
  "name": "North Van 01",
  "owner_id": "550e8400-e29b-41d4-a716-446655440000",
  "plate_number": "ABC-1234",
  "vehicle_type": "van",
  "year": 2023
}'
Corps de la requête
{
"brand": ,
"current_mileage": ,
"model": ,
"name": ,
"owner_id": ,
"plate_number": ,
"vehicle_type": ,
"year":
}

Réponses