# MoEngage

> Create and update MoEngage users, track their events, build segments, send push notifications and API-triggered messages, manage campaigns, flows and email subscriptions, and follow new and sent campaigns, flows and segments.

App · 21 actions. Web page: https://docs.lodol.com/docs/integrations/moengage

## Actions

### Change campaign status

Stop a one-time campaign, pause or resume a periodic or event-triggered one, or publish an API-triggered one.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.
- Action (`change`, text, required): What to do. Stop works on one-time and API-triggered campaigns, Pause and Resume on periodic and event-triggered ones, and Publish on an API-triggered draft. One of: `PUBLISH` (Publish (API-triggered campaigns)), `STOP`, `PAUSE`, `RESUME`.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": {
      "action": "example",
      "id": "example"
    },
    "response_id": "example",
    "type": "example"
  }
}
```

### Change flow status

Pause, resume, stop, retire, archive or unarchive a flow.

**Inputs**

- Flow (`flow_id`, text, required): The flow.
- Action (`change`, text, required): What to do with the flow. One of: `pause`, `resume`, `stop`, `retire`, `archive`, `unarchive`.
- Updated by (`updated_by`, text, required): Your email address, recorded in MoEngage's audit log as who made the change.
- Version (`version_no`, number): The flow version to pause, resume, stop or retire. Leave empty for the active version. At least 1.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": {
      "flow_id": "example",
      "status": "example"
    },
    "response_id": "example",
    "type": "example"
  }
}
```

### Create or update user

Add a user to MoEngage, or update the one with this customer ID. Only the attributes filled in change.

**Inputs**

- Customer ID (`customer_id`, text, required): The user's ID in MoEngage (the ID attribute you set for them, such as your own customer number).
- Email (`email`, text): The user's email address.
- First name (`first_name`, text): The user's first name.
- Last name (`last_name`, text): The user's last name.
- Full name (`full_name`, text): The user's full name.
- Mobile number (`mobile`, text): The user's mobile number with the country code, such as 918888444411.
- Birthday (`birthday`, date): The user's date of birth.
- Email opt-in status (`email_opt_in_status`, text): The user's email opt-in status. One of: `DOUBLE_OPTED_IN` (Double opted in), `OPTED_OUT` (Opted out), `OPT_IN_PENDING` (Opt-in pending).
- Unsubscribed from email (`email_unsubscribed`, true/false): Turn on to stop MoEngage emailing this user; turn off to let it email them again.
- Other attributes (`other_attributes`, object): Other user attributes to set, by their name in MoEngage, such as plan or loyalty_points. Names can't start with moe_.
- Attributes to clear (`unset_attributes`, list): Names of attributes to clear from the user's profile.
- Only update existing users (`update_existing_only`, true/false): Turn on to only update a user who already exists, never create one.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "message": "example",
    "status": "example"
  }
}
```

### Create segment

Create a custom segment of the users whose attribute matches any of some values, such as plan is Gold or Platinum.

**Inputs**

- Name (`name`, text, required): The segment's name. It must be unique in the workspace.
- User attribute (`attribute`, text, required): The user attribute to match, by its name in MoEngage, such as plan or city.
- Match (`match`, text): How the attribute is compared with the values. Leave empty for Is any of. One of: `in` (Is any of), `containsInTheFollowing` (Contains any of), `startsWithInTheFollowing` (Starts with any of), `endsWithInTheFollowing` (Ends with any of). Default: `in`.
- Values (`values`, list, required): The values to match. A user who matches any of them is in the segment.
- Case sensitive (`case_sensitive`, true/false): Match upper and lower case exactly.
- Attribute category (`category`, text): The attribute's group in MoEngage. Leave empty for Tracked Custom Attribute, the group of attributes you send.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": {
      "created_time": "example",
      "description": "example",
      "id": "example",
      "included_filters": {
        "filter_operator": "example",
        "filters": [
          {
            "case_sensitive": true,
            "category": "example",
            "data_type": "example",
            "filter_type": "example",
            "name": "example",
            "negate": true,
            "operator": "example",
            "value": [
              "example"
            ]
          }
        ]
      },
      "name": "example",
      "source": "example",
      "type": "example",
      "updated_time": "example"
    },
    "response_id": "example",
    "type": "example"
  }
}
```

