POST /apps/{app_id}/events
Publish an event to one or more channels. The Pusher SDKs in every language wrap this for you; you only need to call it directly when you don’t have an SDK handy or you’re testing with curl.
Authentication
Every request needs four query params:
| Param | Value |
|---|---|
auth_key | Your app key |
auth_timestamp | Seconds since the Unix epoch (must be within 600s of server time) |
auth_version | 1.0 |
auth_signature | Hex HMAC-SHA256 of the canonical string (see below), keyed by your secret |
For requests with a body, also include:
| Param | Value |
|---|---|
body_md5 | Hex MD5 of the raw request body |
Canonical string to sign
POST\n/apps/{app_id}/events\n{sorted_query_params_minus_signature}Query params are sorted by key, joined as key=value pairs separated by &, with no URL-encoding (Pusher’s spec).
Example
Body:
{ "name": "message", "channel": "chat", "data": "{\"text\":\"hello\"}" }Note data is a string containing JSON, not a JSON object.
curl:
APP_ID=6855671
KEY=YOUR_KEY
SECRET=YOUR_SECRET
BODY='{"name":"message","channel":"chat","data":"{\"text\":\"hello\"}"}'
BODY_MD5=$(printf '%s' "$BODY" | md5sum | awk '{print $1}')
TS=$(date +%s)
QS="auth_key=$KEY&auth_timestamp=$TS&auth_version=1.0&body_md5=$BODY_MD5"
SIG=$(printf 'POST\n/apps/%s/events\n%s' "$APP_ID" "$QS" \
| openssl dgst -sha256 -hmac "$SECRET" -hex \
| awk '{print $NF}')
curl -X POST 'https://ws-sa.mawjly.com/apps/'$APP_ID'/events?'$QS'&auth_signature='$SIG \
-H 'Content-Type: application/json' \
-d "$BODY"Response: {} with HTTP 200.
Multi-channel fan-out
Replace channel with channels (array, max 100):
{
"name": "broadcast",
"channels": ["news.global", "news.tech", "news.biz"],
"data": "{\"headline\":\"hi\"}"
}Batch (different events per channel)
POST /apps/{app_id}/batch_events — body shape:
{
"batch": [
{ "channel": "chat", "name": "message", "data": "{\"text\":\"a\"}" },
{ "channel": "chat", "name": "message", "data": "{\"text\":\"b\"}" }
]
}Up to 10 events per batch.
Limits
datapayload: 100 KB max (after JSON encoding)- 100 channels max per single trigger
- 10 events max per batch
- Server-side rate limit per app, scaled to your plan