Renta Docs

Maintenance API

Track maintenance history for fleet items — log repairs, inspections, and service records.

The Maintenance API lets you create and retrieve maintenance log entries for your fleet items. Use it to track repairs, inspections, meter readings, and service costs.

All maintenance endpoints require a secret key (renta_sk_). Publishable keys will receive a 403 Forbidden error.

List Maintenance Logs

GET /v1/maintenance/logs

Returns maintenance logs with cursor-based pagination, ordered by most recent first. Optionally filter by fleet item.

Query Parameters:

ParameterTypeDescription
fleet_item_idstringFilter logs for a specific fleet item
cursorstringPagination cursor
limitintegerResults per page (1–100, default 20)
// List all maintenance logs
const logs = await renta.maintenance.logs.list();
console.log(logs.data);

// Filter by fleet item
const itemLogs = await renta.maintenance.logs.list({
  fleet_item_id: 'fi_abc123',
});

// Auto-paginate through all logs
for await (const log of renta.maintenance.logs.list()) {
  console.log(`${log.description} — $${(log.cost / 100).toFixed(2)}`);
}
curl "https://api.getrenta.io/v1/maintenance/logs?fleet_item_id=fi_abc123&limit=10" \
  -H "Authorization: Bearer renta_sk_live_..."

Response:

{
  "data": [
    {
      "id": "ml_abc123",
      "schedule_id": null,
      "fleet_item_id": "fi_abc123",
      "description": "Brake pad replacement",
      "notes": "Replaced front and rear pads",
      "cost": 4500,
      "performed_by": "Mike",
      "performed_at": "2026-04-01T10:00:00Z",
      "meter_reading": 1250,
      "rental_count_at": 47,
      "created_at": "2026-04-01T10:30:00Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Create Maintenance Log

POST /v1/maintenance/logs

Create a new maintenance log entry for a fleet item.

Body Parameters:

ParameterTypeRequiredDescription
fleet_item_idstringFleet item this log belongs to
descriptionstringDescription of the maintenance performed
costintegerCost in cents
performed_atstringISO 8601 datetime when the maintenance was performed
notesstringAdditional notes
performed_bystringName of the person who performed the maintenance
meter_readingnumberOdometer / hour meter reading at time of service
rental_count_atnumberTotal rental count at time of service
schedule_idstringAssociated maintenance schedule ID
const log = await renta.maintenance.logs.create({
  fleet_item_id: 'fi_abc123',
  description: 'Brake pad replacement',
  cost: 4500,
  performed_at: '2026-04-01T10:00:00Z',
  performed_by: 'Mike',
  notes: 'Replaced front and rear pads',
  meter_reading: 1250,
});
console.log(log.id);
curl -X POST https://api.getrenta.io/v1/maintenance/logs \
  -H "Authorization: Bearer renta_sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "fleet_item_id": "fi_abc123",
    "description": "Brake pad replacement",
    "cost": 4500,
    "performed_at": "2026-04-01T10:00:00Z",
    "performed_by": "Mike",
    "notes": "Replaced front and rear pads",
    "meter_reading": 1250
  }'

Response (201):

{
  "id": "ml_def456",
  "schedule_id": null,
  "fleet_item_id": "fi_abc123",
  "description": "Brake pad replacement",
  "notes": "Replaced front and rear pads",
  "cost": 4500,
  "performed_by": "Mike",
  "performed_at": "2026-04-01T10:00:00Z",
  "meter_reading": 1250,
  "rental_count_at": null,
  "created_at": "2026-04-07T21:00:00Z"
}