Skip to main content

Python SDK

The official Zeplo Python SDK provides a clean, Pythonic interface for the WhatsApp Business API. It supports both synchronous and asynchronous usage.
The SDK requires Python 3.8 or later and ships with full type hints for IDE autocompletion and static analysis with mypy or pyright.

Installation

1

Install the package

For async support with extra performance:
2

Verify installation

Initialization

Create a new ZeploClient instance with your configuration:
Store your API key in an environment variable. Never hard-code secrets in your source files.

Operations

Messaging

Contacts

Campaigns

Webhooks

Error Handling

All SDK errors inherit from ZeploError. Use specific exception classes to handle different failure modes:
ZeploRateLimitError includes a retry_after property (in seconds). Implement exponential backoff rather than retrying immediately.

Async Support

The SDK provides a fully asynchronous client for high-concurrency workloads. Async support uses aiohttp under the hood.
The AsyncZeploClient implements the async context manager protocol. Always use async with to ensure connections are properly cleaned up.

Async Error Handling

FAQ

The SDK supports Python 3.8, 3.9, 3.10, 3.11, 3.12, and 3.13. We test against all supported versions in CI. If you are on an earlier version, we recommend upgrading to receive security patches.
Install the SDK with the aio extra (pip install zeplo[aio]), then import AsyncZeploClient instead of ZeploClient. All methods on the async client return coroutines that you can await. Use asyncio.run() as the entry point for your async code.
Yes. All public APIs are annotated with type hints compatible with mypy and pyright in strict mode. No additional stub packages are needed.
By default, the SDK retries failed requests up to 3 times with exponential backoff. Customize this through the client configuration:
The SDK uses Python’s standard logging module under the zeplo namespace. Enable debug logging to see request and response details:

Next Steps

API Reference

Browse the full REST API endpoints, parameters, and response schemas.

JavaScript SDK

Use the official JavaScript/TypeScript SDK for frontend and Node.js projects.

Webhooks

Set up real-time event notifications for incoming messages and status updates.