SmartRoutes Webhooks API

Configure a webhook receiver URL in your depot settings and SmartRoutes will deliver event notifications as they happen. Ten event types are emitted, each documented below with its payload schema and an example delivery: | Event | Type ID | Fires when | |---|---|---| | [orders.status](#tag/Webhooks/operation/orders.status) | 2 | An order's status changes (line-item or order-level transition) | | [routes.dispatched](#tag/Webhooks/operation/routes.dispatched) | 3 | A route is dispatched (published to its driver). | | [plans.created](#tag/Webhooks/operation/plans.created) | 4 | A Plan row is persisted (after `POST /plans/optimise/orders` or `/orders-for-ids`). Fires *before* optimisation completes. | | [plans.dispatched](#tag/Webhooks/operation/plans.dispatched) | 5 | A Plan is dispatched (routes published to drivers). | | [routes.edited](#tag/Webhooks/operation/routes.edited) | 6 | A dispatched route is edited (re-ordering stops, etc.) | | [routes.deleted](#tag/Webhooks/operation/routes.deleted) | 7 | One or more dispatched routes are deleted (typically as part of solution replacement) | | [routes.completed](#tag/Webhooks/operation/routes.completed) | 8 | A dispatched route is completed by the driver. | | [plans.deleted](#tag/Webhooks/operation/plans.deleted) | 9 | A Plan row is destroyed | | [orders.on_delivery](#tag/Webhooks/operation/orders.on_delivery) | 10 | A stop enters its on-delivery ETA window on a dispatched route (the arriving-soon signal). | | [orders.will_miss_window](#tag/Webhooks/operation/orders.will_miss_window) | 11 | A delivery stop's live ETA passes the end of its time window by more than the depot's grace. Once per order per stop. | # Delivery envelope Each event is delivered as an `HTTP POST` to the receiver URL configured in your depot settings. The request body is always a JSON object of shape: ```text { "type": , "data": } ``` The `data` field is the payload object for a single event — NOT an array. Bulk operations (e.g. order-status changes from a route delete) fan out into one POST per event, each with its own `data` object. # Delivery headers Outgoing requests carry `Content-Type: application/json` and an HTTP Basic `Authorization` header derived from the username/password you supplied when configuring the webhook. No HMAC signature header is sent; treat the basic-auth credentials as the integrity check and rotate them if compromised. # Timeout and retries Each delivery has a server-side request timeout of **3 seconds**. On failure (HTTP error, timeout, or connection error) the delivery is retried up to **3 times total**; after the third failure the task is marked permanently `ERROR` and not retried again. Your receiver should respond `2xx` quickly — slow receivers will be treated as failures. # Machine-readable schemas The delivery envelope and per-event payloads are also defined under `#/components/schemas/`: `WebhookDelivery`, `WebhookOrdersStatusPayload`, `WebhookPlanIdPayload`, `WebhookRouteIdPayload`, `WebhookOnDeliveryPayload`, `WebhookWillMissWindowPayload`. Reference these from your own integration's tests / contract tools to catch shape drift early.

GitHub OpenAPI

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/smartroutes-io:smartroutes-io-webhooks-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

smartroutes-io-webhooks-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: SmartRoutes Webhooks API
  description: '# Getting started


    ## Introduction


    The SmartRoutes API gives your software programmatic access to the SmartRoutes platform. You can manage the full delivery lifecycle from your own systems. Push orders and customers in from your ERP, e-commerce or WMS. Keep your fleet, capacities and zones in sync. Run route optimisation and dispatch plans to drivers. Then pull back what happened on the road: order statuses, proof of delivery photos and signatures, and driver questionnaire responses. The API also handles customer notifications and booking availability checks. Webhooks notify your systems in real time when orders change status, plans are dispatched or routes are completed. It''s a REST API over HTTPS that uses JSON and authenticates with an access key, which you generate in SmartRoutes under Settings > Integrations. ## Base URL


    Every endpoint path in this reference is relative to this base URL:


    https://api.smartroutes.io/v2


    So `GET /orders` in this reference means `GET https://api.smartroutes.io/v2/orders`. **The documentation host is not the API host.** These docs are published at `smartroutes.io/api`, which serves this page and the OpenAPI spec only. Requests sent there do not reach the API — send them to the base URL above. ## Authentication


    To use the API, you will need to generate an API Access Key for your SmartRoutes account. To generate, login to your SmartRoutes account and navigate to Settings > Integrations > SmartRoutes Open API and click ''Generate API Key''. For more details on SmartRoutes integrations, click here. All requests expect the API Access Key to be provided in the `x-access-key` header:


    ```http

    x-access-key: YOUR_ACCESS_KEY

    ```


    Two optional request headers are also recognised: `x-sr-api-features`, accepted on every endpoint (see API Features), and `idempotency-key`, honoured on the `POST` endpoints listed under Idempotency. Webhook deliveries from SmartRoutes to your receiver are authenticated differently — see Webhooks. ## Rate Limits


    Every endpoint has a per-minute limit, and most also have a short burst limit. Requests are rejected as soon as either limit is hit. Most endpoints fall into one of these tiers:


    | Tier | Rate limit | Description |

    |---|---|---|

    | Standard | 60 / min (max 5 / sec) | Single-resource reads and writes (e.g. `GET /orders/{id}`, `PUT /orders/{id}`) |

    | Listing | 30 / min (max 5 / sec) | Paginated lists (e.g. `/customers`, `/plans`, `/routes`) |

    | Reference | 60 / min (max 1 / sec) | Reference data (e.g. capacities, custom fields, vehicles, zone groups) |

    | Bulk | 30 / min (max 1 per 2 sec) | Bulk creates and heavy deletes |

    | Upload | 15 / min (max 1 / sec) | File uploads (e.g. `POST /orders/{id}/attachments`) |


    The following endpoints have a stricter limit of **5 / min (max 2 per 15 sec)**:


    - Plan optimisation: `POST /plans/optimise/orders`, `POST /plans/optimise/orders-for-ids`

    - Booking availability: `POST /booking/availability`, `POST /booking/available-dates`, `POST /booking/available-slots`

    - Route reversal: `POST /routes/{id}/reverse`


    The two dispatch endpoints have the Standard per-minute allowance with a tighter burst, **60 / min (max 2 per 2 sec)**, because each call blocks for the full dispatch (up to two minutes):


    - `POST /routes/{id}/dispatch`

    - `POST /plans/{id}/dispatch`


    When a limit is hit, the API returns HTTP **403** with a `Retry-After` header and `details.retry_after_seconds` in the body — both give the seconds until the limit resets. **Prefer `429`?** `403` is the status this API has always returned for rate limiting, and it stays the default so existing integrations keep working. Send `x-sr-api-features: rate-limit-429` and a tripped limit answers `429 Too Many Requests` with `name: "RATE_LIMIT_EXCEEDED"` instead. Nothing else about the response changes — `Retry-After` and `details.retry_after_seconds` are already sent on the `403`. See API Features. We may temporarily reduce these limits to protect platform stability.'
  version: 2.0.0
  contact:
    name: SmartRoutes Support
    email: support@smartroutes.io
    url: https://smartroutes.io/support
servers:
- url: https://api.smartroutes.io/v2/
  description: API base URL — every path in this reference is relative to it.
tags:
- name: Webhooks
  description: 'Configure a webhook receiver URL in your depot settings and SmartRoutes will deliver event notifications as they happen. Ten event types are emitted, each documented below with its payload schema and an example delivery:


    | Event | Type ID | Fires when |

    |---|---|---|

    | orders.status | 2 | An order''s status changes (line-item or order-level transition) |

    | routes.dispatched | 3 | A route is dispatched (published to its driver). |

    | plans.created | 4 | A Plan row is persisted (after `POST /plans/optimise/orders` or `/orders-for-ids`). Fires *before* optimisation completes. |

    | plans.dispatched | 5 | A Plan is dispatched (routes published to drivers). |

    | routes.edited | 6 | A dispatched route is edited (re-ordering stops, etc.) |

    | routes.deleted | 7 | One or more dispatched routes are deleted (typically as part of solution replacement) |

    | routes.completed | 8 | A dispatched route is completed by the driver. |

    | plans.deleted | 9 | A Plan row is destroyed |

    | orders.on_delivery | 10 | A stop enters its on-delivery ETA window on a dispatched route (the arriving-soon signal). |

    | orders.will_miss_window | 11 | A delivery stop''s live ETA passes the end of its time window by more than the depot''s grace. Once per order per stop. |


    # Delivery envelope


    Each event is delivered as an `HTTP POST` to the receiver URL configured in your depot settings. The request body is always a JSON object of shape:


    ```text

    { "type": , "data": }

    ```


    The `data` field is the payload object for a single event — NOT an array. Bulk operations (e.g. order-status changes from a route delete) fan out into one POST per event, each with its own `data` object.


    # Delivery headers


    Outgoing requests carry `Content-Type: application/json` and an HTTP Basic `Authorization` header derived from the username/password you supplied when configuring the webhook. No HMAC signature header is sent; treat the basic-auth credentials as the integrity check and rotate them if compromised.


    # Timeout and retries


    Each delivery has a server-side request timeout of **3 seconds**. On failure (HTTP error, timeout, or connection error) the delivery is retried up to **3 times total**; after the third failure the task is marked permanently `ERROR` and not retried again. Your receiver should respond `2xx` quickly — slow receivers will be treated as failures.


    # Machine-readable schemas


    The delivery envelope and per-event payloads are also defined under `#/components/schemas/`: `WebhookDelivery`, `WebhookOrdersStatusPayload`, `WebhookPlanIdPayload`, `WebhookRouteIdPayload`, `WebhookOnDeliveryPayload`, `WebhookWillMissWindowPayload`. Reference these from your own integration''s tests / contract tools to catch shape drift early.'
paths: {}
webhooks:
  orders.status:
    post:
      tags:
      - Webhooks
      operationId: orders.status
      summary: orders.status
      description: 'Fires when an order''s status changes (line-item or order-level transition).


        Type ID: `2`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - type
              - data
              properties:
                type:
                  type: string
                  enum:
                  - orders.status
                  description: Event type — always `orders.status` for this event.
                data:
                  $ref: '#/components/schemas/WebhookOrdersStatusPayload'
            example:
              type: orders.status
              data:
                order_id: 48213
                order_number: SO-10023
                status: DELIVERED
      responses:
        2XX:
          description: Acknowledge the delivery with any `2xx` status within 3 seconds. A non-`2xx` status, a timeout or a connection error counts as a failed attempt — see [Timeout and retries](#tag/Webhooks/Timeout-and-retries).
  routes.dispatched:
    post:
      tags:
      - Webhooks
      operationId: routes.dispatched
      summary: routes.dispatched
      description: 'Fires when a route is dispatched (published to its driver).


        Type ID: `3`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - type
              - data
              properties:
                type:
                  type: string
                  enum:
                  - routes.dispatched
                  description: Event type — always `routes.dispatched` for this event.
                data:
                  $ref: '#/components/schemas/WebhookRouteIdPayload'
            example:
              type: routes.dispatched
              data:
                id: 55120
      responses:
        2XX:
          description: Acknowledge the delivery with any `2xx` status within 3 seconds. A non-`2xx` status, a timeout or a connection error counts as a failed attempt — see [Timeout and retries](#tag/Webhooks/Timeout-and-retries).
  plans.created:
    post:
      tags:
      - Webhooks
      operationId: plans.created
      summary: plans.created
      description: 'Fires when a Plan row is persisted — after `POST /plans/optimise/orders` or `POST /plans/optimise/orders-for-ids`.


        It fires *before* optimisation completes, so a delivery does not mean the optimisation finished — poll `GET /plans/{id}` for the outcome. See Optimise Orders.


        Type ID: `4`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - type
              - data
              properties:
                type:
                  type: string
                  enum:
                  - plans.created
                  description: Event type — always `plans.created` for this event.
                data:
                  $ref: '#/components/schemas/WebhookPlanIdPayload'
            example:
              type: plans.created
              data:
                id: 9071
      responses:
        2XX:
          description: Acknowledge the delivery with any `2xx` status within 3 seconds. A non-`2xx` status, a timeout or a connection error counts as a failed attempt — see [Timeout and retries](#tag/Webhooks/Timeout-and-retries).
  plans.dispatched:
    post:
      tags:
      - Webhooks
      operationId: plans.dispatched
      summary: plans.dispatched
      description: 'Fires when a Plan is dispatched (routes published to drivers).


        Type ID: `5`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - type
              - data
              properties:
                type:
                  type: string
                  enum:
                  - plans.dispatched
                  description: Event type — always `plans.dispatched` for this event.
                data:
                  $ref: '#/components/schemas/WebhookPlanIdPayload'
            example:
              type: plans.dispatched
              data:
                id: 9071
      responses:
        2XX:
          description: Acknowledge the delivery with any `2xx` status within 3 seconds. A non-`2xx` status, a timeout or a connection error counts as a failed attempt — see [Timeout and retries](#tag/Webhooks/Timeout-and-retries).
  routes.edited:
    post:
      tags:
      - Webhooks
      operationId: routes.edited
      summary: routes.edited
      description: 'Fires when a dispatched route is edited (re-ordering stops, etc.).


        Type ID: `6`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - type
              - data
              properties:
                type:
                  type: string
                  enum:
                  - routes.edited
                  description: Event type — always `routes.edited` for this event.
                data:
                  $ref: '#/components/schemas/WebhookRouteIdPayload'
            example:
              type: routes.edited
              data:
                id: 55120
      responses:
        2XX:
          description: Acknowledge the delivery with any `2xx` status within 3 seconds. A non-`2xx` status, a timeout or a connection error counts as a failed attempt — see [Timeout and retries](#tag/Webhooks/Timeout-and-retries).
  routes.deleted:
    post:
      tags:
      - Webhooks
      operationId: routes.deleted
      summary: routes.deleted
      description: 'Fires when one or more dispatched routes are deleted (typically as part of solution replacement), once per deleted route.


        Type ID: `7`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - type
              - data
              properties:
                type:
                  type: string
                  enum:
                  - routes.deleted
                  description: Event type — always `routes.deleted` for this event.
                data:
                  $ref: '#/components/schemas/WebhookRouteIdPayload'
            example:
              type: routes.deleted
              data:
                id: 55120
      responses:
        2XX:
          description: Acknowledge the delivery with any `2xx` status within 3 seconds. A non-`2xx` status, a timeout or a connection error counts as a failed attempt — see [Timeout and retries](#tag/Webhooks/Timeout-and-retries).
  routes.completed:
    post:
      tags:
      - Webhooks
      operationId: routes.completed
      summary: routes.completed
      description: 'Fires when a dispatched route is completed by the driver.


        Type ID: `8`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - type
              - data
              properties:
                type:
                  type: string
                  enum:
                  - routes.completed
                  description: Event type — always `routes.completed` for this event.
                data:
                  $ref: '#/components/schemas/WebhookRouteIdPayload'
            example:
              type: routes.completed
              data:
                id: 55120
      responses:
        2XX:
          description: Acknowledge the delivery with any `2xx` status within 3 seconds. A non-`2xx` status, a timeout or a connection error counts as a failed attempt — see [Timeout and retries](#tag/Webhooks/Timeout-and-retries).
  plans.deleted:
    post:
      tags:
      - Webhooks
      operationId: plans.deleted
      summary: plans.deleted
      description: 'Fires when a Plan row is destroyed.


        Type ID: `9`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - type
              - data
              properties:
                type:
                  type: string
                  enum:
                  - plans.deleted
                  description: Event type — always `plans.deleted` for this event.
                data:
                  $ref: '#/components/schemas/WebhookPlanIdPayload'
            example:
              type: plans.deleted
              data:
                id: 9071
      responses:
        2XX:
          description: Acknowledge the delivery with any `2xx` status within 3 seconds. A non-`2xx` status, a timeout or a connection error counts as a failed attempt — see [Timeout and retries](#tag/Webhooks/Timeout-and-retries).
  orders.on_delivery:
    post:
      tags:
      - Webhooks
      operationId: orders.on_delivery
      summary: orders.on_delivery
      description: 'Fires when a stop enters its on-delivery ETA window on a dispatched route (the arriving-soon signal). Rides on the depot''s on-delivery customer notifications — fires once per stop, and only for stops that carry contact details.


        Type ID: `10`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - type
              - data
              properties:
                type:
                  type: string
                  enum:
                  - orders.on_delivery
                  description: Event type — always `orders.on_delivery` for this event.
                data:
                  $ref: '#/components/schemas/WebhookOnDeliveryPayload'
            example:
              type: orders.on_delivery
              data:
                order_id: 48213
                order_number: SO-10023
                route_id: 55120
                eta: '14:35'
                time_to_arrival: 15
      responses:
        2XX:
          description: Acknowledge the delivery with any `2xx` status within 3 seconds. A non-`2xx` status, a timeout or a connection error counts as a failed attempt — see [Timeout and retries](#tag/Webhooks/Timeout-and-retries).
  orders.will_miss_window:
    post:
      tags:
      - Webhooks
      operationId: orders.will_miss_window
      summary: orders.will_miss_window
      description: 'Fires when a delivery stop''s live ETA on a dispatched route passes the end of its time window by more than the depot''s grace. Only the driver''s next few stops are checked. Fires once per order on the stop and is never repeated.


        A response slower than 3 seconds is retried, so the same event can arrive more than once. Ignore a repeat of the same `order_id`.


        Type ID: `11`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - type
              - data
              properties:
                type:
                  type: string
                  enum:
                  - orders.will_miss_window
                  description: Event type — always `orders.will_miss_window` for this event.
                data:
                  $ref: '#/components/schemas/WebhookWillMissWindowPayload'
            example:
              type: orders.will_miss_window
              data:
                order_id: 48213
                order_number: SO-10023
                route_id: 55120
                eta: '14:42'
                mins_late: 42
      responses:
        2XX:
          description: Acknowledge the delivery with any `2xx` status within 3 seconds. A non-`2xx` status, a timeout or a connection error counts as a failed attempt — see [Timeout and retries](#tag/Webhooks/Timeout-and-retries).
components:
  schemas:
    OrderStatus:
      type: string
      description: 'Order status. SmartRoutes derives these values from line-item statuses (source: `cORDER_STATUS_TYPES` in `src/models/order-status.js`): `BOOKED`, `BOOKING_DECLINED`, `DELIVERED`, `LOADED`, `OPEN`, `PARTIALLY_BOOKED`, `PARTIALLY_BOOKING_DECLINED`, `PARTIALLY_DELIVERED`, `PARTIALLY_LOADED`, `PARTIALLY_READY_FOR_COLLECTION`, `PARTIALLY_ROUTED`, `PARTIALLY_UNDELIVERED`, `PARTIALLY_WAITING_CONFIRMATION`, `READY_FOR_COLLECTION`, `ROUTED`, `UNDELIVERED`, `WAITING_CONFIRMATION`.


        This is **not** a closed set. Your organisation can define its own statuses, and any of them can appear here. Call `GET /order-statuses` for the full list your organisation can use, and treat this field as a free string rather than an enum.'
      example: ROUTED
    WebhookOnDeliveryPayload:
      type: object
      required:
      - order_id
      - order_number
      - route_id
      - eta
      - time_to_arrival
      description: orders.on_delivery payload. Emitted when an order's stop enters the on-delivery (ETA-threshold) window on a dispatched route — the arriving-soon signal. Rides on the depot's on-delivery customer notifications, so it fires once per stop and only for stops that carry contact details (phone/email + a notification template).
      properties:
        order_id:
          type: integer
          description: Internal order id.
        order_number:
          type: string
          description: User-facing order number.
        route_id:
          type: integer
          description: Id of the dispatched route the stop is on. Fetch with GET /routes/{id}.
        eta:
          type: string
          description: Estimated arrival time at the stop, local depot time, formatted "HH:MM".
        time_to_arrival:
          type: integer
          description: Whole minutes until the estimated arrival.
    WebhookOrdersStatusPayload:
      type: object
      required:
      - order_id
      - order_number
      - status
      description: Payload of the `orders.status` event, sent whenever an order's status changes.
      properties:
        order_id:
          type: integer
          description: Internal order id.
        order_number:
          type: string
          description: User-facing order number.
        status:
          $ref: '#/components/schemas/OrderStatus'
    WebhookPlanIdPayload:
      type: object
      required:
      - id
      description: Payload for plans.created / plans.dispatched / plans.deleted. Carries only the plan id.
      properties:
        id:
          type: integer
          description: Plan id. Fetch with GET /plans/{id}.
    WebhookWillMissWindowPayload:
      type: object
      required:
      - order_id
      - order_number
      - route_id
      - eta
      - mins_late
      description: orders.will_miss_window payload. Emitted once per order when a delivery stop's live ETA passes the end of its time window by more than the depot's grace.
      properties:
        order_id:
          type: integer
          description: Internal order id.
        order_number:
          type: string
          description: User-facing order number.
        route_id:
          type: integer
          description: Id of the dispatched route the stop is on. Fetch with GET /routes/{id}.
        eta:
          type: string
          description: Live estimated arrival time at the stop, local depot time, formatted "HH:mm".
        mins_late:
          type: integer
          description: Whole minutes `eta` is past the end of the stop's time window. Always more than the depot's grace.
    WebhookRouteIdPayload:
      type: object
      required:
      - id
      description: Payload for routes.dispatched / routes.edited / routes.deleted / routes.completed. Carries only the route id.
      properties:
        id:
          type: integer
          description: Route id. Fetch with GET /routes/{id}.