Skip to content

Route Plan

The route plan resource.

Base/routePlan
GET/routePlan

List route plans

Retrieve a paginated list of route plans. Filter, order, and select columns with PostgREST query parameters.

Query parameters

selectstring

Comma-separated columns to return. Defaults to all.

orderstring

Column to sort by, e.g. `createdAt.desc`.

limitinteger

Maximum rows to return.

offsetinteger

Rows to skip, for pagination.

GET/routePlan
curl --request GET \
  --url '<your-host>/routePlan?select=*&limit=10' \
  --header 'Authorization: Bearer <api-key>'
Response
[
  {
    "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"
  }
]
GET/routePlan

Retrieve a route plan

Fetch a single route plan by filtering on `id`.

Query parameters

idstring

Match on the route plan's `id`, e.g. `eq.{id}`.

GET/routePlan
curl --request GET \
  --url '<your-host>/routePlan?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
Response
{
  "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"
}
POST/routePlan

Create a route plan

Create a new route plan.

Body parameters

companyIdstringrequired

References company.id

planDatedaterequired
vehicleIdstring

References vehicle.id

driverIdstring

References user.id

territorystring
statusstringrequired
totalDriveSecondsnumber
stopCountnumberrequired
plannerstring
geometryobject
validFromtimestamprequired
validTotimestamp
approvedFromRoutePlanIdstring

References routePlan.id

proposedFromSolverTransactionstring

The solver transaction this proposal was landed from. Null unless a solver run produced the row; one proposal per truck per run.

depotLocationIdstring

References location.id

POST/routePlan
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"}'
Response
{
  "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"
}
PATCH/routePlan

Update a route plan

Update an existing route plan, matched on `id`.

Body parameters

companyIdstringrequired

References company.id

planDatedaterequired
vehicleIdstring

References vehicle.id

driverIdstring

References user.id

territorystring
statusstringrequired
totalDriveSecondsnumber
stopCountnumberrequired
plannerstring
geometryobject
validFromtimestamprequired
validTotimestamp
approvedFromRoutePlanIdstring

References routePlan.id

proposedFromSolverTransactionstring

The solver transaction this proposal was landed from. Null unless a solver run produced the row; one proposal per truck per run.

depotLocationIdstring

References location.id

PATCH/routePlan
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"}'
Response
{
  "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"
}
DELETE/routePlan

Delete a route plan

Delete a route plan, matched on `id`. Returns 204 No Content.

Query parameters

idstring

The `id` of the route plan to delete, e.g. `eq.{id}`.

DELETE/routePlan
curl --request DELETE \
  --url '<your-host>/routePlan?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
204 No Content