Onfleet · AsyncAPI Specification

Onfleet Webhooks

Version 2.7

Real-time event stream delivered as HTTPS POST callbacks from Onfleet to a URL you register via the Webhooks API. Each webhook is bound to a single triggerId; payloads share a common envelope with `time`, `triggerId`, `triggerName`, and `data`.

View Spec View on GitHub Last Mile DeliveryLogisticsFleet ManagementDispatchRoute OptimizationCourierDriversTrackingGeocodingWebhooksAISaaSAsyncAPIWebhooksEvents

Channels

task.started
subscribe onTaskStarted
Task started by worker.
task.eta
subscribe onTaskEta
Worker ETA meets configured threshold (seconds).
task.arrival
subscribe onTaskArrival
Worker proximity meets configured threshold (meters).
task.completed
subscribe onTaskCompleted
Task marked successful.
task.failed
subscribe onTaskFailed
Task failed.
worker.duty
subscribe onWorkerDuty
Worker on/off duty status changed.
task.created
subscribe onTaskCreated
task.updated
subscribe onTaskUpdated
task.deleted
subscribe onTaskDeleted
task.assigned
subscribe onTaskAssigned
task.unassigned
subscribe onTaskUnassigned
task.delayed
subscribe onTaskDelayed
task.cloned
subscribe onTaskCloned
task.predicted.delay
subscribe onPredictedTaskDelay
sms.response.missed
subscribe onSmsRecipientResponseMissed
sms.recipient.opt_out
subscribe onSMSRecipientOptOut
worker.created
subscribe onWorkerCreated
worker.deleted
subscribe onWorkerDeleted
worker.updated
subscribe onWorkerUpdated
auto_dispatch.completed
subscribe onAutoDispatchJobCompleted
task_batch_create.completed
subscribe onTaskBatchCreateJobCompleted
route_optimization.completed
subscribe onRouteOptimizationJobCompleted
route_plan.created
subscribe onRoutePlanCreated
route_plan.started
subscribe onRoutePlanStarted
route_plan.completed
subscribe onRoutePlanCompleted
route_plan.updated
subscribe onRoutePlanUpdated
route_plan.unassigned
subscribe onRoutePlanUnassigned
route_plan.assigned
subscribe onRoutePlanAssigned
route_plan.delayed
subscribe onRoutePlanDelayed

Messages

Task
Task
Worker
Worker
RoutePlan
RoutePlan
Sms
Sms
JobCompletion
JobCompletion

Servers

https
production https://onfleet.com

AsyncAPI Specification

Raw ↑
asyncapi: 2.6.0
info:
  title: Onfleet Webhooks
  version: '2.7'
  description: |
    Real-time event stream delivered as HTTPS POST callbacks from Onfleet to a
    URL you register via the Webhooks API. Each webhook is bound to a single
    triggerId; payloads share a common envelope with `time`, `triggerId`,
    `triggerName`, and `data`.
  contact:
    name: Onfleet Support
    email: [email protected]
defaultContentType: application/json
servers:
  production:
    url: https://onfleet.com
    protocol: https