### Delete user

Delete a user from MoEngage. MoEngage deletes them for good after 24 hours.

**Inputs**

- Find user by (`identity_type`, text): What the user is identified by. Leave empty for customer ID. One of: `customer_id` (Customer ID), `moengage_id` (MoEngage ID). Default: `customer_id`.
- User (`identity_value`, text, required): The user's customer ID or MoEngage ID, matching Find user by.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "message": "example",
    "status": "example"
  }
}
```

### Get campaign

Get a push or email campaign's details: name, channel, status, delivery type, content and schedule.

**Inputs**

- Campaign (`campaign_id`, text, required): The campaign.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": {
      "basic_details": {
        "name": "example",
        "tags": [
          "example"
        ],
        "team": "example"
      },
      "campaign_delivery_type": "example",
      "campaign_id": "example",
      "channel": "example",
      "created_at": "example",
      "created_by": "example",
      "id": "example",
      "sent_time": "example",
      "status": "example",
      "updated_at": "example",
      "updated_by": "example"
    },
    "response_id": "example",
    "type": "example"
  }
}
```

### Get flow

Get a flow's details: status, entry type, versions, settings and goals.

**Inputs**

- Flow (`flow_id`, text, required): The flow.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": {
      "active_version_name": "example",
      "archived": true,
      "created_at": "example",
      "created_by": "example",
      "delivery_type": "example",
      "flow_id": "example",
      "name": "example",
      "published_at": "example",
      "published_by": "example",
      "status": "example",
      "tags": [
        "example"
      ],
      "updated_at": "example",
      "versions": [
        {
          "status": "example",
          "version_id": "example",
          "version_name": "example",
          "version_no": 1
        }
      ]
    },
    "response_id": "example",
    "type": "example"
  }
}
```

### Get segment

Get a custom segment's name, conditions and when it was created and changed.

**Inputs**

- Segment (`segment_id`, text, required): The custom segment.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": {
      "created_time": "example",
      "description": "example",
      "id": "example",
      "included_filters": {
        "filter_operator": "example",
        "filters": [
          {
            "case_sensitive": true,
            "category": "example",
            "data_type": "example",
            "filter_type": "example",
            "name": "example",
            "negate": true,
            "operator": "example",
            "value": [
              "example"
            ]
          }
        ]
      },
      "name": "example",
      "source": "example",
      "type": "example",
      "updated_time": "example"
    },
    "response_id": "example",
    "type": "example"
  }
}
```

### Get subscription preferences

Get which email subscription categories a user is in, and whether they have unsubscribed from all email.

**Inputs**

- Find user by (`identify_by`, text): What the user is looked up by. Leave empty for email address. One of: `email` (Email address), `uid` (User ID (customer ID)), `moe_user_id` (MoEngage ID). Default: `email`.
- User (`user`, text, required): The user's email address, customer ID or MoEngage ID, matching Find user by.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": {
      "categories": [
        {
          "channel": "example",
          "display_name": "example",
          "group": "example",
          "name": "example",
          "status": "example"
        }
      ],
      "is_globally_unsubscribed": true,
      "user_id": "example"
    },
    "response_id": "example",
    "type": "example"
  }
}
```

### Get users

Get up to 20 users' profiles by customer ID, with the attributes you name.

**Inputs**

- Customer IDs (`customer_ids`, list, required): The users' customer IDs, up to 20.
- Attributes to return (`fields`, list): Attributes to return, by their name in MoEngage, such as first_name, email or customer_id. Leave empty for MoEngage's default set.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": {
      "users": [
        {
          "user_attributes": {}
        }
      ],
      "users_not_found": [
        {
          "identifier": "example",
          "identifier_type": "example"
        }
      ]
    },
    "status": "example",
    "type": "example"
  }
}
```

