Skip to main content

Introduction

A config (or config file) defines each connector in the Connected Channel. While adding a new Connector or making changes to the existing ones, you must upload the config file to ensure the Connector is configured correctly.

Sample files

You can download these sample config files to get started:

Config Sections

A config file is divided into the following sections:

File Format

The following is the file format of the config file: kkk

Basic Info

In this section, you must define the name of your Connector and the use case it aims to solve.

Input Variables

Input variables enable the rendering of input fields on the App marketplace. They facilitate the collection of required information necessary to successfully connect MoEngage to your app and effectively execute campaigns through it. To define an Input Variable, you must add the following to your input_variables section: In addition to the required keys above, the following optional keys are supported across all input types to enhance the UI and data handling:

Visibility Scope

The Input Variables are collected in the following places:
  • App Marketplace
  • Campaign Creation Form (Step 2)

App MarketPlace

Connections to your Channel App are added from the App marketplace, as shown below: In the App marketplace, you must collect fields that serve as authentication requirements or are common to all campaigns. These fields must be independent of campaign information. For example, collecting the Telegram Bot ID in the App marketplace is recommended. This allows you to execute multiple campaigns using the same Telegram Bot. On the other hand, collecting Telegram Chat IDs in the App marketplace is not recommended, as they are campaign-dependent and must be changed for each end-user.
MoEngage displays the Connection name for each Connector in the App marketplace by default. This provides a visual identifier to distinguish the Connections.

Campaign Creation Form (Step 2)

Connections to your Channel app are added from the campaign creation, as shown below:

Supported Input Types

All input types are available in the App marketplace and the campaign creation form (Step 2).
MoEngage currently supports the following input types:

Text

This input type allows users to enter any basic text or string value. It is displayed on the UI as a simple single-line text box, making it useful for soliciting short, free-text input, such as usernames or email addresses. To add a Text, follow the structure:

Rich-Text (HTML)

Rich-Text is not a separate input type. It is a formatting mode available on the Text input type for fields used in message content. HTML support is a workspace-level feature and is not toggled via the config file. Contact support to get this enabled for your workspace. Once enabled, Text fields used in message content accept standard HTML tags. All HTML tags are supported except <script>, which is disallowed. To use Rich-Text, follow the Text structure:
Nested tags are supported. For example, <b><i>Text</i></b> renders as bold italic text.
Unsupported tags are automatically stripped from the value before the request is sent, and the user is shown a warning notification on the UI at the time of input.
The following HTML elements are prohibited and intercepted during Step 2 validation:
  • <script>
  • <iframe>
  • <style>
  • <object>
  • <applet>
  • <meta> — carries a risk of unauthorized refresh redirection via http-equiv="refresh".
  • <base> — poses a vulnerability for manipulating relative link paths.
  • <svg> elements that contain nested <script> blocks.
  • All inline event handlers (such as onclick, onerror, onload, and onmouseover), even when appended to generally permitted elements like <img> or <a>.
  • javascript: protocol links implemented within an <a href="javascript:...">.
Tags omitted from this index clear UI validation during the second phase of campaign creation. However, this status only confirms that the form-level sanitizer does not explicitly block them. It provides no guarantee about how downstream client applications (such as Telegram) interpret, escape, or display them, nor does it guarantee that dynamic attributes (like onclick or onerror) are removed before payload transmission. Always validate end-to-end rendering behavior on your target channel before deploying these tags in live production campaigns.
Example of user input in a Connected App:

Number

This input type is for numbers. It appears as a text box but only accepts numerical entries. Use it when collecting numeric values, such as age, ID, or quantity. To add a Number, follow the structure:
You can use validations to restrict the lower and upper bounds of the numeric input if required.

Boolean

This input type appears as a radio button and allows users to choose between two mandatory possibilities: True or False. It is used when you ask users to enable/disable a feature, agree/disagree, or make any binary choice. To add a Boolean, follow the structure:

DateTime

This input type is for date and time. It appears as a DateTime picker, allowing users to select a specific date and time. Use it when collecting data about a specific date or time, such as scheduling posts or reminders. To add a DateTime, follow the structure:

Password

This input type is for password entry. It appears as a text box but masks user input for privacy. It must be used when requesting sensitive information from users, such as login addresses. To add a Password, follow the structure:
This input type allows users to choose multiple options in multi-select mode. It is recommended when you have a predetermined set of options and prefer to restrict input without allowing free-text entry. To add a Drop-down List, follow the structure:

Hash Maps

This input type is used for key-value pair inputs. It renders as a dynamic UI section where users can add, edit, and delete rows of key-value pairs. Use this when you require variable, user-defined data, such as button labels and URLs, or custom metadata. If your config file contains more than one input variable with "type": "key_value", each is rendered as its own independent UI section, with its own header, help text, and set of rows. Hash Maps input rendered as key and value input boxes To add a Hash Map, follow the structure:

UI Behavior

Example Scenario

Two key_value input variables in the same config file:
This renders as two separate sections — Call to Action Buttons (visible, required) and Additional Data (hidden, optional but still submitted with whatever default value is set).

Output Format

When the form is submitted, MoEngage passes the value of a key_value field as an array of row objects:
Reference a key_value field in your request body the same way you reference any other input variable using JINJA, but note that the value resolves to an array, not a single string. You typically iterate over it when constructing your body.

