The Events module is how you receive what happens in your instance in real time. RyzeAPI emits events through two independent channels that share the same envelope and the same catalog:Documentation Index
Fetch the complete documentation index at: https://docs.ryzeapi.cloud/llms.txt
Use this file to discover all available pages before exploring further.
Webhook (HTTP push)
RyzeAPI
POSTs to your URL every time an event occurs. Persisted in a queue with retry/backoff and DLQ. Ideal for servers, CRMs, automations.WebSocket (real-time push)
The client opens a connection and receives events instantly. No persistence, ideal for dashboards, live panels, support screens.
Module endpoints
| Method | Path | Function |
|---|---|---|
POST | /api/events/webhook/:instance | Configure webhook (up to 3 enabled) |
GET | /api/events/getWebhook/:instance | List webhooks or get one by ?label= |
POST | /api/events/websocket/:instance | Configure WebSocket ({"enabled": false} disables) |
GET | /api/events/getWebsocket/:instance | Read current WebSocket config |
GET | /ws/:instance | Connect via WebSocket (upgrade) |
Webhook and WebSocket configuration can also be done at instance creation, just send
webhookEnabled, webhookURL, websocketEnabled, etc. in the body of POST /api/instance/new.Shared envelope
Both webhook and WebSocket deliver the same object:instanceData.token is the instance’s own token, useful when your consumer centralizes multiple instances and needs to identify the source.
The 6 event types
message.exchange
Messages sent/received (text, media, sticker, doc, poll, contact, location, button/list, edits and revocations).
message.status
Delivery receipts:
delivered, read, played, read_self, played_self, etc.call.update
Calls:
offer, accepted, rejected, terminated, notification, latency.group.flow
Group changes:
joined/left/promoted/demoted + metadata (name, topic, announce, link, etc.).instance.state
Instance connection changes:
connected, qr_ready, temp_banned, logged_out, pair_success…label.update
WhatsApp Business labels: edits, association with chats and messages.
Full event catalog
Payload schemas, enums and examples for each of the 6 types.
Webhook vs WebSocket
| Aspect | Webhook | WebSocket |
|---|---|---|
| Protocol | HTTP POST | WS (TCP upgrade) |
| Delivery | Async, persisted in queue | Real-time, in memory |
| Retry/DLQ | Exponential backoff 1s→1h, up to 5 attempts + DLQ | No retry, events lost if client offline |
| Event filter | events[] per config | events[] per config |
| Base64 media | mediaBase64 optional | mediaBase64 optional |
| Authentication | Configurable Authorization header | Token on upgrade (header or ?token=) |
| Heartbeat | N/A | PING/PONG ~54s/60s |
| Limit | Up to 3 enabled webhooks per instance | 1 config per instance (broadcast to N connected clients) |
| Backpressure | Queue grows in DB | 256-msg buffer per client; slow ones are dropped |
| Survives consumer crash? | Yes | No |
Multiple webhooks per instance
Each instance accepts up to 3 simultaneously enabled webhooks, identified by alabel. This lets you, for example:
defaultfor the main production systemanalytics-pipelinefor an event sinkstaging-mirrorto validate changes in parallel
label has its own URL, event filter, authorization and mediaBase64. See configure webhook.
Best practices
Respond 2xx in under 5s on the webhook endpoint, otherwise delivery enters retry with exponential backoff.
Validate the origin with the configured
Authorization header, there is no automatic HMAC, the consumer is responsible.mediaBase64: false if you only need the URL/s3Url, saves bandwidth and DB space.Reconnect with backoff on the WebSocket, there is no session resume; lost events do not come back.
Filter
events[] when you know exactly what you’ll consume, reducing traffic and processing.Next steps
Configure webhook
POST /api/events/webhook/:instance, creates/updates by label.List webhooks
GET /api/events/getWebhook/:instance, all or by ?label=.Configure WebSocket
POST /api/events/websocket/:instance, enabled, events, mediaBase64.Check WebSocket config
GET /api/events/getWebsocket/:instance.Event catalog
Schemas and examples for the 6 types.
Connect via WebSocket
GET /ws/:instance, protocol, auth, reconnection.