Create a subscription
Pick the same event types webhooks deliver. Store the Pull token immediately — plaintext is shown only on create and rotate.
Pull is the outbound-HTTPS alternative to webhooks. Long-poll the same message and device events from behind NAT, a firewall, or a private network — no public callback URL required.
from wazzapi import PullSubscriptionConsumer, WazzapiClient
with WazzapiClient(api_key="wz_live_••••••••") as client:
created = client.pull_subscriptions.create(
["message.received", "device.connection_failed"],
description="private CRM consumer",
)
token = created.token # visible once — store it
GET /api/v1/pull/subscriptions/{id}/events?offset=210&limit=100&timeout=60
Authorization: Bearer wzpull_live_••••••••
X-Wazzapi-Poller-ID: stable-client-process-id Keep webhooks as the default for public HTTPS endpoints. Switch to Pull when the consumer can only make outbound requests.
PostgreSQL stores the canonical events. Your poller acknowledges work by sending the last returned offset on the next request.
Pick the same event types webhooks deliver. Store the Pull token immediately — plaintext is shown only on create and rotate.
Your process makes outbound HTTPS requests. Long polling is near-real-time; short polls are for one-shot fetches.
Process the batch, deduplicate by event_id, then persist next_offset. A crash before save replays the batch.
Pull and webhooks fan out independently. A stuck poller never blocks webhook customers, and a webhook retry never advances a Pull cursor.
message.received, sent, delivered, read, failed, plus device.connected, disconnected, and connection_failed.
No inbound ports. Pull is the delivery channel when you cannot receive callbacks.
Replay from the last durable offset. Offsets older than retention return cursor_expired — no silent resync.
Python and Node ship PullSubscriptionConsumer with durable offset stores and long-poll timeouts.
Create a Pull subscription, store the token, and run the official Python or Node consumer with a durable offset store.