What are Webhooks?
Webhooks deliver Amps platform events to your endpoint over HTTP POST as they happen, replacing the need to poll the API. Push events (push.completed, push.failed) fire when an action reaches a terminal state. Device connection events (device.connected, device.reconnected, device.disconnected) fire when a device’s link to your account changes.
Benefits
Real-time Updates
Get instant notifications when events occur
Reduced API Calls
No need to poll for status updates
Efficient Processing
Process events asynchronously in your application
Better UX
Provide faster updates to your users
Setting Up Webhooks
Configure Endpoint
Add your webhook URL in the Amps AI Dashboard under Webhooks settings
Subscribe to Events
Select which webhook events you want to receive:
- Action completion events (
push.completed) - Action failure events (
push.failed)
Webhook event types
Action events
Webhooks are only sent for actions that reach a terminal state. When you send a push command:- The action is created in
acknowledgedstate (immediate) orscheduledstate (whenstartis provided). No webhook is sent. - You can poll the API to check status while it’s processing. Scheduled actions can be cancelled.
- When the action completes or fails, a webhook is sent.
push.completed: An action completed successfully (terminal state)push.failed: An action failed to complete (terminal state)
Webhook Types Reference
See detailed webhook payloads and examples
Device events
Device connection webhooks fire when a device’s link to your account changes:device.connected: a new device finishes registration through the Auth Journeydevice.reconnected: an already-registered device’s credentials are refresheddevice.disconnected: stored credentials become invalid
device.disconnected body carries a reconnectionUrl pointing at the Auth Journey in reconnection mode when the OEM’s auth flow supports re-entry.
Webhook Delivery
Delivery Guarantees
- At-least-once delivery: Webhooks may be delivered multiple times
- Idempotency: Use the
svix-idheader to handle duplicate deliveries - Retries: Failed deliveries are automatically retried with exponential backoff
- Timeout: Your endpoint should respond within 30 seconds
Delivery Timing
- Action events: Delivered after action reaches a terminal state (
completedorfailed). Typically 10 seconds for live environment, 3 minutes for sandbox environment after the action completes.
Webhook payload structure
Webhook bodies are flat, delivered as the HTTP POST body verbatim. There is noevent or data envelope: the fields sit at the top level, so you read body.command, never body.data.command. The event type and the per-delivery ID ride in the svix-id, svix-timestamp, and svix-signature headers, not the body.
A push event carries the action state:
timestamp:
push.failed shape and the device.disconnected reconnectionUrl.
Security
Webhooks include a signature header for verification:Webhook Security Guide
Learn how to verify webhook signatures
Testing Webhooks
Sandbox Testing
Use the sandbox environment to test webhook delivery:- Webhooks are delivered with a 3-minute delay after action completion (configurable)
- Test error scenarios safely
- Mock device actions can be tested
Webhook Testing Tools
- Use tools like webhook.site for temporary endpoints
- Test locally with ngrok or similar tunneling services
- Use the dashboard to view webhook delivery logs
Error Handling
Your webhook endpoint should:- Return 200 OK for successful processing
- Return 4xx/5xx to trigger retries
- Process idempotently using the
svix-idheader - Log all events for debugging
Next Steps
Webhook Types
See all webhook event types and payloads
Security
Learn about webhook signature verification