The PHP SDK provides a typed client for the Titan WhatsApp API. It requires PHP 8.1 or later and uses named constructor arguments for configuration. Types are auto-generated from the OpenAPI spec. 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 an untrusted environment.
Send a message
Service domains
The client exposes every Titan API domain via a method call. PHP usescamelCase for all method names.
| Domain | Method |
|---|---|
| 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->clientTokens() |
Webhook verification
Use theVerifier class to validate the HMAC-SHA256 signature on incoming webhook deliveries. It returns true if the signature is valid and false otherwise.
X-Webhook-Signature header, and your webhook secret. Check the return value before processing the event.
Client tokens
To use a short-lived client token instead of a server API key, passclientToken instead of apiKey:
Full client token flow
Types
Types are auto-generated from the OpenAPI spec intophp/src/Generated/Types.php in the titan-api/sdks monorepo. A GitHub Actions workflow regenerates the file automatically whenever the spec changes. Import generated types directly:
Deprecation warnings
The SDK readsDeprecation, Sunset, and Titan-SDK-Deprecation response headers on every API response. When any of these headers appear, the SDK triggers a PHP warning once per client lifetime using trigger_error:
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.