The Python SDK provides a typed client for the Titan WhatsApp API. It supports Python 3.9 and later. Types are auto-generated from the OpenAPI spec so they stay in sync with every API release. The SDK includes webhook signature verification and accepts both server API keys and client tokens.Documentation Index
Fetch the complete documentation index at: https://docs.usetitan.app/llms.txt
Use this file to discover all available pages before exploring further.
Installation
Create a client
Keep your API key on the server. Use client tokens for any code that runs in the browser or an untrusted environment.
Send a message
Service domains
The client exposes every Titan API domain as an attribute. Python usessnake_case for all attribute names.
| Domain | Attribute |
|---|---|
| Sessions | client.sessions |
| Messages | client.messages |
| Contacts | client.contacts |
| Groups | client.groups |
| Channels | client.channels |
| Presence | client.presence |
| Profile | client.profile |
| Labels | client.labels |
| Chats | client.chats |
| Webhooks | client.webhooks |
| Pairing | client.pairing |
| LIDs | client.lids |
| Media | client.media |
| Client tokens | client.client_tokens |
The client tokens domain uses
client_tokens (with an underscore) in Python, following snake_case conventions. In TypeScript and PHP it is clientTokens.Webhook verification
Useverify_webhook to validate the HMAC-SHA256 signature on incoming webhook deliveries. It returns True if the signature is valid and False otherwise.
bytes, the value of the X-Webhook-Signature header, and your webhook secret.
Client tokens
To use a short-lived client token instead of a server API key, passclient_token instead of api_key:
Full client token flow
Types
Types are auto-generated from the OpenAPI spec intopython/titan/types_gen.py in the titan-api/sdks monorepo. They are regenerated automatically whenever the spec changes. You can import them directly for type annotations:
Deprecation warnings
The SDK readsDeprecation, Sunset, and Titan-SDK-Deprecation response headers on every API response. When any of these headers appear, the SDK emits a warning once per client lifetime:
Deprecation: true— the API version you are calling is deprecated.Sunset: <date>— the API version will be removed on the given date.Titan-SDK-Deprecation— your installed SDK version is outdated.