Input Validations

When defining input types that support validation, such as Text and Password, it is necessary to establish predetermined rules for validating the values entered by the user on the UI. You can add validations with the following key inside your input variables:
Here is an example of a Full Name field which has three individual rules:
Each of these rules is shown to the user on the UI to guide them toward valid input:

Reference Input Variables

After collecting values for your Input Variables from the user, you can use them in the following sections:
  • Authentication
  • Request and Response
You can use the JINJA code to reference an input variable. This referencing mechanism is similar to personalization in MoEngage. For example, consider the following Input Variables:
  • From the App marketplace:
    Username: String
  • From the Campaign Creation Form (Step 2):
    Mobile Number: String
To reference these variables, use the following JINJA code:
These Input Variables capture the user’s input, which can be used during authentication or included as part of the API request payload.

Authentication

In this section, you can define the authentication required for your App. MoEngage enables sending requests to your App, and the Connected Channels support the following built-in authentication types:
  • No Auth
  • Basic Auth
  • API Key Auth
  • OAuth2

No Auth

You can choose No Auth when your App does not need authentication or you have a custom implementation of standard authentication methods. If you select No Auth, MoEngage does not execute any pre-authentication operations on your requests. When using “No Auth,” choose No Auth as the app type. If necessary, you can include custom URL parameters or headers for your API.
You must pass an empty object in the auth_info key, as no additional information is required for this app type.

Basic Auth

If your App supports Basic Auth, you can collect the username and password on the App marketplace and pass them as part of your Basic Auth Token for each request. To add Basic Auth, follow the structure:
In the example above, we refer to the values entered by the user on the App Marketplace form. MoEngage generates a Base64-encoded Basic Auth token and includes it in each request’s Authorization header. For example, if the Account ID is ABC123 and the Account Key is 123XYZ, you must pass the following header in each of our requests: Authorization: Basic QUJDMTIzOjEyM1hZWg==

OAuth2

If your App uses the OAuth2 framework for authorization, you can configure MoEngage to handle the entire flow, including obtaining user consent and managing access and refresh tokens.
MoEngage supports the following OAuth2 grant types:
  • Authorization Code
  • Refresh Token

Special Authentication Variables

MoEngage exposes a few special variables that can be referenced to support the OAuth2 mechanism within your App: You can reference the above variables when setting up your OAuth2 calls and connector requests. .

Redirect URI

The Redirect URI will depend on which Data Center your app is added to: If you want to list your app in all the data centers, you must approve each of the Redirect URIs.

Set up OAuth for your App

To add OAuth2, follow the structure:
The auth module for OAuth2 must have the following keys: To allow MoEngage to get consent and tokens from your application, configure the parameters for the following requests:

Authorization Request

Access Token Request

Refresh Token Request

Request and Response

In this section, you must set up the API requests that MoEngage initiates for each campaign sent. After a request is made from MoEngage, you can set up how the Campaign Stats are calculated based on your API requests’ responses.
MoEngage does not support stats that might be asynchronous or driven by callbacks today.

Campaign Requests

MoEngage attempts to send API requests to your App each time a campaign is sent out.
For example, if a campaign is directed to 50 users, MoEngage makes 50 API requests for that campaign.
  • Frequency Capping or Do-Not-Disturb (DND)
  • Throttling
  • Bulk API requests
  • Multiple API requests (Chained API requests)
To configure a response, add this to your config:

Request Format

The request format informs MoEngage about the request’s payload.

Response Handling

After making an API request, you can inform MoEngage how to interpret the response. You can also add multiple responses to your request by covering all your responses, such as successes and failures. A response consists of two parts:
  • Response conditions: Based on the response provided by your API, you can add conditions to its Status Code, Header Values, or even the body payload. When these conditions are fulfilled, you can perform actions in MoEngage.
  • Response actions: Actions are operations performed by MoEngage.

Use Cases

There are several use cases for response handling. The following are the types of tracking used for various use cases:
  • Stats tracking: This displays accurate Success and Failed stats for your campaigns.
  • Event tracking: These are trigger events that occur when certain conditions are fulfilled. They can help you to create other journeys for your users.

Add a Response

To add a response, follow the structure:

Response Conditions

Here, you can include multiple conditions for each response, combining both AND and OR operators. If you have prior experience with MoEngage Segmentation, you can leverage that. The following is to add a new condition:
Each condition is called a Filter in MoEngage. The following conditions function similarly to our segmentation filters: Below is an example of evaluation criteria to check if the API’s Response Status Code is 200 and if it returns {"ok": true} in the payload:
You are allowed to create conditions customized for your App. The accuracy of these conditions directly influences MoEngage’s ability to trigger events and display statistics effectively.

Response Actions

Here, you can have MoEngage perform actions based on the above-mentioned conditions. Currently, MoEngage supports the Create Event actions.

Create Event

These tracks use cases like Messages sent, Users synced, and so on. With this action, you can use MoEngage to trigger an event. Below is the structure to add an Event for your response:
To ensure accurate calculation of your Campaign Stats, specifically for Sent and Failed events, the following two events must be added as part of your Actions:
  • Connected App Campaign Sent
  • Connected App Campaign Failed
MoEngage also includes the following default standard event attributes to facilitate better tracking for users.

Upload the Config File

After you are ready with your configuration file, refer here to upload it to your Connected App on the App marketplace.