Webhooks

Webhooks

Webhooks make it possible for your application to be notified of important system events, as soon as these take place within Onfleet.

While you are generally able to create as many webhook entries as you'd like, remember that a single webhook always targets a single trigger. The following triggers are available:

IDNameDescriptionIncludesLimitations
0taskStartedTask started by worker.taskId, data.taskNone
1taskEtaWorker ETA less than or equal to threshold value provided, in seconds.taskId, data.task, etaSecondsLimit of 10 webhooks. Each will fire once per task, at most once every 30 seconds, when threshold is met.
2taskArrivalWorker arriving, at or closer than threshold value provided, in meters.taskId, data.task, distanceLimit of 10 webhooks. Each will fire once per task, at most once every 30 seconds, when threshold is met.
3taskCompletedTask marked as successful.taskId, data.taskTask cannot be both successful and failed.
4taskFailedTask failed.taskId, data.taskTask cannot be both successful and failed.
5workerDutyWorker status changed (0 for off-duty, 1 for on-duty).workerId, status, data.workerNone
6taskCreatedNew task created.taskId, data.taskDoes not include tasks created via task import from the Onfleet dashboard.
7taskUpdatedTask updated, including:

Updated completionDetails (including distance, location, added timestamps, added completion/failure notes)

When attachment ids are received under completionDetails field (This includes signature, photos)

Recipient feedback has been received(when feedback field is updated)
taskId, data.taskNone
8taskDeletedTask deleted.taskId, data.taskNone
9taskAssignedTask assigned to worker.taskId, data.taskThis webhook will only be triggered when a Task is assigned to different containers (organization, worker, team). However, when a task is assigned during creation, it will not trigger a change of assignment as the task is just created with a direct assignment.
10taskUnassignedTask unassigned from worker.taskId, data.taskNone
12taskDelayedTask is delay time is greater than or equal to threshold value provided, in seconds.taskId, data.task, delayLimit of 10 webhooks, applies only to active tasks, will only fire once.
13taskClonedTask cloned via dashboard or API. Note that the taskCreated trigger will not fire when a task is cloned.taskId, data.taskNone
14smsRecipientResponseMissedRecipient responds to a notification via SMS, but the organization is unable to handle it at that time.from, to, bodyNone
15workerCreatedA new worker has been created.adminId, workerId, actionContext , triggerId,triggerName, taskId,data.worker, timeNone
16workerDeletedA worker has been deleted.adminId, workerId, actionContext , triggerId,triggerName, taskId,data.worker, timeNone.
17SMSRecipientOptOutWhen a recipient replied "STOP" to opt out of SMS communications.recipient, timestamp, SMS, triggerId, triggerName,timeNone.
18autoDispatchJobCompletedWhen Team Auto-Dispatch calculation is completed.actionContext, adminId, data.dispatch, dispatchId, taskId, time, triggerId, triggerName, workerIdNone.
19taskBatchCreateJobCompletedWhen Async Batch Tasks creation is completed.status, tasksReceived, tasksCreated, tasksErrored, errors[], failedTasks[], newTasks[], newTasksWithWarnings[], workerId, adminId, taskId, actionContext, time, dataNone.
20routeOptimizationJobCompletedWhen Route Optimization is completedactionContext, triggerId, triggerName, taskId, workerId, adminId, data, dispatchId, time

Webhooks can be maintained via dashboard or API. All standard, non-validation requests from Onfleet to you are made via POST.

In addition to the properties from the Includes column above, the JSON body we will POST to your url will include a time property along with triggerId and triggerName so you may overload the same url on your application as required. In addition, full objects will be provided in the data property, as relevant. Note that all other properties not relevant to the trigger may be provided as null.

🚧

Unix Precision

All time data fields returned are in milliseconds precision, with the exception of etaSeconds, which is in seconds.