Skip to content

Reference

Webhooks ​

Webhooks push reservation status changes to your backend as they happen: confirmations, changes, check-ins, check-outs, cancellations, no-shows, and expiries. They also tell you about changes you didn't make yourself: PMC staff checking a vehicle in or out, the hold of an open-ended reservation being extended, an overstay, or a no-show.

What you'll do

  • Register an HTTPS endpoint and store its signing secret
  • Verify every delivery's Stage-Signature
  • Acknowledge fast, then process idempotently

Before you begin

  • A key with webhooks:write
  • A public HTTPS URL on your backend

Register an endpoint ​

POST/fleet/v1/webhook-endpointsCreate a webhook endpoint
sh
curl https://fleet.parkingmgt.com/fleet/v1/webhook-endpoints \
  -H "Authorization: Bearer $STAGE_API_KEY" \
  -H "Idempotency-Key: 8a9b0c1d-2e3f-4a5b-9c6d-7e8f9a0b1c2d" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://fleet.example.com/webhooks/stage",
    "events": ["reservation.checked_in", "reservation.completed", "reservation.no_show"],
    "description": "Dispatch"
  }'
js
const res = await fetch(`${API}/webhook-endpoints`, {
  method: 'POST',
  headers: {
    ...headers,
    'Idempotency-Key': crypto.randomUUID(),
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    url: 'https://fleet.example.com/webhooks/stage',
    events: ['reservation.checked_in', 'reservation.completed', 'reservation.no_show'],
    description: 'Dispatch'
  })
})
const { secret } = await res.json()

The response includes the endpoint's signing secret (whsec_…). It is returned only once, so store it now.

json
{
  "object": "webhook_endpoint",
  "id": "1cbaa7cf-1c20-4a52-9b63-5116e9044a9d",
  "url": "https://fleet.example.com/webhooks/stage",
  "description": "Dispatch",
  "events": ["reservation.checked_in", "reservation.completed", "reservation.no_show"],
  "enabled": true,
  "disabled_reason": null,
  "disabled_at": null,
  "secret": "whsec_3f9aK2mQ8xL1pR7tV4nB6cD0eF5gH2jZ",
  "previous_secret_expires_at": null,
  "updated_at": "2026-11-01T15:04:05Z",
  "created_at": "2026-11-01T15:04:05Z",
  "livemode": false
}
  • URL rules. The URL must use https:// and resolve to a public address: private, loopback, and link-local addresses are refused when you save the endpoint and again on every delivery. The one exception is local development: when you run the Stage API locally, sandbox endpoints may use http://localhost (or 127.0.0.1, [::1]). Each workspace can have up to 16 endpoints.
  • Workspaces. Endpoints belong to the workspace of the key that created them and receive only that workspace's events: an endpoint registered with a key of the sandbox workspace never receives production events. Register your production endpoints again in the production workspace.
  • Manage. List them with GET /fleet/v1/webhook-endpoints, and manage one with GET, PATCH (change url, events, description, or set enabled to false to pause), and DELETE on /fleet/v1/webhook-endpoints/{id}. A disabled endpoint has enabled: false and a disabled_reason: user when your team paused it, auto_disabled when Stage stopped it after repeated failures (see Retries).

Sending test events, rotating the signing secret, the delivery log, and retrying failed deliveries are done in the Fleet Console under Developers → Webhooks of the workspace; the API manages endpoints only.

Verify signatures ​

Every delivery has a Stage-Signature header:

text
Stage-Signature: t=1793545445,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd
  • t is the Unix time of the delivery attempt, in seconds.
  • v1 is the hex HMAC-SHA256 of <t>.<raw request body>, keyed with your endpoint secret. A header may carry more than one v1 value (one per secret while you rotate). Accept the delivery if any of them matches.

To verify a delivery:

  1. Read the raw body bytes. Parsing and re-serializing JSON changes them and breaks the signature.
  2. Compute the HMAC of `${t}.${rawBody}` with your secret and compare it to each v1 in constant time.
  3. Reject the delivery if t is more than 300 seconds from your clock. This blocks replayed requests.
