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 AutoLog API is a .NET 10 ASP.NET Core JSON REST API. Inside the Docker container it listens on port 8080 (the ASP.NET Core default for containerised apps) and is mapped to 5030 on the host; in a local development run it binds to http://localhost:5187 (HTTP) or https://localhost:7142 (HTTPS). All endpoints follow RESTful conventions, consume and produce JSON, and are grouped under the /api path prefix.

Base URL

Use the base URL that matches your environment. Every path in this reference is appended to the base URL shown below.
EnvironmentBase URL
Development (local run)http://localhost:5187/api
Container (host-mapped)http://localhost:5030/api
Productionhttps://api.yourdomain.com/api

Authentication

All endpoints — with the exception of register (POST /api/auth/register) and login (POST /api/auth/login) — require a valid JWT access token sent as a Bearer token in the Authorization request header.
curl -X GET https://api.yourdomain.com/api/vehicles \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Tokens are issued by POST /api/auth/login and last 15 minutes. When a token expires, call POST /api/auth/refresh with both the expired access token and the still-valid refresh token (valid 7 days) to receive a new pair. See API Authentication for the full token lifecycle.

Available Endpoints

Auth

POST /api/auth/register — create a new account
POST /api/auth/login — exchange credentials for tokens
POST /api/auth/refresh — rotate an expiring access token

Vehicles

GET /api/vehicles — list all vehicles for the authenticated user
GET /api/vehicles/{id} — get a single vehicle
POST /api/vehicles — create a vehicle
PUT /api/vehicles/{id} — update a vehicle
DELETE /api/vehicles/{id} — delete a vehicle

Fuel Logs

GET /api/fuellogs/vehicle/{vehicleId} — list fill-up records for a vehicle
POST /api/fuellogs — record a new fill-up
PUT /api/fuellogs/{id} — update a fill-up record
DELETE /api/fuellogs/{id} — delete a fill-up record

Exchange Rates

GET /api/exchangerates — list the USD/MXN rate catalog
GET /api/exchangerates/date/{date} — get the rate for a specific date
POST /api/exchangerates — add a rate entry
PUT /api/exchangerates/{id} — update a rate entry
DELETE /api/exchangerates/{id} — remove a rate entry

Dashboard

GET /api/dashboard/summary — aggregated spend, volume, and cost-per-km summary
Supports optional query parameters: vehicleId, month, and year

External Rates

GET /api/externalrates/dof/{date} — fetch the live USD/MXN fix rate published by Mexico’s DOF (Diario Oficial de la Federación) for a given date

Error Format

AutoLog uses ASP.NET Core’s built-in IExceptionHandler interface to catch every unhandled exception in a single place (GlobalExceptionHandler) and return a consistent RFC 7807 Problem Details JSON body. This means you can always inspect status, title, and detail regardless of which endpoint raised the error. Two error shapes exist:
  • Business rule violations — thrown as CustomAppException inside the application layer. These return 400 Bad Request with "title": "Business Rule Violation" and a human-readable detail message. An errorCode extension field maps to the SystemResponses table for i18n translation.
  • Unexpected errors — any other unhandled exception returns 500 Internal Server Error with a generic message. An incidentNumber (UUID) is included so you can correlate the request with server-side logs.
Business rule violation:
{
  "title": "Business Rule Violation",
  "status": 400,
  "detail": "A vehicle with this license plate already exists.",
  "instance": "/api/vehicles",
  "errorCode": "e00042",
  "incidentNumber": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
Unexpected server error:
{
  "title": "Internal Server Error",
  "status": 500,
  "detail": "An unexpected error occurred. Please contact support.",
  "instance": "/api/vehicles",
  "errorCode": "e00000",
  "incidentNumber": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

Common HTTP Status Codes

StatusMeaning
200 OKRequest succeeded; response body contains the requested resource or result.
201 CreatedA new resource was created; the Location header points to the new resource URL.
204 No ContentRequest succeeded; no response body (used for updates and deletes).
400 Bad RequestValidation failed or a business rule was violated; see the detail field.
401 UnauthorizedMissing, expired, or invalid Bearer token.
404 Not FoundThe requested resource does not exist or does not belong to the authenticated user.
500 Internal Server ErrorAn unexpected server-side error occurred; use the incidentNumber when contacting support.

Interactive API Reference

When the API is running in Development mode, an interactive Scalar API reference is available at:
http://localhost:5187/scalar
The reference uses the DeepSpace theme and defaults to C# HttpClient code samples. It is generated automatically from the OpenAPI specification produced by MapOpenApi() and is not available in the production build.

Build docs developers (and LLMs) love