Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/diarpicu2022-commits/backend-AgroPulse/llms.txt

Use this file to discover all available pages before exploring further.

The system log is AgroPulse’s audit trail. It records user actions (logins, configuration changes, manual overrides), automated pipeline events (sensor polling, alert dispatch), and any other operational event worth preserving for review or debugging. Log entries are immutable in intent — the GET endpoint is the primary consumer, used by dashboards and support tools. The POST endpoint is available for internal services to inject structured entries.
Log entries are returned in descending timestamp order (newest first). The list endpoint supports a limit query parameter to control how many entries are fetched; the default is 100.

Endpoints

List log entries

Retrieves recent system log entries, newest first.
GET /api/logs?limit={limit}
Query parameters
limit
number
default:"100"
Maximum number of log entries to return. The server applies the limit using a paginated query so large tables remain performant.
Response Returns an object with a logs array.
logs
SystemLog[]
required
Array of log entry objects ordered by timestamp descending.
curl "http://localhost:8080/api/logs?limit=25"

Create a log entry

Inserts a new entry into the system log. This endpoint is intended for internal AgroPulse services that need to record events programmatically. The timestamp is set to the server’s current time at insert.
POST /api/logs
Request body
action
string
required
Short identifier for the action being recorded (e.g. "SENSOR_CALIBRATED", "CONFIG_CHANGED").
userName
string
Name of the user or service responsible for the action.
details
string
Free-form text with additional context. No length limit.
level
string
default:"INFO"
Severity of the entry. Accepted values: INFO, WARNING, ERROR.
curl -X POST http://localhost:8080/api/logs \
  -H "Content-Type: application/json" \
  -d '{
    "action": "SENSOR_CALIBRATED",
    "userName": "carlos.lopez",
    "details": "Humidity sensor node 7 recalibrated in greenhouse 2.",
    "level": "INFO"
  }'

Build docs developers (and LLMs) love