Public API 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
Available events
Message events
Real-time notifications for all message activity in your workspace.| Event | Trigger | Description |
|---|---|---|
message:new | Any new message | Fires for both incoming and outgoing messages |
message:received:new | Incoming message | A customer or contact sends you a message |
message:sent:new | Outgoing message | A message you sent is processed |
Chat events
Track conversation lifecycle and assignment changes.| Event | Trigger | Description |
|---|---|---|
chat:created | New chat (any) | A new direct or group chat appears |
chat:received:created | New incoming chat | A contact initiates a conversation with you |
chat:sent:created | New outgoing chat | You start a new conversation |
chat:assigned | Chat reassigned | A chat is assigned to a team member |
chat:unassigned | Chat unassigned | A chat’s assignment is removed |
WhatsApp account events
Monitor the connection status of your WhatsApp numbers.| Event | Trigger | Description |
|---|---|---|
| Account reconnected | WhatsApp reconnects | A previously disconnected account comes back online |
| Account disconnected | WhatsApp disconnects | An account loses its connection |
| Syncing suspended | Syncing paused | Message syncing stops (e.g., subscription change) |
| Syncing resumed | Syncing restarted | Message syncing resumes after suspension |
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:newandchat:created - 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: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 — The
reactions object is a map of emoji characters to their count as strings (e.g., "👍": "2"). This field is included when the message has reactions.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
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:| Action | Endpoint |
|---|---|
| List all | GET /webhooks |
| Create | POST /webhooks |
| Get details | GET /webhooks/{id} |
| Update | PUT /webhooks/{id} |
| Delete | DELETE /webhooks/{id} |