### List segments

List the workspace's custom segments, or find one by its exact name.

**Inputs**

- Name (`name`, text): Only the segment with exactly this name.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_time": "example",
        "id": "example",
        "name": "example",
        "source": "example",
        "type": "example"
      }
    ],
    "response_id": "example",
    "type": "example"
  }
}
```

### List subscription categories

List the email subscription categories users can subscribe to or leave, such as Newsletter or Promotional.

**Inputs**: None.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "channel": "example",
        "description": "example",
        "display_name": "example",
        "group": "example",
        "name": "example",
        "status": "example"
      }
    ],
    "response_id": "example",
    "type": "example"
  }
}
```

### Merge users

Merge a duplicate user into another. The duplicate's events, attributes and devices move to the user kept.

**Inputs**

- Duplicate user (`merged_user`, text, required): The customer ID of the duplicate user, whose data moves and who is then deleted.
- User to keep (`retained_user`, text, required): The customer ID of the user to keep.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "operation": "example",
    "status": "example"
  }
}
```

### Search campaigns

Find push and email campaigns by name, channel, status, delivery type, tag or creation date, 15 at a time.

**Inputs**

- Name (`name`, text): Only campaigns whose name contains this text.
- Channels (`channels`, list): Only campaigns on these channels. One or more of: `EMAIL`, `PUSH`.
- Statuses (`statuses`, list): Only campaigns in these statuses. Drafts are found only when Draft is chosen. One or more of: `DRAFT`, `ACTIVE`, `SCHEDULED`, `PAUSED`, `SENT`, `SENDING`, `STOPPED`, `ARCHIVED`.
- Delivery types (`delivery_types`, list): Only campaigns sent in these ways. One or more of: `ONE_TIME` (One time), `PERIODIC`, `EVENT_TRIGGERED` (Event triggered), `BUSINESS_EVENT_TRIGGERED` (Business event triggered), `DEVICE_TRIGGERED` (Device triggered), `LOCATION_TRIGGERED` (Location triggered), `API_TRIGGERED` (API triggered).
- Tags (`tags`, list): Only campaigns with any of these tags.
- Created by (`created_by`, list): Only campaigns created by these people, by email address.
- Campaign IDs (`campaign_ids`, list): Only these campaigns, by ID.
- Created after (`created_from`, date and time): Only records created at or after this time.
- Created before (`created_to`, date and time): Only records created at or before this time.
- Include child campaigns (`include_child_campaigns`, true/false): Also find the campaigns inside flows and each run of a periodic campaign.
- Include archived (`include_archived`, true/false): Also find archived campaigns.
- Campaigns to return (`limit`, number): How many campaigns to return, up to 15. Leave empty for 15. From 1 to 15.
- Page (`page`, number): Which page of results to return, starting at 1. Leave empty for the first. At least 1.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": {
      "campaigns": [
        {
          "basic_details": {
            "name": "example",
            "tags": [
              "example"
            ],
            "team": "example"
          },
          "campaign_delivery_type": "example",
          "campaign_id": "example",
          "channel": "example",
          "created_at": "example",
          "created_by": "example",
          "id": "example",
          "sent_time": "example",
          "status": "example",
          "updated_at": "example",
          "updated_by": "example"
        }
      ]
    },
    "response_id": "example",
    "type": "example"
  }
}
```

### Search flows

Find flows (multi-step journeys) by name, status, entry type, tag or creation date, most recently changed first.

**Inputs**

