Skip to main content

Documentation 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.

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 valid 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:
id
integer
Unique identifier of the vehicle.
make
string
Manufacturer name, e.g. "Ford".
model
string
Model name, e.g. "Mustang".
year
integer
Model year, e.g. 2000.
cylinders
integer
Number of engine cylinders, e.g. 6.
engineType
string
Engine displacement and configuration string, e.g. "3.7 V6".
fuelType
string
Type of fuel the vehicle uses, e.g. "Gasoline".
color
string | null
Optional exterior color, e.g. "Magnetic Gray". null when not set.

Response codes

CodeMeaning
200 OKArray of vehicles returned (may be empty).
401 UnauthorizedMissing or invalid Bearer token.

Example

curl -X GET https://api.autolog.app/api/vehicles \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
[
  {
    "id": 1,
    "make": "Ford",
    "model": "Mustang",
    "year": 2000,
    "cylinders": 6,
    "engineType": "3.7 V6",
    "fuelType": "Gasoline",
    "color": "Magnetic Gray"
  }
]

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

id
integer
required
The unique identifier of the vehicle to retrieve.

Response fields

id
integer
Unique identifier of the vehicle.
make
string
Manufacturer name.
model
string
Model name.
year
integer
Model year.
cylinders
integer
Number of engine cylinders.
engineType
string
Engine displacement and configuration string.
fuelType
string
Type of fuel the vehicle uses.
color
string | null
Optional exterior color. null when not set.

Response codes

CodeMeaning
200 OKVehicle found and returned.
401 UnauthorizedMissing or invalid Bearer token.
404 Not FoundNo vehicle with that ID exists for the authenticated user.

Example

curl -X GET https://api.autolog.app/api/vehicles/1 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
{
  "id": 1,
  "make": "Ford",
  "model": "Mustang",
  "year": 2000,
  "cylinders": 6,
  "engineType": "3.7 V6",
  "fuelType": "Gasoline",
  "color": "Magnetic Gray"
}

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

make
string
required
Manufacturer name. Maximum 50 characters. Example: "Toyota".
model
string
required
Model name. Maximum 50 characters. Example: "Corolla".
year
integer
required
Four-digit model year. Example: 2021.
cylinders
integer
required
Number of engine cylinders. Example: 4.
engineType
string
required
Engine displacement and layout descriptor. Maximum 10 characters. Example: "1.8 I4".
fuelType
string
required
Fuel type consumed by the vehicle. Maximum 20 characters. Example: "Gasoline".
color
string
Optional exterior color. Maximum 30 characters. Example: "Pearl White".

Response fields

id
integer
Server-assigned unique identifier for the new vehicle.
make
string
Manufacturer name as stored.
model
string
Model name as stored.
year
integer
Model year as stored.
cylinders
integer
Number of engine cylinders as stored.
engineType
string
Engine type descriptor as stored.
fuelType
string
Fuel type as stored.
color
string | null
Color as stored, or null if not provided.

Response codes

CodeMeaning
201 CreatedVehicle created. Response body contains the new vehicle object.
400 Bad RequestOne or more required fields are missing or fail validation.
401 UnauthorizedMissing or invalid Bearer token.

Example

curl -X POST https://api.autolog.app/api/vehicles \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "make": "Toyota",
    "model": "Corolla",
    "year": 2021,
    "cylinders": 4,
    "engineType": "1.8 I4",
    "fuelType": "Gasoline",
    "color": "Pearl White"
  }'
{
  "id": 7,
  "make": "Toyota",
  "model": "Corolla",
  "year": 2021,
  "cylinders": 4,
  "engineType": "1.8 I4",
  "fuelType": "Gasoline",
  "color": "Pearl White"
}

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

id
integer
required
The unique identifier of the vehicle to update.

Request body

make
string
required
Updated manufacturer name. Maximum 50 characters.
model
string
required
Updated model name. Maximum 50 characters.
year
integer
required
Updated four-digit model year.
cylinders
integer
required
Updated number of engine cylinders.
engineType
string
required
Updated engine displacement/layout descriptor. Maximum 10 characters.
fuelType
string
required
Updated fuel type. Maximum 20 characters.
color
string
Updated exterior color. Maximum 30 characters. Omit or pass null to clear.

Response codes

CodeMeaning
204 No ContentVehicle updated successfully. No body returned.
400 Bad RequestOne or more required fields are missing or fail validation.
401 UnauthorizedMissing or invalid Bearer token.
404 Not FoundNo vehicle with that ID exists for the authenticated user.

Example

curl -X PUT https://api.autolog.app/api/vehicles/7 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "make": "Toyota",
    "model": "Corolla",
    "year": 2021,
    "cylinders": 4,
    "engineType": "1.8 I4",
    "fuelType": "Gasoline",
    "color": "Midnight Black"
  }'

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.
Deletion is permanent. All fuel log history tied to the vehicle will be removed. This action cannot be undone.

Auth

Authorization: Bearer <accessToken> — required.

Path parameters

id
integer
required
The unique identifier of the vehicle to delete.

Response codes

CodeMeaning
204 No ContentVehicle deleted successfully. No body returned.
401 UnauthorizedMissing or invalid Bearer token.
404 Not FoundNo vehicle with that ID exists for the authenticated user.

Example

curl -X DELETE https://api.autolog.app/api/vehicles/7 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Build docs developers (and LLMs) love