Skip to main content

Webhooks

Webhooks allow your application to receive real-time notifications when events occur in your Timelines Global workspace—like new messages, sent messages, or chat updates.

How webhooks work

1

You create a webhook subscription

Tell Timelines Global which events you care about and where to send them
2

An event occurs

A new message arrives, a message is sent, etc.
3

Timelines Global 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

Response:

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:
  1. Timelines Global retries the delivery 2 additional times (3 attempts total)
  2. If all attempts fail, the errors_counter increments
  3. After several failures, Timelines Global emails the workspace owner
  4. Webhooks are not automatically disabled — fix your endpoint
Monitor your errors_counter and fix issues promptly to avoid missing events.

Check error count

Look for errors_counter in the response.

Best practices

Process events asynchronously. Return 200 immediately, then handle the event in the background.
Webhooks may be delivered more than once. Use message_uid or event IDs to deduplicate.
For high volume, push events to a message queue (Redis, RabbitMQ, SQS) and process separately.
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