Skip to main content

PublicAPI Webhooks

PublicAPI Webhooks deliver real-time notifications to your application when events occur in your Timelines Global 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 URL
2

An event occurs

A new message arrives, a chat is created, or an account status changes
3

You receive a POST request

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

WhatsApp account events

Monitor the connection status of your WhatsApp numbers.

Use case examples

Build an automated responder that handles common questions instantly.
  1. Subscribe to message:received:new
  2. Parse the incoming message text for keywords
  3. Send an appropriate reply using POST /chats/{id}/messages
  4. Escalate complex queries by assigning the chat to a human agent
Keep your CRM updated the moment a conversation happens.
  1. Subscribe to message:received:new and chat:created
  2. On new chat — create a lead/contact in your CRM
  3. On new message — log the interaction as an activity
  4. Use chat assignment events to sync agent ownership
Alert your team in Slack, Teams, or email when important events happen.
  1. Subscribe to message:received:new and chat:assigned
  2. Filter events by label or content keywords
  3. Forward the notification to Slack, Teams, or a custom dashboard
  4. Monitor WhatsApp account events to alert admins about disconnections
Track message delivery rates and response times.
  1. Subscribe to message:sent:new to track outgoing deliveries
  2. Subscribe to message:received:new to measure response times
  3. Aggregate data to build delivery rate dashboards
  4. 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

Retry policy

If your endpoint returns a non-2xx status or the request times out, Timelines Global retries the delivery 2 additional times (3 attempts total). If all attempts fail, the webhook’s errors_counter increments.

Best practices

  • Respond immediately — return 200 first, then process the event asynchronously
  • Handle duplicates — use message_uid to deduplicate events that may be delivered more than once
  • Monitor errors — check errors_counter on 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
If your endpoint consistently fails, Timelines Global will notify the workspace owner via email. Fix endpoint issues promptly to avoid missing events.

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