When to use webhooks vs. SSE
| Webhooks | SSE | |
|---|---|---|
| Direction | Sly POSTs to your URL | Agent opens a persistent connection |
| Reachability | You need a public HTTPS URL | Agent makes the outbound connection |
| Best for | Server-side integrations | Agents running locally / sandboxed |
| Delivery | At-least-once with retries | Best-effort with replay buffer |
Create a subscription
Delivery shape
Every delivery is a POST with JSON body:X-Sly-Signature: t=...,v1=...— HMAC signature (verify it)X-Sly-Event-Id: evt_...— stable ID for idempotencyX-Sly-Delivery-Id: del_...— unique per delivery attemptX-Sly-Webhook-Id: wh_...— which subscription
Expected response
- 2xx — treated as success; no retry
- Any other status or timeout → retry with exponential backoff
Retries
Failed deliveries retry on this schedule (up to 72 hours):X-Sly-Event-Id — use it for idempotency.
Idempotency on your side
Webhook delivery is at-least-once. Always dedupe:processedEvents (24-48 hours is plenty).
Next steps
Event catalog
Full list of events you can subscribe to.
Signature verification
How to verify webhooks are actually from Sly.
Replay
Re-send past events during incident recovery.
Local testing
ngrok, webhook.sly.ai, tunnel setup.
