POST to your endpoint when an action reaches completed or failed, and when a device connects, reconnects, or disconnects. Use webhooks instead of polling GET /actions/{actionId}.
Set up an endpoint
- In the dashboard, open Settings → Webhooks.
- Pick the environment. Sandbox and live have separate endpoints.
- Add your endpoint URL.
- Copy the endpoint’s signing secret (
whsec_...) into your server’s environment.
Events
Payloads for each are in Events. No event is sent when an action is created, starts, or is cancelled.
Payload
The request body is the event’s fields as flat JSON. There’s no wrapper and notype field.
errorCode means push.failed. actionId without errorCode means push.completed. No actionId means a device.* event. See Events.
Handle a delivery
- Verify the signature using the raw request body.
- Skip it if you’ve already processed it.
- Return a
2xxquickly. Do slow work in the background.
Duplicates
Deliveries are at least once, so the same event can arrive more than once.Timing
Events are sent after a short delay. In live, every event arrives about 10 seconds after it happens. In sandbox, the delay is longer so you have time to start a tunnel to your local machine: about 3 minutes for push events anddevice.disconnected, and about 1 minute for device.connected and device.reconnected.
Test in sandbox
Push to a sandbox device to get apush.completed. To get a push.failed, add a sandbox block to the push:
push.failed follows. Add a start to get a 202 first and the failure when the action runs.
Next steps
Verify signatures
Confirm each request came from Amps.
Events
Every event and its payload.
Push
Action states and how actions finish.