Trip Export
Trips can be exported as PDF, CSV, or TXT. All formats include trip details, status history, and GPS data.
REST Endpoints
| Method | Path | Permission | Description |
|---|---|---|---|
| GET | /v1/trips/{id}/export?format=pdf | trips:read | Download trip as PDF |
| GET | /v1/trips/{id}/export?format=csv | trips:read | Download trip as CSV |
| GET | /v1/trips/{id}/export?format=txt | trips:read | Download trip as plain text |
All endpoints return Content-Disposition: attachment to trigger a browser download.
PDF Export
Generated server-side with jsPDF in the Next.js API route /api/trips/[id]/export.
Sections:
- Trip Details — Name, status, description
- Route — Origin and destination locations
- Metadata — Category, weight, device, GPS logging, tags
- Timeline — Started, ended, created timestamps
- Status History — Table of all status transitions (timestamp, from, to)
- Notes — Free-text trip notes
- GPS Data — Table with timestamp, lat, lon, altitude, speed, heading
CSV Export
Contains three sections separated by # comment lines:
# Trip Info
name,status,origin,destination,category,weight_kg,device,gps_logging,tags,started_at,ended_at,created_at
Hamburg Run,completed,Hamburg Port,Bremen Depot,Container,25000,Apollon-1,true,express;priority,2026-06-20T08:00:00Z,2026-06-20T16:00:00Z,2026-06-19T10:00:00Z
# Status History
changed_at,old_status,new_status
2026-06-20T08:00:00Z,draft,active
2026-06-20T12:00:00Z,active,paused
2026-06-20T13:00:00Z,paused,active
2026-06-20T16:00:00Z,active,completed
# GPS Data
timestamp,latitude,longitude,altitude,heading,speed_kmh,speed_mps,speed_mph,speed_knots,pdop,hdop,vdop
2026-06-20T08:01:00Z,53.5511,9.9937,5.2,180.0,72.4,20.1,45.0,39.1,1.2,0.9,0.8
TXT Export
Plain text with ASCII formatting. Same content as PDF but as readable text file. Includes a fixed-width GPS data table.
GraphQL
query TripExport($id: ID!) {
trip(id: $id) {
id name status origin { id name } destination { id name }
category { id name } weightKg gpsLoggingEnabled tags notes
startedAt endedAt createdAt
}
tripGpsData(tripId: $id, page: 1, limit: 100000) {
data { latitude longitude altitude heading speedKmh timestamp }
total totalPages
}
tripStatusHistory(tripId: $id) {
oldStatus newStatus changedAt
}
}
Notes
- Export is available for trips in any status, not just
completed. - GPS point count on the trip detail page (
gpsPointCount) shows how many rows will appear. - Very large trips (many thousands of GPS points) may take a few seconds to generate.
- The export dropdown is available on both the trip view page (
/trips/[id]) and edit page (/trips/[id]/edit).