PublicAPI Webhooks
PublicAPI Webhooks deliver real-time notifications to your application when events occur in your TimelinesAI workspace. Instead of polling the API for changes, your server receives instant HTTP POST callbacks whenever messages arrive, chats are created, accounts change status, and more.How it works
1
Register a webhook
Use
POST /webhooks to subscribe to an event type and provide your endpoint URL2
An event occurs
A new message arrives, a chat is created, or an account status changes
3
You receive a POST request
TimelinesAI sends the event payload to your endpoint in real-time
4
Acknowledge receipt
Your server responds with a 2xx status within 5 seconds
Available events
Message events
Real-time notifications for all message activity in your workspace.Chat events
Track conversation lifecycle and assignment changes.Call events
Receive call history events for WhatsApp voice and video calls. Fired only after the call ends.WhatsApp account events
Monitor the connection status of your WhatsApp numbers.Use case examples
Auto-reply chatbot
Auto-reply chatbot
Build an automated responder that handles common questions instantly.
- Subscribe to
message:received:new - Parse the incoming message text for keywords
- Send an appropriate reply using
POST /chats/{id}/messages - Escalate complex queries by assigning the chat to a human agent
Real-time CRM sync
Real-time CRM sync
Keep your CRM updated the moment a conversation happens.
- Subscribe to
message:received:newandchat:new - On new chat — create a lead/contact in your CRM
- On new message — log the interaction as an activity
- Use chat assignment events to sync agent ownership
Team notification system
Team notification system
Alert your team in Slack, Teams, or email when important events happen.
- Subscribe to
message:received:newandchat:responsible:assigned - Filter events by label or content keywords
- Forward the notification to Slack, Teams, or a custom dashboard
- Monitor WhatsApp account events to alert admins about disconnections
Delivery tracking & analytics
Delivery tracking & analytics
Track message delivery rates and response times.
- Subscribe to
message:sent:newto track outgoing deliveries - Subscribe to
message:received:newto measure response times - Aggregate data to build delivery rate dashboards
- Alert on anomalies like high failure rates or unusual activity
Webhook payload example
When a new message arrives, your endpoint receives a payload like:Attachments — The
temporary_download_url for each attachment is a pre-signed URL valid for 15 minutes from the moment the webhook is delivered. Download or forward attachment files immediately upon receiving the webhook. After expiration, you can retrieve the file again using the Public API.Reactions — Emoji reactions on messages are delivered via the dedicated
message:reaction event, not on message:new. The payload includes the full current reactions map for the message (emoji → integer count) along with the action (set or clear) and the reactor’s identity.Endpoint requirements
Your webhook endpoint must:Be publicly accessible (no localhost in production)
Use HTTPS
Respond with a 2xx status within 5 seconds
Accept POST requests with JSON body
Retry policy
If your endpoint returns a non-2xx status or the request times out, TimelinesAI retries the delivery 2 additional times (3 attempts total). If all attempts fail, the webhook’serrors_counter increments.
Best practices
- Respond immediately — return 200 first, then process the event asynchronously
- Handle duplicates — use
message_uidto deduplicate events that may be delivered more than once - Monitor errors — check
errors_counteron your webhooks to catch delivery failures early - Use a queue — for high-volume workspaces, push events to a message queue (Redis, SQS, RabbitMQ) and process separately
Managing webhooks
Webhook subscriptions are managed via the Public API:
See the Webhooks guide for setup instructions and code examples.
Next steps
Webhooks guide
Step-by-step setup with code examples
Public API
Explore all API endpoints

