Skip to main content

Pull events

Pull is the outbound-HTTPS alternative to webhooks. Use it when the consumer sits behind NAT, a firewall, or a private network and cannot receive WazzAPI callbacks. Webhook is still the default when you have a reachable HTTPS URL. Pull delivers the same event types; it is not message-history pagination and not the provider webhook WazzAPI uses to ingest WhatsApp.

When to use Pull vs webhooks

Create a subscription

Management calls use your organization API key. Creation is gated by webhook_access. Store the returned token immediately — plaintext is shown only on create and rotate.
Official SDKs: client.pull_subscriptions (Python) and client.pullSubscriptions (Node).

Poll

Polling uses only the Pull token (Authorization: Bearer wzpull_...). Do not poll with the org API key.
  • timeout=0 is a short poll. 1..60 enables long polling.
  • SDKs set a transport timeout of server timeout + 10 seconds. Raw HTTP clients must do the same.
  • A 200 means the batch was returned, not that your handler succeeded.
  • Persist next_offset only after the entire batch is processed. Deduplicate by stable event_id.
  • One active poller per subscription. A second poller gets 409 poller_conflict.

Offset rules

New subscriptions start at the current head. Existing events are not replayed.

Skip a poison event

Only the current contiguous cursor head can be skipped. There is no automatic skip.

SDK consumer

Both SDKs ship PullSubscriptionConsumer with a durable offset store. An in-memory integer is not enough across restarts.
See examples/pull-events.ts and examples/pull_events.py in the SDK repos.

Error codes

invalid_offset, poller_conflict, cursor_expired, subscription_paused, rate_limited, invalid_token. Limits: limit 1..100, timeout 0..60. Excessive short polling returns 429 with Retry-After.