---
url: https://docs.seen.io/api/guides/braze.md
description: >-
  Send user data from Braze to Seen for video generation, then use a data
  transformation to receive the player link and thumbnail back into Braze.
---

# Braze

::: info
In the following example, we will be sending user data to Seen for video generation, and receiving a unique video player link and personalised email thumbnail back to Braze for distribution. This example uses a POST webhook in Braze to send data to Seen, a POST webhook in a Seen Project, and data transformation to receive the data back into Braze.

If you have multiple video campaigns with Seen, repeat the process to connect Braze with all video campaigns. You can reach out to your Customer Success Manager at Seen for assistance.

A Project needs to be created and published in Seen Platform prior to setting up the integration.
:::

## Send data to Seen

1. Create a new [Webhook Campaign](https://www.braze.com/docs/user_guide/message_building_by_channel/webhooks) in Braze.
2. Give your campaign a name, and follow these steps to compose your webhook:
   * **Webhook URL**
     ```
     https://next.seen.io/v1/projects/{{project_id}}/data
     ```
     You can find your endpoint in the Run tab of your Seen Platform project.
   * **HTTP Method** = `POST`
   * **Request body** = **Raw Text**. Use the code below as a starting point (see [Create Data](/api/create-data) for the payload structure):
     ```json
     {
       "first_name": "{{${first_name}}}",
       "last_name": "{{${last_name}}}",
       "id": "{{${braze_id}}}"
     }
     ```
     Remember to modify the payload depending on the personalisations in your video.
   * **Request headers**

     * `Authorization` → `Bearer {token}`
     * `Content-Type` → `application/json`

     You can create an [API token](/api/authorization) in your Seen Platform Workspace settings.
3. You can now test the webhook with a user by switching to the **Test** tab.
4. If everything works as intended, you can proceed to finish the webhook setup.

## Set up your Project Webhook in Seen Platform

1. Navigate to your Project.
2. Click **Add webhook**.
3. Configure your webhook (see [Webhook](/api/webhook) for the full configuration).

## Receive data back from Seen

1. Create new [Custom Attribute](https://www.braze.com/docs/user_guide/data_and_analytics/custom_data/custom_attributes/#blocklisting) fields for "player\_url" and "email\_thumbnail\_url". These are the two attributes we will be using in this example.
2. Open **[Data Transformation](https://www.braze.com/docs/user_guide/data_and_analytics/data_transformation/creating_a_transformation/#prerequisites)** under **Data Settings**, and click on **Create transformation**.
3. Give your transformation a name, and choose:
   * **Start from scratch**
   * Destination → POST: Track users
4. Add your Braze Webhook URL to your Seen Project Webhook. Use the payload below as a starting point for the Seen webhook body. Replace the `{{ }}` placeholders with the dynamic output references available in the Seen webhook editor:
   ```json
   {
     "id": "{{ id }}",
     "player_url": "{{ Player link }}",
     "email_thumbnail_url": "{{ Email thumbnail link }}"
   }
   ```
5. Use the code below as the starting point for the Braze transformation:
   ```javascript
   let brazecall = {
     "attributes": [
       {
         "braze_id": payload.id,
         "_update_existing_only": true,
         "player_url": payload.player_url,
         "email_thumbnail_url": payload.email_thumbnail_url
       }
     ]
   };
   return brazecall;
   ```
6. Send a test payload to the provided endpoint. If you want to use the payload defined in this example, you can send this yourself via [Postman](https://www.postman.com/) or another similar service:
   ```json
   {
     "id": "101",
     "player_url": "https://player.seen.io/v/AhdlZ6Qq28LDQAptGHUY",
     "email_thumbnail_url": "https://motions.seen.io/298abdcf-1f0f-46e7-9c26-a35b4c1e83cc/d3c1dffdf063986ad521a63e3e68fd7d1100c90a/email_thumbnail.jpg"
   }
   ```
7. Click **Validate** to make sure everything works as intended.
8. If everything worked as intended, click **Save** and **Activate**.
