Skip to main content

waha-py

PyPI version License: MIT Python

Python SDK for WAHA (WhatsApp HTTP API) - auto-generated from OpenAPI spec with full type safety, Pydantic v2 models, and HTTPX-based synchronous & asynchronous clients.

Installation

pip install waha-py

Usage

Synchronous Client

from waha import WahaClient

# Initialize with baseURL and optional API key
client = WahaClient("http://localhost:3000", api_key="your-api-key")

# Access controllers via properties
# Sessions
sessions = client.sessions.list()

# Chatting
message = client.chatting.send_text(
    session="default",
    payload={
        "chatId": "1234567890@c.us",
        "text": "Hello from waha-py!",
    },
)

# Get QR Code
qr = client.auth.get_qr(session="default", params={"format": "raw"})

# Always close client when done
client.close()

Asynchronous Client

import asyncio
from waha import AsyncWahaClient


async def main():
    async_client = AsyncWahaClient("http://localhost:3000", api_key="your-api-key")

    # Send message asynchronously
    message = await async_client.chatting.a_send_text(
        session="default",
        payload={
            "chatId": "1234567890@c.us",
            "text": "Async hello from waha-py!",
        },
    )

    await async_client.close()


asyncio.run(main())

API Controllers

All endpoints are available through client properties:

client.sessions.*      # SessionsApi
client.chatting.*      # ChattingApi
client.contacts.*      # ContactsApi
client.groups.*        # GroupsApi
client.auth.*          # AuthApi
client.labels.*        # LabelsApi
client.presence.*      # PresenceApi
client.profile.*       # ProfileApi
client.media.*         # MediaApi
# ...and more

Pydantic Models

All types are auto-generated from the WAHA OpenAPI specification using Pydantic v2:

from waha.generated.models import SessionInfo, MessageTextRequest, WAMessage

How It Works

This package is automatically kept in sync with WAHA:

  1. Daily - GitHub Action spins up latest devlikeapro/waha container
  2. Fetches OpenAPI spec from /-json endpoint
  3. Compares SHA256 hash with committed openapi.json
  4. If changed - Generates new types + Python clients, bumps version, commits, and pushes tag
  5. Publishes to PyPI via OIDC trusted publishing

Development

Prerequisites

  • Python >= 3.9
  • Running WAHA instance (or openapi.json)

Generate Types & Clients Locally

# Install development dependencies
pip install -e ".[dev]"

# Generate models and clients from openapi.json
python scripts/generate.py

# Run tests
pytest

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

waha_py-2026.7.2.tar.gz (231.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

waha_py-2026.7.2-py3-none-any.whl (76.9 kB view details)

Uploaded Python 3

File details

Details for the file waha_py-2026.7.2.tar.gz.

File metadata

  • Download URL: waha_py-2026.7.2.tar.gz
  • Upload date:
  • Size: 231.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for waha_py-2026.7.2.tar.gz
Algorithm Hash digest
SHA256 15e18d7603fc6ffd08019727b8294a0c4e13e3171c704873a0c9e264e5d2ed84
MD5 53818d04bc0a6980f47d0a07fc31fd11
BLAKE2b-256 668e099c2a0472de79c62cbee7a0c180160db53e14702124d14eafaf6ba6385f

See more details on using hashes here.

Provenance

The following attestation bundles were made for waha_py-2026.7.2.tar.gz:

Publisher: publish-trusted.yml on muhammedaksam/waha-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file waha_py-2026.7.2-py3-none-any.whl.

File metadata

  • Download URL: waha_py-2026.7.2-py3-none-any.whl
  • Upload date:
  • Size: 76.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for waha_py-2026.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 679c96a33749a2cd4d07c5521bcaed025649b5413a68b9982dc3174bd1798173
MD5 f92e9771fbf7090552bbc752b8b6500e
BLAKE2b-256 cd2d19072b72f0baf8959676b4a4d9cb17fdc2e41d0d0beee34d77ef3d6652a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for waha_py-2026.7.2-py3-none-any.whl:

Publisher: publish-trusted.yml on muhammedaksam/waha-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2026.8.1

2 files

This release

2026.7.2 This release

2 files

2026.7.1

2 files

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