js
import { createHmac, timingSafeEqual } from 'node:crypto'

const TOLERANCE_SECONDS = 300

export function verifyStageSignature (header, rawBody, secret, now = Date.now()) {
  if (!header) return false
  let timestamp = null
  const signatures = []
  for (const part of header.split(',')) {
    const [key, value] = part.split('=', 2).map(s => s.trim())
    if (key === 't' && /^\d+$/.test(value)) timestamp = Number(value)
    else if (key === 'v1' && /^[0-9a-f]{64}$/.test(value)) signatures.push(value)
  }
  if (timestamp === null || signatures.length === 0) return false
  if (Math.abs(Math.floor(now / 1000) - timestamp) > TOLERANCE_SECONDS) return false

  const expected = Buffer.from(
    createHmac('sha256', secret).update(`${timestamp}.${rawBody}`, 'utf8').digest('hex')
  )
  return signatures.some(sig => {
    const candidate = Buffer.from(sig)
    return candidate.length === expected.length && timingSafeEqual(candidate, expected)
  })
}
python
import hashlib
import hmac
import re
import time

TOLERANCE_SECONDS = 300


def verify_stage_signature(header, raw_body: bytes, secret: str, now: float | None = None) -> bool:
    if not header:
        return False
    timestamp = None
    signatures = []
    for part in header.split(','):
        key, _, value = part.strip().partition('=')
        if key == 't' and re.fullmatch(r'[0-9]+', value):
            timestamp = int(value)
        elif key == 'v1' and re.fullmatch(r'[0-9a-f]{64}', value):
            signatures.append(value)
    if timestamp is None or not signatures:
        return False
    if abs(int(time.time() if now is None else now) - timestamp) > TOLERANCE_SECONDS:
        return False

    expected = hmac.new(secret.encode(), f'{timestamp}.'.encode() + raw_body, hashlib.sha256).hexdigest()
    return any(hmac.compare_digest(expected, signature) for signature in signatures)

With Express, keep the raw body for the webhook route:

js
import express from 'express'
import { verifyStageSignature } from './verify-stage-signature.js'

const app = express()

app.post('/webhooks/stage', express.raw({ type: 'application/json' }), async (req, res) => {
  const rawBody = req.body.toString('utf8')
  if (!verifyStageSignature(req.get('Stage-Signature'), rawBody, process.env.STAGE_WEBHOOK_SECRET)) {
    return res.status(400).send('invalid signature')
  }
  const event = JSON.parse(rawBody)
  res.sendStatus(200)
  await enqueue(event)
})

Respond quickly, process later ​

Acknowledge first

Return any 2xx status within 10 seconds. Anything else, including a timeout or redirect, counts as a failure. Do the work in a queue or background job after you respond.

Delivery is at least once, and order is not guaranteed.

  • Deduplicate on the event id (also sent as the Stage-Event-Id header). Store processed IDs and skip repeats; retries of a delivery carry the same id.
  • Don't rely on order. A reservation.completed can be delivered before reservation.checked_in after a retry. Compare data.object.updated_at with what you have, or fetch the reservation for its current state.
  • Ignore unknown event types so new types never break your handler.

Test your endpoint ​

Send a sample event of any type from the Fleet Console: open the endpoint under Developers → Webhooks and use Send test. The Fleet Console shows the delivery attempt right away, with your endpoint's status code and response body. Test sends use a synthetic event built from a sample object and are never retried.

In the sandbox workspace, create a reservation, check it in, and check it out with a key of the sandbox workspace to receive real reservation.confirmed, reservation.checked_in, and reservation.completed events.

Event types ​

EventSent whendata.object
reservation.confirmedA reservation is created and confirmed.Reservation
reservation.updatedA reservation's times or metadata change, Stage extends the hold of an open-ended reservation (hold_until), or a checked_in vehicle stays past end_at (or hold_until).Reservation
reservation.checked_inThe vehicle checks in through your /check-in call (or PMC staff check it in).Reservation
reservation.completedThe vehicle checks out through your /check-out call (or PMC staff check it out).Reservation
reservation.cancelledA reservation is cancelled.Reservation
reservation.no_showThe vehicle never checked in.Reservation
reservation.expiredThe requested time ended while the reservation was still confirmed.Reservation

