Push notifications
Overview
For Web Chat, you can implement custom push notifications by using Webhooks within the Conversation API. This functionality enables you to notify end users when a live agent joins their conversation and begins responding.
When Ada emits conversation events (e.g., v1.conversation.message), your webhook receives them. Your backend looks up the recipient device tokens for the event’s end_user_id, then calls your push provider (APNs, FCM) to deliver a notification.
High-level flow:
- Subscribe to webhooks in the Ada dashboard.
- Map
conversation_id→ device token in your system. - Process webhook events and extract message and
conversation_id. - Send a push via APNs/FCM to the mapped device(s).
Limitations
Push notifications have the following limitations:
- End users must keep the Web Chat interface open to receive notifications. If end users close or exit the chat window, they do not receive notifications.
- Mobile push notification support is not available at this time.
Use cases
Push notifications help you keep end users informed about their conversations.
- Agent join alerts: Notify end users when a live agent joins their conversation and begins responding.
- Message notifications: Alert end users to new messages when they have minimized the chat window.
Capabilities & configuration
Push notifications require Webhooks integration and device token management.
- Webhook subscriptions: Subscribe to Conversation API events (e.g.,
v1.conversation.message) to receive real-time updates. - Device token mapping: Maintain a mapping between Ada’s
conversation_idand end user device tokens. - Push provider integration: Connect to APNs (iOS), FCM (Android), or browser push (VAPID) to deliver notifications.
Implementation & usage
Set up push notifications for your Chat integration.
Step 1: Configure webhooks
Set up Webhooks to receive conversation events from Ada.
To configure webhooks:
- On the Ada dashboard, go to Config > PLATFORM > Webhooks.
- Create a POST endpoint, e.g.
https://your-api.example.com/ada/webhooks. - Subscribe to conversation events, at minimum:
v1.conversation.message.
Step 2: Set up device mapping
From the end user device, you need to obtain the conversation_id and the device token.
To obtain the conversation_id, subscribe to one of the events offered in the SDK API Reference that return the conversation_id. The following events are recommended:
ada:agent:joinedada:minimize_chat
Maintain a persistent mapping so you can reach the end user’s devices when you have Ada’s conversation_id.
Keys: conversation_id (Ada’s Conversation Identifier) and device_token
Recommended table (example):
Collecting device tokens:
- Mobile apps: Request notification permission at a sensible moment, then register token on login or app launch.
- Web: Use browser push (VAPID) if applicable.
- On logout/uninstall: Mark tokens as revoked; periodically clean stale tokens.
Step 3: Handle webhook events
Process Webhook events from the Conversation API.
Event of interest: v1.conversation.message
Example payload (illustrative):
Processing steps:
- Verify webhook authenticity.
- Parse
conversation_id,message.text, and any metadata you want in the push. For messages sent by an agent, clients can filter by therole: "human_agent". - Fetch device tokens for
conversation_id. - Fan-out a notification per active device token.
Code example
The following Python (FastAPI) example demonstrates APNs integration:
Related features
- Chat onboarding: Get started with Chat.
- Webhooks: Configure webhook subscriptions.
- Conversation API: Learn about conversation events.
- Handoffs: Configure handoffs to human agents.