Archive Segment
curl --request PATCH \
--url https://api-{dc}.moengage.com/v2/custom-segments/archive \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "custom_segment_unique_name",
"cs_id": "<unique cs id>"
}
'{
"message": "Successfully archived the custom segment",
"success": true,
"cs_name": "custom_segment_unique_name",
"cs_id": "<unique cs id>"
}{
"title": "Invalid Request",
"description": "<message>"
}{
"title": "Authentication required",
"description": "<message>"
}{
"title": "Entity Not Found",
"description": "Segment not found with the given name: <custom_segment_unique_name>"
}{
"title": "Internal Server Error"
}Archive Segment
This API archives an existing segment (File or Filter). Archiving and unarchiving through APIs makes it easy to retrieve and reuse segments whenever required for purposes such as A/B testing, maintaining regulatory compliance, and improving system performance. You can access the archived segments and utilize them to analyze and market campaigns without the need to recreate them from scratch.
PATCH
/
v2
/
custom-segments
/
archive
Archive Segment
curl --request PATCH \
--url https://api-{dc}.moengage.com/v2/custom-segments/archive \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "custom_segment_unique_name",
"cs_id": "<unique cs id>"
}
'{
"message": "Successfully archived the custom segment",
"success": true,
"cs_name": "custom_segment_unique_name",
"cs_id": "<unique cs id>"
}{
"title": "Invalid Request",
"description": "<message>"
}{
"title": "Authentication required",
"description": "<message>"
}{
"title": "Entity Not Found",
"description": "Segment not found with the given name: <custom_segment_unique_name>"
}{
"title": "Internal Server Error"
}Archived segments will not be shown beyond 180 days.
This API endpoint does not currently support Team-level scoping. All segments generated using this call will be assigned to the Default Team automatically.
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.
Body
application/json
The name of the segment to be archived.
Was this page helpful?