Onfleet Webhooks API

Register HTTPS callbacks against 27 trigger types covering task lifecycle, worker duty/CRUD, route plan state changes, SMS recipient events, and async job completions (auto-dispatch, task batch create, route optimization). Payloads are signed with HMAC-SHA256 using the secret obtained from /webhooks/secret.

OpenAPI Specification

onfleet-webhooks-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Onfleet Destinations Webhooks API
  description: 'The Destinations API manages physical addresses associated with tasks.

    Destinations include parsed address fields and a GeoJSON location, and can

    be reused across tasks. Onfleet geocodes addresses on creation; you can

    also supply an `unparsed` address.

    '
  version: '2.7'
  contact:
    name: Onfleet Support
    email: support@onfleet.com
  license:
    name: Onfleet Terms of Service
    url: https://onfleet.com/legal
servers:
- url: https://onfleet.com/api/v2
  description: Production
security:
- basicAuth: []
tags:
- name: Webhooks
paths:
  /webhooks:
    get:
      tags:
      - Webhooks
      summary: List Webhooks
      operationId: listWebhooks
      responses:
        '200':
          description: Webhooks
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Webhook'
    post:
      tags:
      - Webhooks
      summary: Create Webhook
      operationId: createWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookCreate'
      responses:
        '200':
          description: Webhook created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
  /webhooks/{webhookId}:
    parameters:
    - name: webhookId
      in: path
      required: true
      schema:
        type: string
    put:
      tags:
      - Webhooks
      summary: Update Webhook
      operationId: updateWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                name:
                  type: string
                threshold:
                  type: integer
      responses:
        '200':
          description: Updated webhook
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
    delete:
      tags:
      - Webhooks
      summary: Delete Webhook
      operationId: deleteWebhook
      responses:
        '200':
          description: Webhook deleted
  /webhooks/secret:
    get:
      tags:
      - Webhooks
      summary: Get Webhook Signing Secret
      operationId: getWebhookSecret
      responses:
        '200':
          description: Signing secret
          content:
            application/json:
              schema:
                type: object
                properties:
                  secret:
                    type: string
components:
  schemas:
    WebhookCreate:
      type: object
      required:
      - url
      - trigger
      properties:
        url:
          type: string
          format: uri
        name:
          type: string
        trigger:
          type: integer
        threshold:
          type: integer
          description: Required for triggers that compare against a threshold (taskEta
          taskArrival: null
          taskDelayed).: null
    Webhook:
      type: object
      properties:
        id:
          type: string
        organization:
          type: string
        url:
          type: string
          format: uri
        name:
          type: string
        count:
          type: integer
        trigger:
          type: integer
          enum:
          - 0
          - 1
          - 2
          - 3
          - 4
          - 5
          - 6
          - 7
          - 8
          - 9
          - 10
          - 12
          - 13
          - 14
          - 15
          - 16
          - 17
          - 18
          - 19
          - 20
          - 22
          - 23
          - 24
          - 25
          - 26
          - 27
          - 28
          - 29
          - 30
        threshold:
          type: integer
          nullable: true
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic