> ## Documentation Index
> Fetch the complete documentation index at: https://moengage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Regal

# Introduction

[Regal](https://www.regal.io/) has built an event-driven customer engagement platform that enables brands’ sales teams to communicate with their customers through branded calls and SMS.

# MoEngage × Regal

The MoEngage and Regal integration offers a powerful combination of insights-led customer engagement and outbound phone & SMS sales platform. This integration is designed to fulfill the following use cases:

* Create contacts in Regal when an event is captured in MoEngage
* Update user properties like opt-in information on Regal when MoEngage capturs this information
* Forward events captured in MoEngage to Regal as custom events

# Integration

<Info>
  **Prerequisites**

  * You would need your Regal [API Key](https://developer.regal.io/reference/overview#authentication) to get started.
</Info>

The Regal Voice API is designed as a single Custom Events endpoint that lets you creates a contact, update a contact or add a custom event to a contact’s profile.

## Step 1: Setup Connector Campaign on MoEngage

To create a connector campaign on MoEngage,

1. Navigate to Create Campaign >> Connectors >> Custom and choose the delivery type most suitable to your needs

<img src="https://mintcdn.com/moengage/7iGV38YjgdBKSU0B/images/partner_23080439134996.png?fit=max&auto=format&n=7iGV38YjgdBKSU0B&q=85&s=66ba71a2a776250839c11a838d6f3c04" alt="Screenshot_2022-02-21_at_10.48.46_PM.png" width="1104" height="1238" data-path="images/partner_23080439134996.png" />

2. On step 2 of the campaign

### Call the Regal Custom Events API

To create a new contacts on Regal, use the `POST` method and configure the payload.

* Select the method as POST
* Headers:
  * `Authorization`: `<your_regel_api_key>`
  * `Content-Type`: `application/json`
* Add the endpoint as Webhook URL: `https://events.regalvoice.com/events`
* Body:

<Tabs>
  <Tab title="Create contact">
    ```json theme={null}
    {
          "userId": "{{UserAttribute['ID']}}",
          "traits": {
                "phones": {
                      "{{UserAttribute['Mobile Number (Standard)']}}": {}
                },
                "firstName": "{{UserAttribute['First Name']}}",
                "lastName": "{{UserAttribute['Last Name']}}"
          },
          "eventSource": "MoEngage"
    }
    ```
  </Tab>

  <Tab title="Update user">
    ```json theme={null}
    {
          "userId": "{{UserAttribute['ID']}}",
          "traits": {
                "phones": {
                      "{{UserAttribute['Mobile Number (Standard)']}}": {
                            "isPrimary": true,
                            "voiceOptIn": {
                                  "subscribed": true
                            },
                            "smsOptIn": {
                                  "subscribed": true
                            }
                      }
                }
          }
    }
    ```
  </Tab>

  <Tab title="Create custom event">
    ```json theme={null}
    {
          "userId": "{{UserAttribute['ID']}}",
          "name": "Course Purchased",
          "properties": {
                "course_title": "{{EventAttribute['Title']}}",
                "course_amount": "{{EventAttribute['Amount']}}",
                "course_start": "{{EventAttribute['Start date']}}"
          },
          "eventSource": "MoEngage"
    }
    ```
  </Tab>
</Tabs>

<img src="https://mintcdn.com/moengage/7iGV38YjgdBKSU0B/images/partner_23080756563732.png?fit=max&auto=format&n=7iGV38YjgdBKSU0B&q=85&s=cfc65188c6392a31ed5b7d33bc60d22c" alt="" width="2638" height="1336" data-path="images/partner_23080756563732.png" />

* Refer to the [Regal documentation](https://developer.regal.io/reference/overview) for more information.

## Preview your request

At this point, your campaign should be ready to test and send. You can also test your connector configuration using the Test functionality available in Step 2 of Create Connector Campaign.<img src="https://mintcdn.com/moengage/7iGV38YjgdBKSU0B/images/partner_23080439161236.png?fit=max&auto=format&n=7iGV38YjgdBKSU0B&q=85&s=bbfc44c7e71b08ef4a0e97469611d24c" alt="Screen_Shot_2022-02-22_at_11.12.42_AM.png" width="2464" height="270" data-path="images/partner_23080439161236.png" />

You can go ahead and Publish the campaign.
