Step 1 — Build a receiver endpoint
Your endpoint needs to:- Accept POST requests with a JSON body
- Read the
X-Autosnap-Signatureheader - Verify the signature using the
secretyou provided when creating the webhook - Respond with
2xxwithin 10 seconds - Process events idempotently (the same event may arrive more than once)
Example: FastAPI
For vehicle events (
vehicle.created, vehicle.updated, vehicle.removed), the data field contains the vehicle object directly. For import.complete, data contains website_url and stats. The dealership_id is always at the top level of the payload, not inside data.Example: Node/Express
Step 2 — Create the webhook
Once your endpoint is live and reachable:Step 3 — Test the webhook
Send a test delivery from the dashboard or programmatically by triggering an inventory refresh on one of the dealerships. Inspect the delivery results:Idempotency is critical
Webhooks are delivered at-least-once, not exactly-once. Your handler must produce the same end state regardless of how many times it sees the same event. A simple pattern:- Use a combination of event type + VIN + timestamp as a deduplication key
- At the start of handling, check if you’ve already processed this event
- If yes, return early. If no, process it.
Always respond fast
The receiver endpoint must return2xx within 10 seconds. If you do heavy work synchronously (writing to your database, calling other APIs, sending emails), you’ll time out and we’ll retry — flooding your endpoint with duplicates.
The pattern:
- Verify the signature (~1ms)
- Reject if invalid (~1ms)
- Parse the JSON (~1ms)
- Push to a background queue (~10ms)
- Return 2xx
Retry behavior
Failed deliveries are retried with exponential backoff. Each webhook delivery gets up to 3 total attempts:
Only server errors (5xx) trigger retries. Client errors (4xx) are not retried — fix your endpoint and the next event will succeed.
After reaching the configured failure threshold (default: 10 consecutive failures) across all deliveries (not just retries for one event), the webhook subscription is automatically deactivated. Use
PATCH /v1/webhooks/{id}/reactivate to re-enable it after fixing the issue — this resets the failure count without losing your subscription configuration.
Security best practices
1
Always verify signatures
Never act on webhook payloads without first verifying the HMAC signature. Anyone can POST to a public URL.
2
Use HTTPS
Webhook URLs must be
https://. Plain HTTP is rejected at webhook creation time.3
Use a unique URL path
Use a unique, hard-to-guess path for your webhook endpoint (e.g.
/webhooks/autosnap-a3f2c8b4) so it’s not easily discoverable.4
Change secrets after a leak
If your webhook
secret is exposed, delete the webhook and create a new one with a new secret.Common pitfalls
Related
Webhooks concept
Event types, payload format, signature verification
Webhook API endpoints
Full endpoint reference