> ## 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.

# Quickstart

> Authenticate, list your fleet, and retrieve a vehicle position.

## 1. Create or select an API token

You need an API-enabled Graviton account that is active and unexpired. Create or select an API token from the **API** tab in the user account administration dialog. Give the token only the permissions your integration requires. This quickstart needs `account:read`, `objects:read`, and `tracking:read`. See [Authentication and access](/authentication) for every permission.

Store the token in a server-side environment variable. Keep it out of browser code, mobile bundles, source control, and logs.

```bash theme={null}
export GRAVITON_API_TOKEN='YOUR_API_TOKEN'
export GRAVITON_BASE_URL='https://fleet.graviton.ma/api/v2'
```

## 2. Confirm your account

```bash theme={null}
curl --fail-with-body "$GRAVITON_BASE_URL/me" \
  -H "Authorization: Bearer $GRAVITON_API_TOKEN" \
  -H 'Accept: application/json'
```

A successful JSON response has `success: true`, your account under `data`, and a request identifier under `meta.request_id`.

## 3. List your vehicles

```bash theme={null}
curl --fail-with-body --get "$GRAVITON_BASE_URL/objects" \
  -H "Authorization: Bearer $GRAVITON_API_TOKEN" \
  --data-urlencode 'page=1' \
  --data-urlencode 'per_page=50'
```

Read the objects in `data`. Use `meta.pages` to fetch subsequent pages. Keep object identifiers as strings.

## 4. Get a position

Replace `DEMO_VEHICLE_01` with an `imei` returned by the previous request.

```bash theme={null}
curl --fail-with-body \
  "$GRAVITON_BASE_URL/objects/DEMO_VEHICLE_01/position" \
  -H "Authorization: Bearer $GRAVITON_API_TOKEN"
```

Inspect `dt_tracker` and `dt_server` before treating a stored position as current. A successful response does not mean the tracker is online now.

## Python example

Install `requests`, then run this from your backend with `GRAVITON_API_TOKEN` set:

```python theme={null}
import os
import requests

response = requests.get(
    "https://fleet.graviton.ma/api/v2/objects",
    headers={"Authorization": f"Bearer {os.environ['GRAVITON_API_TOKEN']}"},
    params={"page": 1, "per_page": 50},
    timeout=30,
)
response.raise_for_status()
payload = response.json()
for vehicle in payload["data"]:
    print(vehicle["imei"], vehicle["name"])
```


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