Luna ELD

Terminal Integration API

Luna ELD endpoints for withterminal.com

Base URL

https://api.lunaeld.us

Integration Flow

    1
    Create API Key
    POST /terminal/create-api-key/ with username + password to get your api_key
    2
    Fetch Company
    GET /terminal/company/ to retrieve company profile data
    3
    Get Coordinates
    GET /terminal/coordinates/ for live vehicle positions and trip history

Endpoints

POST
/api/web/v1/terminal/create-api-key/

Authenticate with username/password and receive an API key for subsequent requests.

GET
/api/web/v1/terminal/coordinates/

Vehicle GPS coordinates + location history. Filterable by VIN, vehicle ID, and date range.

GET
/api/web/v1/terminal/company/

Company profile: name, USDOT, timezone, phone.

POST/api/web/v1/terminal/create-api-key/

Authenticates a user and returns an API key. Use the returned key as the api_key parameter in all subsequent requests.

Request Body

ParameterTypeDescription
username*stringAccount email / username
password*stringAccount password

* Required

Example Request

curl -X POST "https://api.lunaeld.us/api/web/v1/terminal/create-api-key/" \
  -H "Content-Type: application/json" \
  -d '{"username": "managers@gmail.com", "password": "your_password"}'

Example Response

{
  "guid": "56806616-a27c-4516-bd31-e656792ab138",
  "key": "managers@gmail.com:company-name-9bed2373db6e6cd6e1b234",
  "company": "d5eb6f53-87ef-4195-b7c9-54ea4adeb7cc",
  "client": "managers@gmail.com"
}

Response Fields

FieldTypeDescription
guidstring (UUID)Unique identifier for this API key
keystringAPI key to pass as api_key in subsequent requests
companystring (UUID)Company unique identifier associated with this key
clientstringUsername / email of the authenticated user
GET/api/web/v1/terminal/coordinates/

Returns current GPS position, driver assignment, and location history for fleet vehicles. Provide start_date and end_date to get location_history — a list of historical GPS coordinates within that window.

Query Parameters

ParameterTypeDescription
api_key*stringAPI key from create-api-key endpoint
vinstringFilter to a single vehicle by VIN
vehicle_idstringFilter to a single vehicle by power unit number
start_datedatetimeStart of history window — format: YYYY-MM-DD HH:MM:SS
end_datedatetimeEnd of history window — format: YYYY-MM-DD HH:MM:SS

* Required. Omit vin/vehicle_id to get all vehicles.

Example Requests

All vehicles, current position only:

curl "https://api.lunaeld.us/api/web/v1/terminal/coordinates/?api_key=your_api_key"

Single vehicle with trip history for a date range:

curl "https://api.lunaeld.us/api/web/v1/terminal/coordinates/?api_key=your_api_key&vin=YOUR_VIN_HERE&start_date=2025-08-01+04:00:00&end_date=2025-08-08+04:00:00"

Example Response

[
  {
    "vehicle_id": "unit001",
    "make": "PETERBILT",
    "model": "579",
    "year": 2022,
    "vin": "1XPBD49X0ND000001",
    "odometer": 124500,
    "start_point": "3.2 mi W of Nashville, TN",
    "speed": 0.0,
    "coordinates": [
      {
        "latitude": "36.16589000000000",
        "longitude": "-86.78440000000000",
        "associated_date": "2025-08-15T10:22:00.000000Z"
      }
    ],
    "driver": {
      "username": "driver01",
      "first_name": "John",
      "last_name": "Smith",
      "phone_number": "5550001234"
    },
    "location_history": [
      {
        "latitude": 36.16589000000000,
        "longitude": -86.78440000000000,
        "associated_date": "2025-08-01T07:16:32.242146Z"
      },
      {
        "latitude": 36.16589500000000,
        "longitude": -86.78441000000000,
        "associated_date": "2025-08-01T14:21:15.018615Z"
      }
    ]
  }
]

Response Fields

FieldTypeDescription
vehicle_idstringVehicle power unit number
makestringManufacturer
modelstringVehicle model
yearnumberManufacturing year
vinstringVehicle Identification Number
odometernumberTotal mileage in miles
start_pointstringHuman-readable current location
speednumberCurrent speed in mph
coordinatesarrayLatest GPS fix — see below
driverobjectCurrently assigned driver — see below
location_historyarrayHistorical GPS points within start_date–end_date — see below

coordinates[ ] object

FieldTypeDescription
latitudestringLatitude in decimal degrees
longitudestringLongitude in decimal degrees
associated_datestring (ISO 8601)UTC timestamp of this GPS reading

driver object

FieldTypeDescription
usernamestringDriver login username
first_namestringFirst name
last_namestringLast name
phone_numberstringContact phone number

location_history[ ] object

FieldTypeDescription
latitudenumberLatitude in decimal degrees
longitudenumberLongitude in decimal degrees
associated_datestring (ISO 8601)UTC timestamp of this GPS reading
GET/api/web/v1/terminal/company/

Returns the company profile associated with the given API key: name, DOT number, timezone, and contact info.

Query Parameters

ParameterTypeDescription
api_key*stringAPI key from create-api-key endpoint

* Required

Example Request

curl "https://api.lunaeld.us/api/web/v1/terminal/company/?api_key=your_api_key"

Example Response

{
  "guid": "00000000-0000-0000-0000-000000000001",
  "name": "Example Trucking LLC",
  "phone_number": "+1 (555) 000-1234",
  "usdot": "0000001",
  "avatar": null,
  "home_terminal_timezone": "US/Central"
}

Response Fields

FieldTypeDescription
guidstring (UUID)Company unique identifier
namestringCompany legal name
phone_numberstringCompany contact phone
usdotstringUS Department of Transportation number
avatarstring | nullCompany logo URL, or null if not set
home_terminal_timezonestringTimezone of the company home terminal (e.g. US/Central, US/Eastern)