The Go SDK is an idiomatic Go client for the Titan WhatsApp API. It uses functional options for configuration, accepts aDocumentation Index
Fetch the complete documentation index at: https://docs.usetitan.app/llms.txt
Use this file to discover all available pages before exploring further.
context.Context on every call, and generates all types from the OpenAPI spec into go/types_gen.go. The SDK includes webhook verification and supports both server API keys and client tokens.
Installation
Create a client
NewClient to configure authentication, timeouts, or a custom HTTP client. titan.WithAPIKey sets a server API key.
Keep your API key on the server. Use client tokens for restricted or browser-facing clients.
Send a message
context.Context. The second is the session name. The third is a typed SendMessageRequest struct. All optional pointer fields use helper functions like ptr to convert literal values.
Service domains
The client exposes every Titan API domain as a field. Go usesPascalCase for all field names.
| Domain | Field |
|---|---|
| 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
Usetitan.VerifyWebhook to validate the HMAC-SHA256 signature on incoming webhook deliveries. It returns an error if the signature is invalid.
[]byte, the value of the X-Webhook-Signature header as a string, and your webhook secret as a string. Check the returned error before processing the event.
Client tokens
To use a short-lived client token instead of a server API key, usetitan.WithClientToken:
Full client token flow
Types
All request and response types are auto-generated from the OpenAPI spec intogo/types_gen.go in the titan-api/sdks monorepo. A GitHub Actions workflow regenerates the file automatically whenever the spec changes. Import types directly from the module:
Deprecation warnings
The SDK readsDeprecation, Sunset, and Titan-SDK-Deprecation response headers automatically. When any of these headers appear, the SDK logs a warning once per client lifetime using the standard log package:
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 module version is outdated.