- Name (`name`, text): Only flows whose name contains this text.
- Statuses (`statuses`, list): Only flows in these statuses. One or more of: `DRAFT`, `ACTIVE`, `SCHEDULED`, `PAUSED`, `STOPPED`, `COMPLETED`, `RETIRED`, `UNDER_REVIEW` (Under review), `REJECTED`.
- Entry types (`delivery_types`, list): Only flows users enter in these ways. One or more of: `ONE_TIME` (One time), `PERIODIC`, `ON_FLOW_EXIT` (When another flow ends), `EVENT_TRIGGERED` (Event triggered), `BUSINESS_EVENT_TRIGGERED` (Business event triggered).
- Tags (`tags`, list): Only flows with any of these tags.
- Teams (`teams`, list): Only flows of these teams. Needed when your workspace has teams turned on for flows.
- Created by (`created_by`, list): Only flows created by these people, by email address.
- Created after (`created_from`, date and time): Only records created at or after this time.
- Created before (`created_to`, date and time): Only records created at or before this time.
- Include archived (`include_archived`, true/false): Also find archived flows.
- Flows to return (`limit`, number): How many flows to return, up to 100. Leave empty for 20. From 1 to 100.
- Next page cursor (`cursor`, text): The next cursor from the last page, to read the next page.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": {
      "flows": [
        {
          "active_version_name": "example",
          "archived": true,
          "created_at": "example",
          "created_by": "example",
          "delivery_type": "example",
          "flow_id": "example",
          "name": "example",
          "published_at": "example",
          "status": "example",
          "tags": [
            "example"
          ],
          "updated_at": "example"
        }
      ],
      "has_more": true,
      "next_cursor": "example"
    },
    "response_id": "example",
    "type": "example"
  }
}
```

### Send API-triggered message

Send one user the message of an API-triggered campaign, filling in its personalization placeholders.

**Inputs**

- Campaign (`campaign_id`, text, required): The published API-triggered campaign to send.
- Recipient (`recipient`, text, required): The user to send to, by the identifier in Identify recipient by.
- Identify recipient by (`identifier_type`, text): How the recipient is identified: ID (their customer ID), MOENGAGE_ID, or the name of another identifier your workspace has turned on. Leave empty for ID. Default: `ID`.
- Personalization values (`personalization`, object): Values for the campaign's placeholders, by placeholder name.
- Locale (`locale_name`, text): The campaign's locale version to send, such as en_US. Leave empty for the default.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": {
      "campaign_id": "example",
      "recipient_count": 1
    },
    "response_id": "example",
    "type": "example"
  }
}
```

### Send push notification

Send a push notification now to one user or to a custom segment, on Android, iOS or the web.

**Inputs**

- Campaign name (`campaign_name`, text, required): The name of the campaign MoEngage records the send under; MoEngage asks for at least 5 characters. Reuse a name to group one-user sends into one campaign; for a segment it must be new.
- Platforms (`platforms`, list, required): The platforms to send on. One or more of: `ANDROID`, `IOS`, `WEB`.
- Send to (`audience`, text): Who to send to. Leave empty for one user. One of: `User` (One user), `Custom Segment` (A custom segment). Default: `User`.
- User (`customer_id`, text): When sending to one user: their customer ID.
- Segment (`segment_name`, text): When sending to a custom segment: the segment.
- Title (`title`, text, required): The notification's title.
- Message (`message`, text, required): The notification's text.
- On tap (`click_action`, text): What tapping the notification does on Android and iOS. Leave empty to open a deep link. One of: `deeplinking` (Open a deep link), `richlanding` (Open a web page), `navigation` (Open an app screen). Default: `deeplinking`.
- Open on tap (`click_target`, text): The deep link, web page address or app screen name that opens when the notification is tapped. Web push always opens a web page.
- Image URL (`image_url`, text): An image to show in the notification on Android and iOS.
- Web icon URL (`web_icon_url`, text): The icon to show in a web push notification. Needed when Platforms includes Web.
- Campaign tags (`tags`, list): Campaign tags to add, up to 5. Each must already exist in MoEngage.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": {
      "campaign_id": "example",
      "request_id": "example"
    },
    "response_id": "example",
    "type": "example"
  }
}
```

### Send test campaign

Send a test of a draft push or email campaign to email addresses or users you choose.

**Inputs**

- Draft campaign (`campaign_id`, text, required): The draft campaign to test.
- Channel (`channel`, text, required): The draft campaign's channel. One of: `EMAIL`, `PUSH`.
- Send test to (`recipients`, list, required): Who gets the test: email addresses for an email campaign, or users' customer IDs for a push campaign.
- Platform (`platform`, text): For a push campaign, the one platform to test. Leave empty to test every platform the draft has. One of: `ANDROID`, `IOS`, `WEB`.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": {
      "data": {},
      "message": "example"
    },
    "response_id": "example",
    "type": "example"
  }
}
```