channels:
  task.started:
    description: Task started by worker.
    subscribe:
      operationId: onTaskStarted
      message: {$ref: '#/components/messages/Task'}
  task.eta:
    description: Worker ETA meets configured threshold (seconds).
    subscribe:
      operationId: onTaskEta
      message: {$ref: '#/components/messages/Task'}
  task.arrival:
    description: Worker proximity meets configured threshold (meters).
    subscribe:
      operationId: onTaskArrival
      message: {$ref: '#/components/messages/Task'}
  task.completed:
    description: Task marked successful.
    subscribe:
      operationId: onTaskCompleted
      message: {$ref: '#/components/messages/Task'}
  task.failed:
    description: Task failed.
    subscribe:
      operationId: onTaskFailed
      message: {$ref: '#/components/messages/Task'}
  worker.duty:
    description: Worker on/off duty status changed.
    subscribe:
      operationId: onWorkerDuty
      message: {$ref: '#/components/messages/Worker'}
  task.created:
    subscribe:
      operationId: onTaskCreated
      message: {$ref: '#/components/messages/Task'}
  task.updated:
    subscribe:
      operationId: onTaskUpdated
      message: {$ref: '#/components/messages/Task'}
  task.deleted:
    subscribe:
      operationId: onTaskDeleted
      message: {$ref: '#/components/messages/Task'}
  task.assigned:
    subscribe:
      operationId: onTaskAssigned
      message: {$ref: '#/components/messages/Task'}
  task.unassigned:
    subscribe:
      operationId: onTaskUnassigned
      message: {$ref: '#/components/messages/Task'}
  task.delayed:
    subscribe:
      operationId: onTaskDelayed
      message: {$ref: '#/components/messages/Task'}
  task.cloned:
    subscribe:
      operationId: onTaskCloned
      message: {$ref: '#/components/messages/Task'}
  task.predicted.delay:
    subscribe:
      operationId: onPredictedTaskDelay
      message: {$ref: '#/components/messages/Task'}
  sms.response.missed:
    subscribe:
      operationId: onSmsRecipientResponseMissed
      message: {$ref: '#/components/messages/Sms'}
  sms.recipient.opt_out:
    subscribe:
      operationId: onSMSRecipientOptOut
      message: {$ref: '#/components/messages/Sms'}
  worker.created:
    subscribe:
      operationId: onWorkerCreated
      message: {$ref: '#/components/messages/Worker'}
  worker.deleted:
    subscribe:
      operationId: onWorkerDeleted
      message: {$ref: '#/components/messages/Worker'}
  worker.updated:
    subscribe:
      operationId: onWorkerUpdated
      message: {$ref: '#/components/messages/Worker'}
  auto_dispatch.completed:
    subscribe:
      operationId: onAutoDispatchJobCompleted
      message: {$ref: '#/components/messages/JobCompletion'}
  task_batch_create.completed:
    subscribe:
      operationId: onTaskBatchCreateJobCompleted
      message: {$ref: '#/components/messages/JobCompletion'}
  route_optimization.completed:
    subscribe:
      operationId: onRouteOptimizationJobCompleted
      message: {$ref: '#/components/messages/JobCompletion'}
  route_plan.created:
    subscribe:
      operationId: onRoutePlanCreated
      message: {$ref: '#/components/messages/RoutePlan'}
  route_plan.started:
    subscribe:
      operationId: onRoutePlanStarted
      message: {$ref: '#/components/messages/RoutePlan'}
  route_plan.completed:
    subscribe:
      operationId: onRoutePlanCompleted
      message: {$ref: '#/components/messages/RoutePlan'}
  route_plan.updated:
    subscribe:
      operationId: onRoutePlanUpdated
      message: {$ref: '#/components/messages/RoutePlan'}
  route_plan.unassigned:
    subscribe:
      operationId: onRoutePlanUnassigned
      message: {$ref: '#/components/messages/RoutePlan'}
  route_plan.assigned:
    subscribe:
      operationId: onRoutePlanAssigned
      message: {$ref: '#/components/messages/RoutePlan'}
  route_plan.delayed:
    subscribe:
      operationId: onRoutePlanDelayed
      message: {$ref: '#/components/messages/RoutePlan'}
components:
  messageTraits:
    common:
      headers:
        type: object
        properties:
          X-Onfleet-Signature:
            type: string
            description: HMAC-SHA256 of the payload using the webhook signing secret.
  messages:
    Task:
      traits:
        - $ref: '#/components/messageTraits/common'
      payload:
        type: object
        properties:
          time: {type: integer, format: int64}
          triggerId: {type: integer}
          triggerName: {type: string}
          taskId: {type: string}
          workerId: {type: string, nullable: true}
          data:
            type: object
            properties:
              task: {type: object}
              worker: {type: object, nullable: true}
    Worker:
      traits:
        - $ref: '#/components/messageTraits/common'
      payload:
        type: object
        properties:
          time: {type: integer, format: int64}
          triggerId: {type: integer}
          triggerName: {type: string}
          data:
            type: object
            properties:
              worker: {type: object}
              status: {type: integer, enum: [0, 1]}
    RoutePlan:
      traits:
        - $ref: '#/components/messageTraits/common'
      payload:
        type: object
        properties:
          time: {type: integer, format: int64}
          triggerId: {type: integer}
          triggerName: {type: string}
          data:
            type: object
            properties:
              routePlan: {type: object}
    Sms:
      traits:
        - $ref: '#/components/messageTraits/common'
      payload:
        type: object
        properties:
          time: {type: integer, format: int64}
          triggerId: {type: integer}
          triggerName: {type: string}
          data:
            type: object
            properties:
              recipient: {type: object}
              message: {type: string}
    JobCompletion:
      traits:
        - $ref: '#/components/messageTraits/common'
      payload:
        type: object
        properties:
          time: {type: integer, format: int64}
          triggerId: {type: integer}
          triggerName: {type: string}
          data:
            type: object
            properties:
              jobId: {type: string}
              status: {type: string}
              results: {type: object}