Skip to main content

Triggering Retently Surveys from Braze via Webhook

Written by Alex Bitca

This guide explains how to connect Braze with Retently so that a transactional survey is automatically triggered whenever a specific event fires in Braze.


Overview

By connecting Braze to Retently using a webhook, you can trigger event-based surveys in real time, for example, sending an NPS or CSAT survey immediately after a purchase, or any other custom event.

The setup involves two steps:

  • Creating a transactional campaign in Retently and copying its webhook URL

  • Creating a webhook campaign in Braze that sends contact data to that URL when an event fires


Step 1: Create a Transactional Campaign in Retently

Start by setting up your survey campaign in Retently and generating the webhook URL that Braze will call.

  1. Go to the Campaigns page in Retently and create a new transactional email or in-app survey campaign.

  2. Assign a survey template and review the campaign settings.

  3. In the Trigger section, select "Generic Webhook" as the trigger service.

  4. A unique webhook URL will be generated. Copy this URL, as you will need it in the next step.

  5. Leave the campaign turned OFF for now and return to enable it once the full setup is complete.


Step 2: Create a Webhook Campaign in Braze

Accessing Webhooks

In Braze, navigate to Messaging > Campaigns, click Create Campaign, and select Webhook. Give your campaign a clear name, such as "Post-Purchase Retently Survey".

Building the Webhook

Open the Compose tab and fill in the following:

  • Webhook URL: Paste the Retently webhook URL copied in Step 1.

  • HTTP Method: Set to POST.

  • Request Body: Select JSON Key-Value Pairs and configure your contact data as described below.


Step 3: Configure the JSON Payload

Retently's Generic Webhook accepts a simple, flat JSON payload. All contact fields should be included as top-level keys with no nesting or wrapping objects.

Here is an example of a compatible payload:

{   
"email": "{{${email_address}}}",
"firstName": "{{${first_name}}}",
"lastName": "{{${last_name}}}",
"product": "{{custom_attribute.${product_type}}}"
}

Use Braze's Liquid syntax to dynamically populate values from the user profile.

Fields Retently Recognizes Automatically

These standard fields are picked up by Retently without any additional configuration:

  • email - the contact's email address

  • firstName - the contact's first name

  • lastName - the contact's last name

  • companyName - the contact's company name

  • tags - an array of tags to assign to the contact

Passing Custom Properties

To send additional data beyond the standard fields above:

  1. First create a matching custom property in Retently. The property name must exactly match the key used in your JSON payload.

  2. For a top-level property like orderDate, the custom property in Retently should be named orderDate.

  3. For a nested property like a price field inside a product object, the custom property in Retently should be named product.price.

Note: Keep your payload as flat as possible. When Retently receives data via the webhook, it prioritizes values found in nested objects over those in the parent object, which can lead to unexpected results if the same field appears in both places.

Request Headers

Add the following header in the Request Headers section:

  • Key: Content-Type / Value: application/json


Step 4: Set the Delivery Trigger

For event-based surveys, configure the campaign to use Action-Based Delivery and select the specific Braze event that should trigger the survey, such as "Completed Purchase" or "Onboarding Finished". You can also set the campaign duration and Quiet Hours as needed.


Step 5: Test and Launch

Before going live, use the Test tab to send a test webhook. You can test using a random user, a specific user by email or external ID, or a manually configured user. A dialog will display the server response, and any errors will include details to help you troubleshoot.

Once the test passes successfully:

  • Confirm all campaign settings in Braze

  • Return to Retently and turn the campaign ON

  • Launch the Braze campaign


Troubleshooting

  • Survey not triggered
    Confirm the Retently campaign is active and that the webhook URL is correctly pasted in Braze with no extra spaces or characters.

  • Contact is missing data fields
    Check that the field names in your payload match exactly what Retently expects.

  • Custom properties are not importing
    Make sure the custom property exists in Retently before sending data, and that its name exactly matches the key in your JSON payload, including letter case.

  • Webhook is returning errors
    Open the Braze Message Activity Log for error details. Confirm the Content-Type header is set to application/json and that your payload is valid JSON.

Did this answer your question?