Create a new vehicle in the fleet
POST/company/vehicles/
Endpoint to register a new vehicle in the company fleet. Requires JWT authentication and administrator permissions.
Important Notes:
- The format must be multipart/form-data to support image uploads
- Images must be binary files (JPEG, PNG)
- The 'type' field must be a valid vehicle type ID (see /types endpoint)
Request Example:
{
license_plate: ABC1234,
type: type_987654321,
brand: Volvo,
model: FH16,
year: 2022,
images: [binary_file1, binary_file2]
}
Request
Responses
- 201
- 400
- 401
Vehicle successfully created
Invalid request. Possible causes:
- Required fields are missing
- Incorrect data format
- License plate already exists in the system
- Invalid vehicle type
- Images do not meet the requirements
Unauthorized. The JWT token is invalid, has expired, or lacks administrator permissions. A valid token must be included in the Authorization header: Bearer {token}