Webhooks and Events
Server-Sent Events (SSE)
Opens a Server-Sent Events connection to receive events in real time.
GET
https://api.zapzapapi.com/api/v1/{instanceId}/sseAuthentication with the x-api-key and x-api-secret headers.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
token | text | body | No | Instance authentication token |
events | text | body | No | Types of events to receive. Supports two formats: - Comma-separated: `?events=chats,messages` - Repeated parameters: `?events=chats&events=messages` |
excludeMessages | text | body | No | Types of messages to exclude from the `messages` event. Supports two formats: - Comma-separated: `?excludeMessages=poll,reaction` - Repeated parameters: `?excludeMessages=poll&excludeMessages=reaction` |
Request example
curl
curl -X GET "https://api.zapzapapi.com/api/v1/{instanceId}/sse" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-api-secret: YOUR_API_SECRET"Node.js
const res = await fetch("https://api.zapzapapi.com/api/v1/{instanceId}/sse", {
method: "GET",
headers: {
"x-api-key": "YOUR_API_KEY",
"x-api-secret": "YOUR_API_SECRET",
},
});
console.log(await res.json());Python
import requests
res = requests.get(
"https://api.zapzapapi.com/api/v1/{instanceId}/sse",
headers={"x-api-key": "YOUR_API_KEY", "x-api-secret": "YOUR_API_SECRET"},
)
print(res.json())Response example
JSON
{}Values are illustrative; the fields follow the real response format.
Other endpoints in this category
Get your API keys
Create your account, connect a number in minutes and start using the API. R$15 per active number/month, with a welcome credit when you create the account, subject to the current campaign.
