Route Plan
The route plan resource.
/routePlanList route plans
Retrieve a paginated list of route plans. Filter, order, and select columns with PostgREST query parameters.
Query parameters
selectstringComma-separated columns to return. Defaults to all.
orderstringColumn to sort by, e.g. `createdAt.desc`.
limitintegerMaximum rows to return.
offsetintegerRows to skip, for pagination.
curl --request GET \
--url '<your-host>/routePlan?select=*&limit=10' \
--header 'Authorization: Bearer <api-key>'[
{
"id": "abc123def456",
"companyId": "xyz789",
"planDate": "2026-01-01",
"status": "string",
"stopCount": 10,
"createdBy": "string",
"createdAt": "2026-01-01T00:00:00Z",
"updatedAt": "2026-01-01T00:00:00Z"
}
]/routePlanRetrieve a route plan
Fetch a single route plan by filtering on `id`.
Query parameters
idstringMatch on the route plan's `id`, e.g. `eq.{id}`.
curl --request GET \
--url '<your-host>/routePlan?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'{
"id": "abc123def456",
"companyId": "xyz789",
"planDate": "2026-01-01",
"status": "string",
"stopCount": 10,
"createdBy": "string",
"createdAt": "2026-01-01T00:00:00Z",
"updatedAt": "2026-01-01T00:00:00Z"
}/routePlanCreate a route plan
Create a new route plan.
Body parameters
companyIdstringrequiredReferences company.id
planDatedaterequiredvehicleIdstringReferences vehicle.id
driverIdstringReferences user.id
territorystringstatusstringrequiredtotalDriveSecondsnumberstopCountnumberrequiredplannerstringgeometryobjectvalidFromtimestamprequiredvalidTotimestampapprovedFromRoutePlanIdstringReferences routePlan.id
proposedFromSolverTransactionstringThe solver transaction this proposal was landed from. Null unless a solver run produced the row; one proposal per truck per run.
depotLocationIdstringReferences location.id
curl --request POST \
--url <your-host>/routePlan \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"companyId":"xyz789","planDate":"2026-01-01","status":"string","stopCount":10,"validFrom":"2026-01-01T00:00:00Z"}'{
"id": "abc123def456",
"companyId": "xyz789",
"planDate": "2026-01-01",
"status": "string",
"stopCount": 10,
"createdBy": "string",
"createdAt": "2026-01-01T00:00:00Z",
"updatedAt": "2026-01-01T00:00:00Z"
}/routePlanUpdate a route plan
Update an existing route plan, matched on `id`.
Body parameters
companyIdstringrequiredReferences company.id
planDatedaterequiredvehicleIdstringReferences vehicle.id
driverIdstringReferences user.id
territorystringstatusstringrequiredtotalDriveSecondsnumberstopCountnumberrequiredplannerstringgeometryobjectvalidFromtimestamprequiredvalidTotimestampapprovedFromRoutePlanIdstringReferences routePlan.id
proposedFromSolverTransactionstringThe solver transaction this proposal was landed from. Null unless a solver run produced the row; one proposal per truck per run.
depotLocationIdstringReferences location.id
curl --request PATCH \
--url '<your-host>/routePlan?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"companyId":"xyz789"}'{
"id": "abc123def456",
"companyId": "xyz789",
"planDate": "2026-01-01",
"status": "string",
"stopCount": 10,
"createdBy": "string",
"createdAt": "2026-01-01T00:00:00Z",
"updatedAt": "2026-01-01T00:00:00Z"
}/routePlanDelete a route plan
Delete a route plan, matched on `id`. Returns 204 No Content.
Query parameters
idstringThe `id` of the route plan to delete, e.g. `eq.{id}`.
curl --request DELETE \
--url '<your-host>/routePlan?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'