Webhooks
Webhooks allow your application to receive real-time notifications when events occur in your TimelinesAI workspace—like new messages, sent messages, or chat updates.How webhooks work
1
You create a webhook subscription
Tell TimelinesAI which events you care about and where to send them
2
An event occurs
A new message arrives, a message is sent, etc.
3
TimelinesAI sends a POST request
Your endpoint receives the event data in real-time
4
Your app processes the event
Respond with 2xx status within 5 seconds
Available events
See the full event list for all available events.
Creating a webhook
Webhook endpoint requirements
Your endpoint must:Be publicly accessible (no localhost)
Use HTTPS
Respond with 2xx status within 5 seconds
Accept POST requests with JSON body
Handling webhook events
Example: Node.js / Express
Example: Python / Flask
Managing webhooks
List all webhooks
Get webhook details
Update webhook
Delete webhook
Error handling
Delivery failures
If your endpoint returns a non-2xx status or times out:- TimelinesAI retries the delivery 2 additional times (3 attempts total)
- If all attempts fail, the
errors_counterincrements - After several failures, TimelinesAI emails the workspace owner
- Webhooks are not automatically disabled — fix your endpoint
Check error count
errors_counter in the response.
Best practices
Respond quickly
Respond quickly
Process events asynchronously. Return 200 immediately, then handle the event in the background.
Handle duplicates
Handle duplicates
Webhooks may be delivered more than once. Use
message_uid or event IDs to deduplicate.Use a queue
Use a queue
For high volume, push events to a message queue (Redis, RabbitMQ, SQS) and process separately.
Log everything
Log everything
Log incoming webhooks for debugging:
Testing webhooks locally
Use a tunnel service to expose your local server:ngrok
localtunnel
Remember to update your webhook URL to production when deploying.
Example: Auto-reply bot
Next steps
Send messages
Learn to send replies
Manage chats
Organize incoming conversations

