> ## Documentation Index
> Fetch the complete documentation index at: https://api-doc.track.graviton.ma/llms.txt
> Use this file to discover all available pages before exploring further.

# Tracking and reports

> Retrieve history and produce fleet reports.

## Retrieve location history

Use explicit UTC timestamps or offsets. Replace the synthetic object identifier before running this request:

```bash theme={null}
curl --fail-with-body --get \
  'https://fleet.graviton.ma/api/v2/objects/DEMO_VEHICLE_01/history' \
  -H "Authorization: Bearer $GRAVITON_API_TOKEN" \
  --data-urlencode 'from=2026-10-01T00:00:00Z' \
  --data-urlencode 'to=2026-10-02T00:00:00Z' \
  --data-urlencode 'page=1' \
  --data-urlencode 'per_page=500'
```

History is returned in ascending tracker-time order. `from` and `to` are required, `from` must not be later than `to`, and the interval must not exceed 93 days. Time bounds are inclusive; account for the shared boundary when joining adjacent windows.

## Choose the right endpoint

| Endpoint suffix | Result |
| - | - |
| `/position` | Latest stored coordinates and tracker values |
| `/status` | Active state, timestamps, speed, odometer, and engine hours |
| `/history` | Paginated location records |
| `/route` | Route points, calculated distance, and truncation flag |
| `/mileage` | Calculated distance and truncation flag, without route points |
| `/stops` | Segments with speed below 1 |
| `/drives` | Segments with speed of 1 or greater |
| `/engine-hours` | Current engine-hour value, mode, and tracker timestamp |

For route and mileage calculations, inspect `truncated`. Split large time ranges when the point cap is reached. Stop and drive calculations also cap input at 10,000 points; use bounded windows. Calculated GPS distance can differ from a vehicle odometer.

## Generate a report

```bash theme={null}
curl --fail-with-body 'https://fleet.graviton.ma/api/v2/reports/generate' \
  -H "Authorization: Bearer $GRAVITON_API_TOKEN" \
  -H 'Content-Type: application/json' \
  --data '{"type":"latest_positions"}'
```

Supported types are `latest_positions`, `events`, `services`, and `rfid`. For `events` and `rfid`, also supply `from` and `to`. Report generation is read-only even though it uses POST.

The JSON result includes `type`, `generated_at`, `rows`, and `count` within `data`. Add `?format=csv` to download CSV. To download an existing saved report definition, use `GET /reports/{id}/download`; date-based definitions need `from` and `to` query parameters.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.