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
2
Verify installation
Initialization
Create a newZeploClient instance with your configuration:
Store your API key in an environment variable. Never hard-code secrets in your source files.
Operations
Messaging
- JavaScript/TypeScript
- Python
Contacts
- JavaScript/TypeScript
- Python
Campaigns
- JavaScript/TypeScript
- Python
Webhooks
- JavaScript/TypeScript
- Python
Error Handling
All SDK errors inherit fromZeploError. Use specific exception classes to handle different failure modes:
Async Support
The SDK provides a fully asynchronous client for high-concurrency workloads. Async support usesaiohttp 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
What Python versions are supported?
What Python versions are supported?
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.
How do I use async mode?
How do I use async mode?
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.Does the SDK provide type hints?
Does the SDK provide type hints?
Yes. All public APIs are annotated with type hints compatible with mypy and pyright in strict mode. No additional stub packages are needed.
Are requests retried automatically?
Are requests retried automatically?
By default, the SDK retries failed requests up to 3 times with exponential backoff. Customize this through the client configuration:
How do I enable logging?
How do I enable logging?
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.
