✨ MoEngage NEXT Spring 2026 — The Future of Engagement is Agentic. Join us on April 28. Register now
curl --request POST \
--url https://api-{dc}.moengage.com/v3/custom-segments \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'MOE-APPKEY: <moe-appkey>' \
--data '
{
"name": "segment_example_name",
"included_filters": {
"filter_operator": "and",
"filters": [
{
"filter_type": "user_attributes",
"name": "Name",
"data_type": "string",
"operator": "in",
"value": [
"Chandan",
"Kumar"
],
"negate": false,
"case_sensitive": false
}
]
}
}
'{
"data": {
"name": "segment name",
"id": "segment id",
"created_time": "2022-12-20T06:21:44.112000",
"updated_time": "2022-12-20T06:21:44.160000",
"type": "ELASTIC_SEARCH",
"source": "API",
"description": "Subscription Status 19Dec_7 is active (case insensitive) AND Has executed Email Sent atleast 1 time in-between Jan 05, 2021 and Jan 08, 2021",
"included_filters": {
"filter_operator": "and",
"filters": [
{
"filter_type": "user_attributes",
"name": "Subscription Status 19Dec_7",
"data_type": "string",
"operator": "in",
"value": [
"active"
],
"negate": false,
"case_sensitive": false
},
{
"filter_type": "actions",
"attributes": {
"filter_operator": "and",
"filters": []
},
"executed": true,
"primary_time_range": {
"type": "between",
"value": "2023-02-15T00:00:00.000Z",
"value1": "2023-02-24T23:59:59.999Z",
"value_type": "absolute",
"period_unit": "days"
},
"action_name": "MOE_EMAIL_SENT",
"execution": {
"count": 1,
"type": "atleast"
}
}
]
}
},
"response_id": "cNjnTEJw",
"type": "custom_segment"
}This API creates a new segment based on a set of filter conditions.
curl --request POST \
--url https://api-{dc}.moengage.com/v3/custom-segments \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'MOE-APPKEY: <moe-appkey>' \
--data '
{
"name": "segment_example_name",
"included_filters": {
"filter_operator": "and",
"filters": [
{
"filter_type": "user_attributes",
"name": "Name",
"data_type": "string",
"operator": "in",
"value": [
"Chandan",
"Kumar"
],
"negate": false,
"case_sensitive": false
}
]
}
}
'{
"data": {
"name": "segment name",
"id": "segment id",
"created_time": "2022-12-20T06:21:44.112000",
"updated_time": "2022-12-20T06:21:44.160000",
"type": "ELASTIC_SEARCH",
"source": "API",
"description": "Subscription Status 19Dec_7 is active (case insensitive) AND Has executed Email Sent atleast 1 time in-between Jan 05, 2021 and Jan 08, 2021",
"included_filters": {
"filter_operator": "and",
"filters": [
{
"filter_type": "user_attributes",
"name": "Subscription Status 19Dec_7",
"data_type": "string",
"operator": "in",
"value": [
"active"
],
"negate": false,
"case_sensitive": false
},
{
"filter_type": "actions",
"attributes": {
"filter_operator": "and",
"filters": []
},
"executed": true,
"primary_time_range": {
"type": "between",
"value": "2023-02-15T00:00:00.000Z",
"value1": "2023-02-24T23:59:59.999Z",
"value_type": "absolute",
"period_unit": "days"
},
"action_name": "MOE_EMAIL_SENT",
"execution": {
"count": 1,
"type": "atleast"
}
}
]
}
},
"response_id": "cNjnTEJw",
"type": "custom_segment"
}Documentation Index
Fetch the complete documentation index at: https://moengage-crashes-in-debug-feedback.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Authentication is done via Basic Auth. This requires a base64-encoded string of your credentials in the format 'username:password'.
For more information on authentication and getting your credentials, refer here.
This is the Workspace ID of your MoEngage account that must be passed with the request. You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).
The filter definition for the new segment.
Segment created successfully. Returns the newly created segment details including its unique ID, filter definition, and metadata.
Was this page helpful?