Skip to main content
PATCH
/
v3
/
custom-segments
/
{id}
Update Filter Segment
curl --request PATCH \
  --url https://api-{dc}.moengage.com/v3/custom-segments/{id} \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'MOE-APPKEY: <moe-appkey>' \
  --data '
{
  "name": "segment_example_name_updated",
  "included_filters": {
    "filter_operator": "and",
    "filters": [
      {
        "filter_type": "user_attributes",
        "name": "Name",
        "data_type": "string",
        "operator": "in",
        "value": [
          "chandan"
        ],
        "negate": false,
        "case_sensitive": false
      }
    ]
  },
  "updated_by": "admin@example.com"
}
'
{ "data": { "name": "your custom-segment name", "id": "your custom-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 Feb 15, 2023 and Feb 24, 2023", "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" }

Authorizations

Authorization
string
header
required

Basic Authentication using your Workspace ID (as username) and Data API Key (as password) from the MoEngage Dashboard.

Headers

MOE-APPKEY
string
required

The Workspace ID (APP ID) of your MoEngage account.

Path Parameters

id
string
required

The ID of the custom segment.

Body

application/json

The updated filter definition for the segment.

Request schema for updating an existing filter-based custom segment.

included_filters
object
required

The updated filtering criteria for the segment. Users satisfying this set of filters will be part of the segment.

name
string

A new unique name for the custom segment.

updated_by
string<email>

Email of the user performing the update (e.g., admin@companyemail.com).

Response

Custom segment updated successfully. Returns the updated segment details including the new filter definition and metadata.

Response schema for filter segment operations (create/update).

data
object

Information about the custom segment.

response_id
string

A unique identifier for this API response.

type
string

The type of resource referenced in the response.

Example:

"custom_segment"