DeltaVelocity

Webhooks

Receive signed shipment updates without polling for every change. Keep the change feed as a reconciliation path: deliveries can repeat, arrive out of order, or be missed while your endpoint is disabled.

Connect a receiver

  1. Deploy a public HTTPS receiver. Verify the raw-body signature, durably record the event and acknowledge promptly.
  2. Create it with POST /v1/webhooks (scope webhooks:manage); choose subscriptions and store the one-time secret.
  3. Send POST /v1/webhooks/{webhook_id}/test and inspect its delivery result. webhook.test is not a shipment update.
  4. Monitor GET /v1/webhooks/{webhook_id}/deliveries; the delivery log is kept for 30 days.

A brand can have five endpoints. URLs must use HTTPS on default port 443, contain no URL credentials, and resolve to a public IP at registration and every delivery. Redirects are not followed. Test sends are limited to 1 per 10 seconds per endpoint and 10 per 60 seconds per brand; excess calls return 429 with Retry-After. Testing a paused or disabled endpoint returns 409.

Events and payload

EventSent when
shipment.createdThe shipment gets its AWB.
shipment.status_changedThe public status changes, whatever the new status is.
shipment.picked_upThe status becomes picked_up.
shipment.ndrThe status becomes ndr.
shipment.deliveredThe status becomes delivered.
shipment.rto_initiatedThe status becomes rto_initiated.
shipment.rto_deliveredThe status becomes rto_delivered.
shipment.cancelledThe status becomes cancelled.
communication.message.receivedA customer message arrived and was classified.
communication.message.statusAn outbound message reached a new delivery state.
communication.request.createdThe bot raised a customer request.
communication.request.updatedA request moved, for example the customer confirmed it.
communication.request.decidedA request finished: approved and answered by the courier, rejected, or resolved.

A status change sends shipment.status_changed and, when one matches, the specific event too. Each is its own delivery with its own event id.

{
  "id": "evt_8f14e45fceea167a5a36dedd4bea2543",
  "type": "shipment.delivered",
  "created_at": "2026-10-17T09:00:00Z",
  "data": {
    "shipment_id": "00000000-0000-4000-8000-000000004242",
    "order_id": 4242,
    "channel_order_ref": "#SYN-1001",
    "awb": "SYN00004242",
    "status": "delivered",
    "previous_status": "out_for_delivery",
    "direction": "forward",
    "courier": "Synthetic Express",
    "occurred_at": "2026-10-17T08:58:40Z",
    "sequence": 81234567890
  }
}

Join on shipment_id and order_id; channel_order_ref is your display reference. direction is forward, rto or dto. Use increasing sequence to order events for one shipment. A test event instead has type: webhook.test and data: {webhook_id}.

HeaderMeaning
Content-Typeapplication/json
User-AgentDeltaVelocity-Webhooks/1
DV-Event-IdPayload id, unchanged across retries and replays.
DV-Signaturet=<unix seconds>,v1=<hex HMAC-SHA256>; rotation can add a second v1.

Communication events

These events are about your customers' conversations, not a shipment, so their data has no shipment_id. Each is sent after the change committed, from the current state, so status is where the request is when the event is sent. Use increasing sequence to order events across a brand. Payloads carry ids, the intent, a state and, for a customer's free-text message, its words (at most 500 characters). They never carry template variables, the text of a template message, a phone number or an email address.

Eventdata fields
communication.message.receivedmessage_id, order_id, channel, intent (null when the classifier had no answer), text, occurred_at, sequence
communication.message.statusmessage_id, order_id, channel, state (sent, delivered, read or failed), state_at, occurred_at, sequence
communication.request.created, communication.request.updatedrequest_id, order_id, intent, urgent, status, occurred_at, sequence
communication.request.decidedthe request fields above, decided_by (brand_user when a person approved, rejected or resolved it, else bot) and courier_result (outcome acknowledged or failed, and the courier's reason; null when no courier was called)

Read the full message or request with GET /v1/communications/requests/{request_id} (scope communications:read).

Verify before parsing

Compute HMAC-SHA256(secret, timestamp + "." + raw_body) byte for byte. Reject timestamps more than five minutes from your clock and compare each v1 using constant-time comparison. Accept if any signature matches.

import hashlib
import hmac
import time


def verify(secret: str, raw_body: bytes, header: str, tolerance: int = 300) -> bool:
    parts = [part.split("=", 1) for part in header.split(",") if "=" in part]
    t = next((value for key, value in parts if key == "t"), None)
    signatures = [value for key, value in parts if key == "v1"]
    if t is None or not t.isdigit() or abs(time.time() - int(t)) > tolerance:
        return False
    expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return any(hmac.compare_digest(expected, signature) for signature in signatures)
import { createHmac, timingSafeEqual } from "node:crypto";

export function verify(secret, rawBody, header, toleranceSeconds = 300) {
  const parts = header
    .split(",")
    .filter((part) => part.includes("="))
    .map((part) => part.split("="));
  const t = parts.find(([key]) => key === "t")?.[1];
  const signatures = parts
    .filter(([key]) => key === "v1")
    .map(([, value]) => value);
  if (
    !/^\d+$/.test(t ?? "") ||
    Math.abs(Date.now() / 1000 - Number(t)) > toleranceSeconds
  )
    return false;
  const expected = createHmac("sha256", secret)
    .update(`${t}.`)
    .update(rawBody)
    .digest();
  return signatures.some((signature) => {
    const given = Buffer.from(signature, "hex");
    return given.length === expected.length && timingSafeEqual(given, expected);
  });
}

rawBody must be the exact received bytes, for example express.raw({ type: "application/json" }), not re-serialized JSON. Test vector: secret whsec_test, body {"id":"evt_1"}, t=1700000000 produces v1=c89214b5b5da833daed6f0b8c5bb6bd58cea9022bd80ccc78230f3942d632925.

Rotate without dropping deliveries

POST /v1/webhooks/{webhook_id}/rotate-secret returns a new secret once. Both old and new secrets sign for 24 hours; accept either v1. secret_rotated_at records the new secret's start and previous_secret_expires_at records the old secret's expiry, or null when absent. Rotating again during that window replaces the most recent secret immediately; the original one remains valid until its existing expiry. Deploy the newest secret promptly.

Delivery, replay and recovery

  • Any 2xx within five seconds (three seconds to connect) succeeds. Acknowledge first; process business work afterwards.
  • Failures retry after one minute, ten minutes, one hour and six hours, then become dead. 429 or 503 with Retry-After is honoured. After three days of continuing failure, the endpoint is disabled and the brand is emailed.
  • Dedupe on DV-Event-Id. Ignore an older data.sequence than the one already applied for that shipment.
  • POST /v1/webhook-deliveries/{delivery_id}/replay re-sends a logged event with the same event ID to an active endpoint.
  • PATCH /v1/webhooks/{webhook_id} with status: paused pauses it; status: active resumes or re-enables it. While paused or disabled, events are dropped, not queued and cannot be replayed because they were never logged.
  • After resuming, reconcile GET /v1/shipments?updated_since= across the gap using overlapping windows. Replaying logged failures alone cannot recover events that were dropped.