Eld Data Upsert Many V1 Ep
POST/v1/driver_schedule/eld_data/upsert_many
Bulk Upsert ELD Data
Processes Electronic Logging Device (ELD) data for drivers to enable HOS compliance tracking and accurate payroll calculations. This endpoint accepts duty period data from ELD systems and matches it to existing Gravitate driver shifts using a time-based matching algorithm.
Background
This endpoint enables two key customer experiences:
HOS Compliance: Dispatchers see real-time driver Hours of Service data on nameplates with alerts for violations and scheduling conflicts.
Accurate Payroll: Payroll administrators use precise ELD hours and miles data instead of in-cab app data for more accurate driver compensation.
Shift Matching Algorithm
The system uses a ±6 hour tolerance window to match ELD duty periods to existing Gravitate shifts:
- Finds the closest Gravitate shift start within ±6 hours of the ELD
duty_period_start - If no match is found, the request is returned as an error with details
Request
source_system: str
The name of the ELD system providing the data.
source_id: str
Unique identifier for this duty period within the source ELD system.
driver_id: str
External ELD driver identifier that maps to the Gravitate driver.
duty_period_start: datetime
Start timestamp of the duty period in UTC.
duty_period_end: datetime | None = None
End timestamp of the duty period in UTC.
shift_data: object
Contains shift-level metrics:
Show Child Attributes
total_drive_hours: float
Total driving time during this duty period.
total_on_duty_hours: float
Total on-duty time (including driving and non-driving work).
total_miles: float
Total miles driven during this duty period.
starting_odometer: float | None = None
Odometer reading at the start of the duty period.
ending_odometer: float | None = None
Odometer reading at the end of the duty period.
hos_compliance_data: object | None = None
Hours of Service compliance metrics:
Show Child Attributes
drive_time_max_shift_hours: float
Maximum allowable drive time for a single shift.
on_duty_max_shift_hours: float
Maximum allowable on-duty time for a single shift.
weekly_on_duty_hours: float
Current accumulated on-duty hours for the week.
weekly_on_duty_max_hours: float
Maximum allowable weekly on-duty hours.
hos_cycle: str
Metadata field to be displayed on driver's hours of service card (ex: "7-day" or "8-day" cycle).
Response
success: int
The number of ELD data records successfully processed and matched to driver shifts.
errors: list
Array of requests that failed processing, each containing the original request data plus an error message explaining why the match failed (e.g., no driver shift found within the ±6 hour tolerance window).
Responses
- 200
- 422
Successful Response
- application/json
- Example (from schema)
{
"success": 0,
"errors": [
{
"source_system": "string",
"source_id": "string",
"driver_id": "string",
"duty_period_start": "2025-12-17T21:49:50.716Z",
"duty_period_end": "2025-12-17T21:49:50.716Z",
"shift_data": {
"total_drive_hours": 0,
"total_on_duty_hours": 0,
"total_miles": 0
},
"hos_compliance_data": {
"drive_time_max_shift_hours": 0,
"on_duty_max_shift_hours": 0,
"weekly_on_duty_hours": 0,
"weekly_on_duty_max_hours": 0,
"hos_cycle": "string"
},
"error": "string"
}
]
}
Validation Error
- application/json
- Example (from schema)
{
"detail": [
{
"loc": [
"string",
0
],
"msg": "string",
"type": "string"
}
]
}