What are Webhooks?
Webhooks allow you to receive real-time notifications when events occur in the Amps AI platform. Instead of polling the API for updates, webhooks push events to your application as they happen.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 - no webhook is sent - You can poll the API to check status while it’s processing
- 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 (
device.connected, device.disconnected, device.reconnected) are planned but not yet implemented. These events will be available in a future release.Webhook Delivery
Delivery Guarantees
- At-least-once delivery: Webhooks may be delivered multiple times
- Idempotency: Use the
eventIdto 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
All webhooks follow a consistent structure: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
eventId - Log all events for debugging
Next Steps
Webhook Types
See all webhook event types and payloads
Security
Learn about webhook signature verification