The Vehicles API lets authenticated users manage the vehicles they track in AutoLog. Each vehicle record captures the physical attributes of the car — make, model, year, engine configuration, and fuel type — that AutoLog uses when computing fuel efficiency metrics. All five endpoints on this controller require a validDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JReyna217/AutoLog/llms.txt
Use this file to discover all available pages before exploring further.
Authorization: Bearer token issued by POST /api/auth/login.
The
userId is never accepted as a request parameter. AutoLog extracts it securely from the JWT NameIdentifier claim so that users can only ever read or modify their own vehicles.GET /api/vehicles
GET /api/vehicles
Returns every vehicle that belongs to the currently authenticated user. An empty array is returned when the user has no vehicles yet.
Auth
Authorization: Bearer <accessToken> — required.
Response fields
Returns an array of vehicle objects. Each object contains:Unique identifier of the vehicle.
Manufacturer name, e.g.
"Ford".Model name, e.g.
"Mustang".Model year, e.g.
2000.Number of engine cylinders, e.g.
6.Engine displacement and configuration string, e.g.
"3.7 V6".Type of fuel the vehicle uses, e.g.
"Gasoline".Optional exterior color, e.g.
"Magnetic Gray". null when not set.Response codes
| Code | Meaning |
|---|---|
200 OK | Array of vehicles returned (may be empty). |
401 Unauthorized | Missing or invalid Bearer token. |
Example
GET /api/vehicles/
GET /api/vehicles/{id}
Returns a single vehicle by its ID, scoped to the authenticated user. Returns 404 if the vehicle does not exist or belongs to a different user.
Auth
Authorization: Bearer <accessToken> — required.
Path parameters
The unique identifier of the vehicle to retrieve.
Response fields
Unique identifier of the vehicle.
Manufacturer name.
Model name.
Model year.
Number of engine cylinders.
Engine displacement and configuration string.
Type of fuel the vehicle uses.
Optional exterior color.
null when not set.Response codes
| Code | Meaning |
|---|---|
200 OK | Vehicle found and returned. |
401 Unauthorized | Missing or invalid Bearer token. |
404 Not Found | No vehicle with that ID exists for the authenticated user. |
Example
POST /api/vehicles
POST /api/vehicles
Creates a new vehicle and associates it with the authenticated user. Returns 201 Created with the full vehicle object and a Location header pointing to the new resource.
Auth
Authorization: Bearer <accessToken> — required.
Request body
Manufacturer name. Maximum 50 characters. Example:
"Toyota".Model name. Maximum 50 characters. Example:
"Corolla".Four-digit model year. Example:
2021.Number of engine cylinders. Example:
4.Engine displacement and layout descriptor. Maximum 10 characters. Example:
"1.8 I4".Fuel type consumed by the vehicle. Maximum 20 characters. Example:
"Gasoline".Optional exterior color. Maximum 30 characters. Example:
"Pearl White".Response fields
Server-assigned unique identifier for the new vehicle.
Manufacturer name as stored.
Model name as stored.
Model year as stored.
Number of engine cylinders as stored.
Engine type descriptor as stored.
Fuel type as stored.
Color as stored, or
null if not provided.Response codes
| Code | Meaning |
|---|---|
201 Created | Vehicle created. Response body contains the new vehicle object. |
400 Bad Request | One or more required fields are missing or fail validation. |
401 Unauthorized | Missing or invalid Bearer token. |
Example
PUT /api/vehicles/
PUT /api/vehicles/{id}
Replaces all mutable fields on an existing vehicle. The request body must include every field — this is a full replacement, not a partial update. Returns 204 No Content on success.
Auth
Authorization: Bearer <accessToken> — required.
Path parameters
The unique identifier of the vehicle to update.
Request body
Updated manufacturer name. Maximum 50 characters.
Updated model name. Maximum 50 characters.
Updated four-digit model year.
Updated number of engine cylinders.
Updated engine displacement/layout descriptor. Maximum 10 characters.
Updated fuel type. Maximum 20 characters.
Updated exterior color. Maximum 30 characters. Omit or pass
null to clear.Response codes
| Code | Meaning |
|---|---|
204 No Content | Vehicle updated successfully. No body returned. |
400 Bad Request | One or more required fields are missing or fail validation. |
401 Unauthorized | Missing or invalid Bearer token. |
404 Not Found | No vehicle with that ID exists for the authenticated user. |
Example
DELETE /api/vehicles/
DELETE /api/vehicles/{id}
Permanently removes a vehicle from the authenticated user’s account. This also cascades to all fuel log entries associated with the vehicle.
Auth
Authorization: Bearer <accessToken> — required.
Path parameters
The unique identifier of the vehicle to delete.
Response codes
| Code | Meaning |
|---|---|
204 No Content | Vehicle deleted successfully. No body returned. |
401 Unauthorized | Missing or invalid Bearer token. |
404 Not Found | No vehicle with that ID exists for the authenticated user. |