Python SDK
The Python SDK is not on PyPI yet. Send messages from Python with plain requests until it is.
The Python SDK is not published yet. The whabuzz package is written (its source is in sdks/python in the WhaBuzz repository) but it is not on PyPI, so pip install whabuzz does not work today. The Node.js SDK is live on npm.
Until the package is published, call the REST API directly. Request bodies and responses are Meta's own, so any HTTP client works. The full walkthrough, including errors, idempotency and webhook verification with hmac, is in Send WhatsApp messages with Python.
#First message with requests
pip install requests
export WHABUZZ_API_KEY="wb_live_..." # your keyimport os
import requests
r = requests.post(
"https://api.whabuzz.com/v1/messages",
headers={"Authorization": f"Bearer {os.environ['WHABUZZ_API_KEY']}"},
json={
"from": "+14692311132", # your connected number
"to": os.environ["TO"], # the recipient, E.164
"type": "text",
"text": {"body": "Hello from WhaBuzz"},
},
timeout=30,
)
r.raise_for_status()
print(r.json()["messages"][0]["id"])Outside the 24-hour customer window send a template instead.
#Planned package
The rest of this page describes the package as it will ship. It is here so you can plan for it. None of it is installable yet.
#Options and resources
WhaBuzz(api_key, base_url, tenant, timeout, transport); transport="httpx" needs pip install whabuzz[httpx]. Pass idempotency_key= on send, batch and create calls; see Idempotency.
tenant.get, messages (send, batch, get_batch, list_batch_items, cancel_batch, mark_read), templates (list, create, get), numbers (list, get), webhooks.endpoints (list, create, get, update, delete, verify, rotate_secret), events (list, get, iterate), media.get.
#Errors
Failures raise WhaBuzzError with status, source (meta, whabuzz, client), code, meta (Meta's error object, verbatim) and request_id. See Errors.
#Verify a webhook
from whabuzz import verify_webhook
# raw_body must be the exact bytes received, before JSON parsing
event = verify_webhook(raw_body, request.headers, WEBHOOK_SECRET)
print(event["type"])Raises WebhookVerificationError with a reason when the signature, timestamp (300 s) or header is wrong. Details of the scheme: Webhooks.
This page as Markdown: /sdks/python.md. All docs in one file: /llms-full.txt. Status.