Skip to main content

baatzo

Send approved Utility and Authentication WhatsApp templates with the Baatzo API, read their status and verify status webhooks. Python 3.10 or later, no dependencies, typed.

pip install baatzo

Make a key in the Baatzo web app under Settings, Developers. Start with a sandbox key (bz_test_): it is free on every plan and nothing reaches WhatsApp. Keep keys on your server.

Send

from baatzo import Baatzo

baatzo = Baatzo()  # reads BAATZO_API_KEY

sent = baatzo.messages.send(
    to="+919829012345",
    template={"name": "login_code", "language": "en"},
    variables={"body": {"code": "482913"}},
    reference="login-88213",
    idempotency_key="login-88213-1",
)
# {"id": "0193…", "status": "accepted", …}

Give your own idempotency_key when your code may run the same send again, after a crash for example: the same key never sends twice in 24 hours. Without one, each call makes a new key. The sending number's phone number ID, needed only with more than one number, is from_.

Read

message = baatzo.messages.get(sent["id"])
print(message["status"], message["charge"])

Webhooks

Check the raw body, before any JSON parsing.

from baatzo import BaatzoSignatureError, verify_webhook

@app.post("/baatzo-webhook")  # Flask
def baatzo_webhook():
    try:
        event = verify_webhook(
            request.get_data(), request.headers.get("Baatzo-Signature"), os.environ["BAATZO_WEBHOOK_SECRET"]
        )
    except BaatzoSignatureError:
        return "", 400
    # Drop a repeat by event["id"]; ignore a lower event["data"]["status_rank"] than you have.
    return "", 200  # answer within 5 seconds, then do the work

verify_signature(raw_body, header, secret) answers True or False instead.

Errors and retries

  • BaatzoError: Baatzo refused. It has status, code (the list), details, request_id and retry_after.
  • BaatzoConnectionError: no answer came. The message may have been sent: try again with its idempotency_key.
  • BaatzoSignatureError: a webhook that does not verify.

The client tries again, twice by default and always with the same Idempotency-Key, after a 429, a 5xx, request_in_progress and a connection failure. It does not try retry_later again: send a fresh code.

A send can succeed as a request and still be refused by WhatsApp: check status for failed and withheld.

Options: Baatzo(api_key, base_url=..., timeout=30, max_retries=2).

Licence

MIT. By Aashita Technosoft Private Limited.

Metadata

Release files for baatzo 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for baatzo 0.1.1
File Size Uploaded Provenance Actions
baatzo-0.1.1.tar.gz 5.8 kB With provenance Details for baatzo-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for baatzo 0.1.1
File Interpreter ABI Platform Actions
baatzo-0.1.1-py3-none-any.whl Python 3 none any Details for baatzo-0.1.1-py3-none-any.whl

Total release size: 12.5 kB

Release files / baatzo-0.1.1.tar.gz

Download URL baatzo-0.1.1.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
af5f322c9e966aa467f8007499a705b07ee8b0c9b512e4e3d0d3b2ad83861840
BLAKE2b-256 checksum
How to use checksums
e34cae8eb29a9932c2ed344694a8d6269d16a0723719ef029cc85ddc16037ab5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / baatzo-0.1.1-py3-none-any.whl

Download URL baatzo-0.1.1-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d64ff3237331d2138e09a4be3aa1d9868c1074e5a55cb1b9f88f02b1a90b6e14
BLAKE2b-256 checksum
How to use checksums
a2a7cdf14f792669a2e2d4e2351539738f130f36764012929154a0b6910579eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for baatzo 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for baatzo-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page