Skip to main content
POST
Create Vehicle
← Vehicles API Create a new vehicle in your organization’s fleet. Creating a vehicle calculates nothing: its emissions come from its consumptions, so co2e is 0 until it has some. To create many at once, use Create Vehicles (v2).
Required Setup: Before creating a vehicle, ensure you have retrieved the necessary references:
  • Unknown vehicle type IDs from /v1/unknown-vehicles
  • Fuel type IDs from /v1/vehicle-fuels

Request

Headers

string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Body Parameters

string
Custom name or alias for the vehicleExample: "Company Fleet Car #1"
string
required
Type of vehicle usageAvailable values: passenger, freightExample: "passenger"
string
required
Vehicle ownership typeAvailable values: owned, rentedExample: "owned"
string
required
Vehicle registration/license plate numberExample: "ABC-1234"
uuid
required
UUID of the unknown vehicle type for categorizationRetrieve available options from GET /v1/unknown-vehiclesExample: "550e8400-e29b-41d4-a716-446655440000"
string
required
ISO 3166-1 alpha-2 country code (e.g. ES), where the vehicle is used: it picks the emission factors of its consumptionsExamples: "US", "GB", "ES", "DE"
uuid
UUID of the vehicle fuel type (required if custom_emission_factor_id not provided)Retrieve available options from GET /v1/vehicle-fuelsExamples: petrol, diesel, electric, hybridExample: "660e8400-e29b-41d4-a716-446655440000"
uuid
UUID of a custom emission factor (required if vehicle_fuel_id not provided)For organizations with custom emission dataDespite the name, this field holds the id of a custom emission group, not of an individual factor. Retrieve available options from GET /custom_emission_groups/lightExample: "770e8400-e29b-41d4-a716-446655440000"
integer
Year of vehicle registration (YYYY format)Used for age-based emission factors and vehicle classificationExample: 2022
string
Vehicle market segment for classificationAvailable values: mini, supermini, lower_medium, upper_medium, executive, luxury, sports, dual_purpose_4x4, mpvExample: "upper_medium"
string
Vehicle size categoryAvailable values: small_car, medium, large_car, average_carExample: "medium"

Response

string
Unique identifier (UUID) for the vehicle
string | null
Custom name or alias for the vehicle
string
Type of vehicle usage: passenger or freight
string
Ownership type: owned or rented
string
Vehicle registration/license plate number
string
ISO 3166-1 country code
string
Current status of the vehicle (newly created vehicles are active)
number
Emissions of the vehicle’s consumptions in kg CO2e: 0 for a new vehicle
string | null
UUID of the fuel type
string | null
Fuel type name (e.g. diesel, petrol, electric)
array[object] | null
Available fuel units for this vehicle’s fuel type
string | null
UUID of the unknown vehicle type
string | null
String name of the unknown vehicle type (e.g. Truck, Van)
string | null
UUID of the custom emission factor applied, if any
integer | null
Year of vehicle registration
string | null
Vehicle market segment classification
string | null
Vehicle size category
array[string] | null
Error codes when status is error
string | null
UUID of the import file, if created via CSV import
string | null
Name of the import file, if created via CSV import
datetime
Timestamp when the vehicle was created
datetime | null
Timestamp when the vehicle was last updated

Example

Successful Response

Common Errors

401 Unauthorized

Cause: Missing or invalid API key
Solution: Verify your API key is valid and active. Get a new one in Company settings → API Keys.

404 Not Found

Cause: The organization in x-organization-id does not exist
Solution: Verify the x-organization-id header. Take unknown_vehicle_id from List Unknown Vehicles and vehicle_fuel_id from List Vehicle Fuels: this route does not check them, and an id that does not exist fails the request. Create Vehicles (v2) checks every reference.

422 Validation Error

Cause: A missing required field or an invalid value, or a plate already in use
Solution: Send every required field. A plate can be used by one enabled vehicle of the organization at a time (LICENSE_PLATE_ALREADY_EXISTS). custom_emission_factor_id and custom_ef_record_id are mutually exclusive.

Use Cases

Add a Passenger Vehicle to Fleet

Create a new company car with full details:

Register a Fleet Vehicle with Custom Emissions

Add a vehicle using a custom emission factor:

Bulk Add Multiple Vehicles

Add multiple vehicles in a batch operation:

List Vehicles

Retrieve all vehicles with filtering and pagination

Update Vehicle

Modify vehicle details

Unknown Vehicles

Get available vehicle types

Vehicle Fuels

Get available fuel types