Webhooks let you receive real-time notifications from Titan. When an event occurs — a message arrives, a session connects, or a group changes — Titan sends an HTTP POST request to your registered URL with a JSON payload describing what happened. You do not need to poll the API.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.
How webhook delivery works
Every delivery is aPOST request to your URL with:
Content-Type: application/jsonX-Webhook-Signature: sha256={hex_digest}— HMAC-SHA256 signature you use to verify the request came from Titan- A JSON body containing the event type, session name, timestamp, and event-specific payload
2xx response from your server to consider the delivery successful. If your server returns a non-2xx status or does not respond within the timeout, Titan retries the delivery according to your retry policy.
Setting up webhooks
Create a webhook
Call Titan returns the created webhook object including its
POST /api/webhooks with the URL you want Titan to deliver events to. At minimum you need a url. Everything else is optional.id.Verify signatures
Every delivery includes an
X-Webhook-Signature header. Verify it before processing the payload to ensure the request came from Titan and was not tampered with. See Signature verification for code examples.Handle events
Parse the JSON body and branch on the
event field. Return a 2xx response as quickly as possible — do your processing asynchronously if it takes time. See Event reference for the complete list of events and their payload structures.Webhook configuration
Request body for POST /api/webhooks
The HTTPS URL Titan delivers events to. Private IPs,
localhost, and internal hostnames are blocked by SSRF protection.Array of event type strings to subscribe to (for example,
["message.received", "session.status"]). Pass ["*"] or omit this field to receive all events. See Event reference for the full list.Secret key used to compute the
X-Webhook-Signature HMAC-SHA256 header on every delivery. Keep this value private. If you omit it, Titan auto-generates one and includes it in the response — store it immediately, as it is not shown again.Up to 10 custom HTTP headers to include with each delivery. Useful for adding an authentication header your server expects.Each header object has a
name and value field.Configures how Titan retries failed deliveries.
With
| Field | Type | Description |
|---|---|---|
attempts | integer | Maximum number of retry attempts after the first failure |
delaySeconds | integer | Initial delay between retries in seconds |
policy | string | Backoff strategy: constant, linear, or exponential |
exponential policy and delaySeconds: 5, retries happen at 5 s, 10 s, 20 s, and so on.Session name to filter events for. When set, Titan only delivers events from that specific session. Omit to receive events from all sessions.
Webhook payload envelope
Every event Titan delivers uses the same envelope structure:Unique identifier for this delivery attempt.
The event type, for example
message.received or session.status. Use this field to route the payload to the correct handler.Name of the Titan session that produced the event.
ISO 8601 timestamp of when the event occurred.
Event-specific data. The structure differs per event type. See Event reference.
Managing webhooks
| Operation | Endpoint |
|---|---|
| List all webhooks | GET /api/webhooks |
| Get a webhook by ID | GET /api/webhooks/{id} |
| Update a webhook | PUT /api/webhooks/{id} |
| Delete a webhook | DELETE /api/webhooks/{id} |
Retry policies
When your server returns a non-2xx response or does not respond in time, Titan retries the delivery using the policy you configured.
| Policy | Behavior |
|---|---|
constant | Same delay between every retry |
linear | Delay increases by delaySeconds on each attempt |
exponential | Delay doubles on each attempt |
For development, you can use a tool like Webhook.site or ngrok to inspect webhook payloads before wiring up your production server.
Next steps
Event reference
Browse all 30 event types, organized by category, with example payloads for each.
Signature verification
Learn how to verify the HMAC-SHA256 signature in TypeScript, Python, Go, and PHP.