Skip to main content

Python SDK

The official Python SDK gives you a typed client for the public WazzAPI surface. Use it to:
  • send direct WhatsApp messages
  • pair SDK usage with the public API for device inventory and sender selection
  • list, create, update, and delete contacts
  • create templates and preview rendered content
  • verify signed WazzAPI webhook deliveries

Package

Install the published package from PyPI.

Source code

Browse the SDK repository, examples, and release history.

Requirements

  • Python 3.10+
  • a WazzAPI account
  • a WazzAPI API key
If you plan to verify webhooks, also create a webhook secret in the dashboard.

Install

Choose the package manager that fits your stack:
pip
uv

Configuration

The SDK uses https://api.wazzapi.com by default. For most integrations, you only need:
  • WAZZAPI_API_KEY
For webhook verification, also set:
  • WAZZAPI_WEBHOOK_SECRET
.env
Keep secrets on the server side only. Do not expose them in browsers or mobile apps.

Quick start

Send a message

List contacts

Preview a template

Verify incoming webhooks

Use WebhookHandler to validate the raw request body against the signature header before parsing JSON.
WazzAPI signs webhook deliveries with:
  • X-Wazzapi-Signature
  • X-Wazzapi-Event
  • X-Wazzapi-Event-ID
Supported event families include:
  • message events: message.received, message.sent, message.delivered, message.read, message.failed
  • device events: device.connected, device.disconnected

Handle API errors

When the API returns a non-success status, the SDK raises WazzapiAPIError.

Example scripts

The SDK repository includes ready-to-run examples:
  • examples/send_message.py
  • examples/list_contacts.py
  • examples/create_template.py
  • examples/preview_template.py
  • examples/verify_webhook.py

Next steps

Quickstart

Create your API key and send your first live request.

API Reference

Explore endpoints and payloads behind the SDK methods.