How it works
- Subscribe — create a webhook with an HTTPS endpoint URL and at least one subscribed event, either in the dashboard (Settings → Connections → Webhooks) or via the Create webhook endpoint.
- Verify ownership — when the webhook is enabled, Alvys sends a
webhook.verificationchallenge to your endpoint. Your endpoint echoes the challenge back to prove ownership. See Webhook Lifecycle & Configuration. - Receive events — Alvys delivers each subscribed event as a signed HTTPS POST request to your endpoint.
- Validate and acknowledge — your endpoint verifies the HMAC-SHA256 signature, deduplicates on the event ID, and returns a
2xxresponse promptly. - Retries — failed deliveries are retried automatically. After 10 consecutive failed events, the webhook is disabled automatically.
- Use HTTPS (TLS 1.2+)
- Are signed using HMAC-SHA256
- Follow an at-least-once delivery model
- Are retried automatically on transient failure
- Are disabled automatically after repeated delivery failures
Event types
The authoritative list of valid event-type strings for your account is returned by Get event types (
GET /api/p/v1/webhooks/event-types).
load.changed and trip.changed events carry the full current snapshot of the record plus an optional data.diff node describing what changed — and, if you opt in, what the values were before. See Change Diffs (data.diff).
Anatomy of a delivery
When a subscribed event occurs, Alvys sends an HTTPS POST request to your configured endpoint. Headers:X-Alvys-Event— the event type.X-Alvys-Event-Id— unique identifier for the event. Remains the same across retry attempts; use it for idempotency.X-Alvys-Timestamp— Unix timestamp (seconds) used for signature generation.X-Alvys-Signature— HMAC-SHA256 signature (see Verifying signatures).X-Alvys-Attempt— the delivery attempt number (starts at 1, increments on each retry).
data object contains event-specific fields. For load and trip events it carries the full current snapshot of the record — the same shape the corresponding GET endpoint returns — so you can apply the current state directly without a follow-up request. See Event Delivery & Reliability for the full request format.
Verifying signatures
Every event delivery is signed so you can confirm it came from Alvys and was not tampered with. Verification requests (webhook.verification) are not signed.
The X-Alvys-Signature header has the format t={timestamp},v1={signature}, where the signature is an HMAC-SHA256 hash of:
- Extract the timestamp and signature value(s) from the
X-Alvys-Signatureheader. - Construct the signed payload from the timestamp, event ID, and the exact raw request body — do not reformat or reserialize the JSON.
- Compute an HMAC-SHA256 hash using your webhook’s signing secret.
- Compare against the provided signature(s) using constant-time comparison.
- Return
401 Unauthorizedand do not process the event if no match is found.
v1 for the new secret, v0 for the previous one) — accept either during the transition window. Rejecting requests whose timestamp is more than 5 minutes old reduces replay risk.
Full details, including transport requirements and secret management: Security & Signature Verification.
Delivery guarantees
A delivery succeeds when your endpoint returns HTTP
200–299. Other 4xx responses (except 408 and 429) are permanent failures and are not retried. A successful delivery resets the consecutive-failure counter; once 10 distinct events fail consecutively, the webhook is disabled and must be manually re-enabled.
See Event Delivery & Reliability for the complete retry, timeout, and ordering semantics.
Managing webhooks
Webhooks can be managed from the dashboard (Settings → Connections → Webhooks) or entirely via the API:
Configuration details — states, endpoint verification, updating subscriptions, and the Include previous values option — are covered in Webhook Lifecycle & Configuration.
Monitoring and troubleshooting
Every delivery attempt is logged and queryable:
Use Test webhook delivery to send a signed test payload to your endpoint and verify your signature logic end to end.
Best practices
- Verify every signature before executing any business logic; return
401on failure. - Deduplicate on
X-Alvys-Event-Id— delivery is at-least-once, so duplicates are expected. - Acknowledge fast — return
2xxafter validation and process asynchronously to stay inside the 30-second window. - Don’t rely on ordering — tolerate retries, duplicates, and timing variations.
- Use
data.diffto filter noise — ignore deliveries wherechangesis empty (parent cascades), and tolerate change kinds you don’t recognize. - Support dual signatures (
v1andv0) so secret rotation never interrupts your integration. - Watch health metrics and delivery logs so you catch failures before the auto-disable threshold.
Next steps
Webhook Lifecycle & Configuration
Create, verify, update, and manage webhook subscriptions per Subsidiary.
Security & Signature Verification
Validate HMAC-SHA256 signatures and handle secret rotation.
Event Delivery & Reliability
At-least-once delivery, retries, timeouts, and auto-disable semantics.
Change Diffs (data.diff)
React to exactly what changed with
changes and previousAttributes.