Create Route Plan

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

NameTypeDescription
nameStringRequired. The name for the route.
startTimetimestamp in unixRequired. Planned Start Time for this route
taskIdsarray of stringsOptional. An array of tasks to include in the route plan. An empty array is allowed. See Create task on how to create a Task.
colorStringOptional. A display color for the route.
vehicleTypeStringOptional. The Type of the vehicle in use for this Route Plan.
workerStringOptional. Worker's Id to assign the Route Plan.
teamStringOptional. Team's Id to assign the Route Plan.
startAtStringOptional. Starting position for the Route Plan, this can be HUB, WORKER_LOCATION, WORKER_ADDRESS, or null to signify anywhere
endAtStringOptional. Ending position for the Route Plan, this can be HUB, WORKER_LOCATION, WORKER_ADDRESS, or null to signify anywhere.
startingHubIdStringOptional. Required when startAt is HUB. This requires Hud Id that will act as the beginning point of the Route.
endingHubIdStringOptional. Required when startAt is HUB. This requires Hud Id that will act as the ending point of the Route.
endTimeStringOptional. Planned End Time for this route.
timezoneStringOptional. 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
}