The event envelope ​

Each delivery is a POST with a JSON event. data.object is the full resource as of the event.

FieldDescription
idUnique event ID (a UUID). Use it to deduplicate.
typeOne of the event types above.
api_versionVersion of the payload format. See Versioning and changes.
data.objectThe reservation, as of the event.
created_at, livemodeWhen the event happened, and whether it comes from the production workspace (true) or the sandbox workspace (false).
Example event: reservation.checked_in
json
{
  "object": "event",
  "id": "f3acf5d5-1103-476e-afcb-918c7ccf3e2f",
  "type": "reservation.checked_in",
  "api_version": "2026-11-01",
  "data": {
    "object": {
      "object": "reservation",
      "id": "a684a7dd-44da-4c71-8264-9d15eb9465e0",
      "status": "checked_in",
      "location": "eec93d2d-5729-441b-99b2-f764872ca895",
      "vehicle": "74113c84-0845-4e19-8550-a9e86b4d589b",
      "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
      "start_at": "2026-11-02T14:00:00Z",
      "end_at": "2026-11-02T17:00:00Z",
      "hold_until": "2026-11-02T17:00:00Z",
      "access": {
        "method": "open",
        "plate": null,
        "instructions": "Enter on Monroe St. Use lanes 3–4 marked \"Fleet\"."
      },
      "checked_in_at": "2026-11-02T14:03:00Z",
      "check_in_source": "api",
      "checked_out_at": null,
      "check_out_source": null,
      "cancelled_at": null,
      "cancellation_reason": null,
      "external_reference": "trip-88213",
      "metadata": {},
      "updated_at": "2026-11-02T14:03:00Z",
      "created_at": "2026-11-01T15:04:05Z",
      "livemode": false
    }
  },
  "created_at": "2026-11-02T14:03:01Z",
  "livemode": false
}

Delivery headers ​

HeaderValue
Stage-Signaturet=<unix seconds>,v1=<hex>, see Verify signatures.
Stage-Event-IdThe event id, the same on every retry.
Stage-Event-TypeThe event type.
User-AgentStage-Webhooks/1.0
Content-Typeapplication/json; charset=utf-8

Retries ​

Failed deliveries are retried with exponential backoff. Each delay carries ±20% jitter:

AttemptDelay after the previous attempt
1Immediate
21 minute
33 minutes
49 minutes
527 minutes
681 minutes
7about 4 hours
8about 12 hours

After 8 failed attempts, about 18 hours after the first, the delivery is marked failed. You can see every attempt in the Fleet Console: the response status, the first 1 KB of the response body, and the delivery's last_error (timeout, connection_error, http_503…) and attempt_history. Once your receiver is fixed, Retry a failed delivery from the Fleet Console to send it again right away (a manual retry is attempted once and not rescheduled). After a longer outage, reconcile from GET /fleet/v1/reservations (for example with starts_after set to the start of the outage window) to catch up on current state.

Endpoints that keep failing are disabled

Every retry sends the same body bytes with a fresh Stage-Signature timestamp. If an endpoint keeps failing (50 deliveries in a row, or no success for 3 days after a delivery finally failed), Stage disables it and sets disabled_reason to auto_disabled. Fix the receiver, then set enabled back to true with PATCH.

Rotate the signing secret ​

Rotate the secret if it may have leaked, or on a schedule, with Rotate secret on the endpoint page in the Fleet Console. The new secret is shown only once.

You can keep the previous secret valid for up to 24 hours: until then every delivery is signed with both secrets, so Stage-Signature carries two v1 values (t=…,v1=<new>,v1=<old>). A receiver that verifies with either secret keeps working: deploy the new secret, then remove the old one. Choose to revoke the old secret immediately after a leak. Rotating again replaces the previous secret. The endpoint's previous_secret_expires_at shows when the old secret stops signing.

Next ​

Conventions

IDs, pagination, idempotency, and errors.

API reference

Every webhook endpoint operation.