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.8.1.tar.gz (234.2 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.8.1-py3-none-any.whl (77.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: waha_py-2026.8.1.tar.gz
  • Upload date:
  • Size: 234.2 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.8.1.tar.gz
Algorithm Hash digest
SHA256 2aba3d96607f30a83f4762dad668af63365ae2d4e0c501dfedb7d6aeaf34165c
MD5 69c0de6c915b03bc3a7989d14e61ed87
BLAKE2b-256 a34fc92f1ec4d65d5670590ba44ddaa4714c905de80a174d56be063502a6c300

See more details on using hashes here.

Provenance

The following attestation bundles were made for waha_py-2026.8.1.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.8.1-py3-none-any.whl.

File metadata

  • Download URL: waha_py-2026.8.1-py3-none-any.whl
  • Upload date:
  • Size: 77.5 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.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 01b922dd4c7cdf4be43ecd150d153f343b2571f0c2aa0b5ed70ba48db58b0597
MD5 0ce191bea04abf9e395ce9481e0072b5
BLAKE2b-256 16839c7eac0f85ea88b0afa9d811fe384f6c8dfc9ab567e2dc408f2fff8bbdbb

See more details on using hashes here.

Provenance

The following attestation bundles were made for waha_py-2026.8.1-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

This release

2026.8.1 This release

2 files

2026.7.2

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