Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Frontline Conversations Webhooks


Twilio uses webhooks to let your application know when an event is happening. These webhooks allow you to monitor and intercept user actions in your own backend service.


Enable Conversations webhooks

enable-conversations-webhooks page anchor

To handle inbound conversations in Frontline, you need to enable two Conversations webhooks:

  • onConversationAdd
  • onParticipantAdded

onConversationAdd

onconversationadd page anchor

The onConversationAdd webhook is triggered before creating a conversation. This webhook can be used for setting the friendlyName and avatar for the conversation. This information is stored as attributes in the Conversation object.

Please refer to the following table for a detailed description of the Conversation resource attributes:

PropertyTypeDescription
friendlyNameString, optionalThe human-readable name of a conversation.
attributes.avatarString, optionalAn absolute URL to the conversation avatar image. A custom attribute defined by Twilio Frontline.

The onParticipantAdded webhook is triggered when a participant has joined a Conversation. This webhook can be used for setting the customer_id and optionally setting the avatar and display_name for customer participants. This information is stored as attributes in the Participant object.

Please refer to the following table for a detailed description of the Participant resource attributes:

PropertyTypeDescription
attributes.customer_idStringAn ID used to tie together a conversation participant and a customer in your system. A custom attribute defined by Twilio Frontline.
attributes.avatarString, optionalAn absolute URL to the participant's avatar image. A custom attribute defined by Twilio Frontline.
attributes.display_nameString, optionalThe participant's display name. A custom attribute defined by Twilio Frontline.

Configure Webhook URLs and filters

configure-webhook-urls-and-filters page anchor

Now, let's take a look at the configuration of the Conversations API Webhook.

Open your Twilio Console(link takes you to an external page) in a new browser. Click on Explore Products link in the left navigation pane and select Conversations product, then navigate to Manage > Global webhooks.

You should now see the Conversations API Webhook Configuration(link takes you to an external page) page.

Under the Webhook Target section, set the Pre-Event URL and Post-Event URL to target your ngrok URL.

Webhook URLs for pre-event and post-event with HTTP POST method selected.

Under the Webhook Filtering section, select the onConversationAdd and onParticipantAdded options.

Webhook filtering options with onConversationAdd and onParticipantAdded selected.

Click Save.

Now, you're all set with Conversations webhooks!

Take a look at the Conversations webhooks guide for more information.