POST
Create Route Plan
Creates a route plan that allows user to configure tasks in a grouped manner and schedule accordingly.
URL: https://onfleet.com/api/v2/routePlans
Body Parameters
Name | Type | Description |
---|---|---|
name | String | Required. The name for the route. |
startTime | timestamp in unix | Required. Planned Start Time for this route |
taskIds | array of strings | Optional. An array of tasks to include in the route plan. An empty array is allowed. See Create task on how to create a Task. |
color | String | Optional. A display color for the route. |
vehicleType | String | Optional. The Type of the vehicle in use for this Route Plan. |
worker | String | Optional. Worker's Id to assign the Route Plan. |
team | String | Optional. Team's Id to assign the Route Plan. |
startAt | String | Optional. Starting position for the Route Plan, this can be HUB , WORKER_LOCATION , WORKER_ADDRESS , or null to signify anywhere |
endAt | String | Optional. Ending position for the Route Plan, this can be HUB , WORKER_LOCATION , WORKER_ADDRESS , or null to signify anywhere. |
startingHubId | String | Optional. Required when startAt is HUB . This requires Hud Id that will act as the beginning point of the Route. |
endingHubId | String | Optional. Required when startAt is HUB . This requires Hud Id that will act as the ending point of the Route. |
endTime | String | Optional. Planned End Time for this route. |
timezone | String | Optional. The Timezone the Route Plan should be in. |
{
"name": "Tuesday Route",
"color": "#abcabc",
"startTime": 1711495000000,
"timezone": "America/New_York",
"tasks": ["jTnA4l3GwjRB8GJgX3SztuN7", "GWassQo5H3TEKO3PqZdCFmZ7",
"6q4kADgRMuNcw*klH6mFyZjn"]
}
{
"id": "RETDXi77BuMnqlXKjtxFTNg3",
"name": "CTrevor_03-06-2024_0000",
"state": "PENDING",
"color": "#52A9FF",
"tasks": [
"jTnA4l3GwjRB8GJgX3SztuN7",
"6q4kADgRMuNcw*klH6mFyZjn",
"GWassQo5H3TEKO3PqZdCFmZ7"
],
"organization": "l6DYZUv~3HFFDnhPZSPUSDyt",
"team": null,
"worker": "mRhbKuxwM1dgNdm8eWSHkGga",
"vehicleType": "CAR",
"startTime": 1709701200000,
"endTime": null,
"actualStartTime": null,
"actualEndTime": null,
"startingHubId": null,
"endingHubId": null,
"shortId": "2aebfa80",
"timeCreated": 1709738334382,
"timeLastModified": 1711029056245
}