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 Fuel Logs API is the core data-entry surface of AutoLog. Each fuel log entry captures a single fill-up event — odometer reading, volume dispensed, cost paid, and whether the tank was filled to the brim — so AutoLog can compute fuel efficiency (km/L) and total spending over time. All four endpoints require a valid Authorization: Bearer token.
AutoLog normalises every fill-up into metric/MXN units internally regardless of the units the user submits. The isOdometerInMiles, isVolumeInGallons, and isPaidInUsd flags tell the API which units were used at input, and appliedExchangeRate carries the USD→MXN rate used for cost conversion when isPaidInUsd is true.

GET /api/fuellogs/vehicle/

GET /api/fuellogs/vehicle/{vehicleId} Returns every fuel log entry recorded for the specified vehicle, ordered by fill-up date. The vehicle must belong to the authenticated user.

Auth

Authorization: Bearer <accessToken> — required.

Path parameters

vehicleId
integer
required
The unique identifier of the vehicle whose fuel logs should be retrieved.

Response fields

Returns an array of fuel log objects. Each object contains:
id
integer
Unique identifier of the fuel log entry.
vehicleId
integer
Identifier of the vehicle this log belongs to.
fillUpDate
string (ISO 8601 datetime)
The date and time the fill-up occurred, e.g. "2024-06-15T08:30:00".
distanceTraveledKm
number (decimal)
Distance driven since the previous fill-up, normalised to kilometres.
volumeLiters
number (decimal)
Volume of fuel dispensed, normalised to litres.
totalCostMxn
number (decimal)
Total cost of the fill-up, normalised to Mexican pesos (MXN).
odometerKm
number (decimal)
Odometer reading at the time of fill-up, normalised to kilometres.
isFullTank
boolean
true if the tank was filled to capacity. AutoLog only computes efficiency for consecutive full-tank entries.

Response codes

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

Example

curl -X GET https://api.autolog.app/api/fuellogs/vehicle/1 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
[
  {
    "id": 42,
    "vehicleId": 1,
    "fillUpDate": "2024-06-15T08:30:00",
    "distanceTraveledKm": 412.50,
    "volumeLiters": 38.20,
    "totalCostMxn": 980.00,
    "odometerKm": 54321.00,
    "isFullTank": true
  }
]

POST /api/fuellogs

POST /api/fuellogs Records a new fill-up entry for a vehicle. All unit-conversion metadata must be provided so AutoLog can normalise the values before storage. Returns 201 Created with the persisted fuel log object.

Auth

Authorization: Bearer <accessToken> — required.

Request body

vehicleId
integer
required
The ID of the vehicle being filled up. Must belong to the authenticated user.
fillUpDate
string (ISO 8601 datetime)
required
The date and time of the fill-up event. Example: "2024-06-15T08:30:00".
isOdometerInMiles
boolean
required
Set true if currentOdometer is in miles; false if it is already in kilometres.
currentOdometer
number (decimal)
required
The odometer reading at the time of fill-up, in the unit indicated by isOdometerInMiles. Must be ≥ 0.
isVolumeInGallons
boolean
required
Set true if inputVolume is in US gallons; false if it is already in litres.
inputVolume
number (decimal)
required
Volume of fuel dispensed, in the unit indicated by isVolumeInGallons. Must be between 0.1 and 1000.
isPaidInUsd
boolean
required
Set true if inputCost is denominated in USD; false if it is already in MXN.
inputCost
number (decimal)
required
Total cost of the fill-up, in the currency indicated by isPaidInUsd. Must be ≥ 0.
appliedExchangeRate
number (decimal)
The USD→MXN exchange rate used to convert the cost. Required when isPaidInUsd is true; ignored otherwise.
isFullTank
boolean
required
Set true if the tank was completely filled. Only full-tank entries are used in efficiency calculations.
notes
string
Optional free-text notes for this fill-up (e.g. fuel station name, trip context). Maximum 500 characters.

Response fields

id
integer
Server-assigned unique identifier for the new log entry.
vehicleId
integer
Vehicle this log is associated with.
fillUpDate
string (ISO 8601 datetime)
Fill-up date and time as stored.
distanceTraveledKm
number (decimal)
Distance since previous fill-up, in kilometres.
volumeLiters
number (decimal)
Fuel volume dispensed, in litres.
totalCostMxn
number (decimal)
Total cost of the fill-up in MXN.
odometerKm
number (decimal)
Odometer reading at fill-up, in kilometres.
isFullTank
boolean
Whether the tank was filled to capacity.

Response codes

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

Example

curl -X POST https://api.autolog.app/api/fuellogs \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "vehicleId": 1,
    "fillUpDate": "2024-06-15T08:30:00",
    "isOdometerInMiles": false,
    "currentOdometer": 54321.00,
    "isVolumeInGallons": false,
    "inputVolume": 38.20,
    "isPaidInUsd": false,
    "inputCost": 980.00,
    "appliedExchangeRate": null,
    "isFullTank": true,
    "notes": "OXXO station, Monterrey"
  }'
{
  "id": 42,
  "vehicleId": 1,
  "fillUpDate": "2024-06-15T08:30:00",
  "distanceTraveledKm": 412.50,
  "volumeLiters": 38.20,
  "totalCostMxn": 980.00,
  "odometerKm": 54321.00,
  "isFullTank": true
}

PUT /api/fuellogs/

PUT /api/fuellogs/{id} Replaces all fields on an existing fuel log entry. The request body accepts the same fields as POST /api/fuellogs. Returns 204 No Content on success.
This is a full replacement — all input fields are required. After the update, AutoLog will recalculate the normalised metric/MXN values from the new inputs.

Auth

Authorization: Bearer <accessToken> — required.

Path parameters

id
integer
required
The unique identifier of the fuel log entry to update.

Request body

Same fields as POST /api/fuellogs: vehicleId, fillUpDate, isOdometerInMiles, currentOdometer, isVolumeInGallons, inputVolume, isPaidInUsd, inputCost, appliedExchangeRate, isFullTank, notes.

Response codes

CodeMeaning
204 No ContentLog entry updated. No body returned.
400 Bad RequestOne or more fields are missing or fail validation.
401 UnauthorizedMissing or invalid Bearer token.
404 Not FoundNo log entry with that ID exists.

Example

curl -X PUT https://api.autolog.app/api/fuellogs/42 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "vehicleId": 1,
    "fillUpDate": "2024-06-15T09:00:00",
    "isOdometerInMiles": false,
    "currentOdometer": 54321.00,
    "isVolumeInGallons": false,
    "inputVolume": 40.00,
    "isPaidInUsd": false,
    "inputCost": 1020.00,
    "appliedExchangeRate": null,
    "isFullTank": true,
    "notes": "Corrected volume"
  }'

DELETE /api/fuellogs/

DELETE /api/fuellogs/{id} Permanently deletes a fuel log entry by its ID. After deletion, efficiency calculations for the surrounding entries will be adjusted automatically on the next dashboard query.

Auth

Authorization: Bearer <accessToken> — required.

Path parameters

id
integer
required
The unique identifier of the fuel log entry to delete.

Response codes

CodeMeaning
204 No ContentLog entry deleted. No body returned.
401 UnauthorizedMissing or invalid Bearer token.
404 Not FoundNo log entry with that ID exists.

Example

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

Build docs developers (and LLMs) love