Diagrams & stored renders
Render side-view and top-down diagrams for every trailer and leg into versioned SVG/PNG files, read their status and history, and serve them to public pages.
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/v1/render/status/{trip_id} |
Per trailer/leg/kind: current version, stale (plan changed since), pending (last render failed), URLs |
POST |
/v1/render/render/{trip_id} |
Render what is stale (force=1 for everything; trip_trailer_id/leg_id to narrow) |
GET |
`/v1/render/file/{render_id}.{svg | png}?theme=` |
GET |
/v1/render/history/{trip_trailer_id}/{leg_id} |
Previous versions |
POST |
/v1/render/purge/{trip_id} |
Delete superseded versions (keeps current) |
Kinds: side (whole rig, themes light | dark | print) and top_row_{n} (one per rack row, US orientation — passenger top, driver bottom, tongue left). Rendering is synchronous and idempotent: a render of an unchanged plan returns the existing version.
Request
GET /v1/render/status/1
Authorization: Bearer rp_live_••••••••
Response 200
{
"success": true,
"trip_id": 1,
"plans": [
{
"trip_trailer_id": 1,
"from_stop_id": 1,
"leg_id": 1,
"version": null,
"fingerprint": null,
"rendered_at": null,
"rendered_by": null,
"status": "none",
"error": null,
"png_available": false,
"files": [],
"pending": null,
"leg_index": 0,
"live_fingerprint": "83b3b3434ac8b57db47c99bb36605d9e30a5571a3203a7e7c144e1d9be758b6d",
"live_error": null,
"stale": false
},
{
"trip_trailer_id": 1,
"from_stop_id": 2,
"leg_id": 2,
"version": null,
"fingerprint": null,
"rendered_at": null,
"rendered_by": null,
"status": "none",
"error": null,
"png_available": false,
"files": [],
"pending": null,
"leg_index": 1,
"live_fingerprint": "31e2c80f4d976d71c505b478569268f64815c4321e23097d992d170548e90787",
"live_error": null,
"stale": false
},
{
"trip_trailer_id": 1,
"from_stop_id": 4,
"leg_id": 3,
"version": null,
"fingerprint": null,
"rendered_at": null,
"rendered_by": null,
"status": "none",
"error": null,
"png_available": false,
"files": [],
"pending": null,
"leg_index": 2,
"live_fingerprint": "ee70f756a8595f899696ec7748887d28dfb72599bf3f0ce1214d8c97f44920bf",
"live_error": null,
"stale": false
}
],
"trailers": [
{
"id": 1,
"trip_id": 1,
"trailer_id": 1,
"tow_vehicle_id": 1,
"driver_name": "Dana Rivers",
"driver_phone": "+1 555 0100",
"sort_order": 0,
"drivers": [],
"can_operate": true,
"trailer_name": "40' 4-row / 3-wide shell trailer (template)",
"trailer_ok": true
}
],
"legs": [
{
"leg_id": 1,
"trip_id": 1,
"leg_index": 0,
"from_stop_id": 1,
"to_stop_id": 2,
"from_name": "Boathouse",
"to_name": "Podunk RC",
"from_type": "origin",
"to_type": "pickup",
"label": "Leg 1: Boathouse → Podunk RC",
"updated_at": "2027-01-15 08:00:00"
},
{
"leg_id": 2,
"trip_id": 1,
"leg_index": 1,
"from_stop_id": 2,
"to_stop_id": 4,
"from_name": "Podunk RC",
"to_name": "Head of the River",
"from_type": "pickup",
"to_type": "regatta",
"label": "Leg 2: Podunk RC → Head of the River",
"updated_at": "2027-01-15 08:00:00"
},
{
"leg_id": 3,
"trip_id": 1,
"leg_index": 2,
"from_stop_id": 4,
"to_stop_id": 5,
"from_name": "Head of the River",
"to_name": "Boathouse",
"from_type": "regatta",
"to_type": "destination",
"label": "Leg 3: Head of the River → Boathouse",
"updated_at": "2027-01-15 08:00:00"
}
],
"can_edit": true,
"png_available": false
}
On-demand (unstored) SVGs are also available for editors: GET /v1/trailer/preview/{id} for an empty trailer and the diagram_url returned by placement/plan for a live leg.