### Track event

Record an event a user did, such as Purchase, with its attributes. Events can start MoEngage campaigns and flows.

**Inputs**

- Customer ID (`customer_id`, text, required): The user's ID in MoEngage (the ID attribute you set for them, such as your own customer number).
- Event name (`event_name`, text, required): The event's name, such as Purchase or Signed up. Names can't start with moe_.
- Event attributes (`attributes`, object): The event's attributes, such as price or product, by name.
- Event time (`event_time`, date and time): When the event happened. Leave empty for now.
- Platform (`platform`, text): Where the event happened. Leave empty if it didn't happen in an app or website. One of: `ANDROID`, `iOS`, `web`, `unknown`.
- App version (`app_version`, text): The version of the app the event happened in.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "message": "example",
    "status": "example"
  }
}
```

### Update segment

Change which users a custom segment holds, and rename it.

**Inputs**

- Segment (`segment_id`, text, required): The custom segment.
- New name (`name`, text): A new name for the segment. Leave empty to keep it.
- User attribute (`attribute`, text, required): The user attribute to match, by its name in MoEngage, such as plan or city.
- Match (`match`, text): How the attribute is compared with the values. Leave empty for Is any of. One of: `in` (Is any of), `containsInTheFollowing` (Contains any of), `startsWithInTheFollowing` (Starts with any of), `endsWithInTheFollowing` (Ends with any of). Default: `in`.
- Values (`values`, list, required): The values to match. A user who matches any of them is in the segment.
- Case sensitive (`case_sensitive`, true/false): Match upper and lower case exactly.
- Attribute category (`category`, text): The attribute's group in MoEngage. Leave empty for Tracked Custom Attribute, the group of attributes you send.
- Updated by (`updated_by`, text): Your email address, recorded as who changed the segment.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": {
      "created_time": "example",
      "description": "example",
      "id": "example",
      "included_filters": {
        "filter_operator": "example",
        "filters": [
          {
            "case_sensitive": true,
            "category": "example",
            "data_type": "example",
            "filter_type": "example",
            "name": "example",
            "negate": true,
            "operator": "example",
            "value": [
              "example"
            ]
          }
        ]
      },
      "name": "example",
      "source": "example",
      "type": "example",
      "updated_time": "example"
    },
    "response_id": "example",
    "type": "example"
  }
}
```

### Update subscription preferences

Subscribe a user to email categories, take them out of some, or unsubscribe them from all email. MoEngage applies it within moments.

**Inputs**

- Find user by (`identify_by`, text): What the user is looked up by. Leave empty for email address. One of: `email` (Email address), `uid` (User ID (customer ID)), `moe_user_id` (MoEngage ID). Default: `email`.
- User (`user`, text, required): The user's email address, customer ID or MoEngage ID, matching Find user by.
- Subscribe to (`subscribe_to`, list): Categories to subscribe the user to.
- Unsubscribe from (`unsubscribe_from`, list): Categories to take the user out of.
- Unsubscribe from all (`unsubscribe_from_all`, true/false): Turn on to unsubscribe the user from every email category; the categories chosen are then ignored. Turn off to clear an earlier unsubscribe from all.

**Outputs**

- `data` (object): The response from MoEngage.

**Example output**

```json
{
  "data": {
    "data": {
      "message": "example"
    },
    "response_id": "example",
    "type": "example"
  }
}
```
