curl --request POST \
--url https://api-{dc}.moengage.com/v1/integrations/cohortsync \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'MOE-APPKEY: <moe-appkey>' \
--data '
{
"action": "add_members",
"partner": "6HNBXFm7ZS",
"parameters": {
"cohort_name": "Partner_Name",
"cohort_id": "JKTAuqTRhC",
"cohort_description": "A cohort of users from a partner.",
"members": [
{
"uid": "mm1UR87z4T"
},
{
"uid": "AtCxliflui"
}
]
}
}
'{
"status": "success",
"message": "Your request has been accepted and will be processed soon."
}Sync Cohort Members
This API adds or removes a list of users from a custom segment (cohort) in MoEngage.
POST
/
v1
/
integrations
/
cohortsync
curl --request POST \
--url https://api-{dc}.moengage.com/v1/integrations/cohortsync \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'MOE-APPKEY: <moe-appkey>' \
--data '
{
"action": "add_members",
"partner": "6HNBXFm7ZS",
"parameters": {
"cohort_name": "Partner_Name",
"cohort_id": "JKTAuqTRhC",
"cohort_description": "A cohort of users from a partner.",
"members": [
{
"uid": "mm1UR87z4T"
},
{
"uid": "AtCxliflui"
}
]
}
}
'{
"status": "success",
"message": "Your request has been accepted and will be processed soon."
}- The Cohort Sync API only matches users already present in MoEngage based on the User ID (
uid) provided in the request. This API does not create new users. - This API endpoint does not currently support Team-level scoping. All segments generated using this call will be assigned to the Default Team automatically.
- Please note that this API does not support updating cohorts created on the dashboard or via File Segment API.
Rate Limits
Please adhere to the following limits:- Frequency: 300 requests per minute.
- Payload Structure: One payload per request (each payload can contain multiple UIDs).
- Size Limit: The payload size cannot exceed 128KB.
User Resolution
The Cohort Sync API resolves existing users in MoEngage based on predefined user identifiers:- Identifier: We primarily rely on the User ID (
uid) provided in the request payload. - Matching: This must match the Unique User ID set in MoEngage (typically available for registered or logged-in users).
- Profile Association: Each Unique User ID corresponds to a single user profile. Even if a user is logged in across multiple devices, the devices are associated with that single user profile.
Cohort Size Limits
A cohort you sync through this API is a custom segment, which is a type of file segment. Each segment supports up to 5 million users. MoEngage stops updating a segment once it exceeds 10 million users.Segment Archival
Cohorts you sync through this API follow the same lifecycle as file segments:- MoEngage automatically archives a segment after 60 days of inactivity.
- You cannot unarchive a segment created through Cohort Sync.
Authorizations
Authentication is done via Basic Auth. This requires a base64-encoded string of your credentials in the format 'username:password'.
- Username: Use your MoEngage workspace ID (also known as the App ID). You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).
- Password: Use your API Key, which you can find within the Data tile.
For more information on authentication and getting your credentials, refer here.
Headers
Body
application/json
The cohort details and the members to add or remove.
Response
Success. This response is returned when the request is processed successfully.