Update target group

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
❗️

This API is being phased out and will no longer be available for creating new milestones.

To create a new milestone, use the Create a Loyalty Promotion API


This API allows you to update the details of the target group.

👍

Note

For detailed information about our APIs and for hands-on testing, refer documentation in API overview and step-by-step guide on making your first API call in Make your first API call .

Example request

curl --location --request PUT 'https://eu.api.capillarytech.com/v3/targetGroups/editTargetGroup/2514' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bWFYQ==' \
--header 'Cookie: _cfuvid=ly7YBnMo0mx_yhBSewFmnYXV.lO8A2xpiv65qMjy9nc-1759139789530-0.0.1.1-604800000' \
--data '{
    "id": 2514,
    "name": "Test Milestone UAT 23 July",
    // "fromDate": "2025-05-16",
    // "toDate": "2025-05-15",
    // "active": true,
    "preferredTillId": 75155297,
    // "periods": [
    //     {
    //         // "id": 22057,
    //         // "startDate": "2025-05-12",
    //         // "endDate": "2025-05-13",
    //         "refCode": "period44",
    //         "periodStatus": "RUNNING",
    //         "targetGroupId": 2139,
    //         "description": "p1",
    //         "active": true
    //     },
    //     {
    //         // "id": 22058,
    //         // "startDate": "2025-05-13",
    //         // "endDate": "2025-05-14",
    //         "refCode": "period45",
    //         "periodStatus": "NOT_STARTED",
    //         "targetGroupId": 2139,
    //         "description": "p1",
    //         "active": true
    //     }
    // ],
    // "streaks": [
    //     {
    //         "id": 1415,
    //         "targetGroupId": 18044,
    //         "name": "streakTest13test124",
    //         "targetCountOfSequence": 1
    //     },
    //     {
    //         "id": 1416,
    //         "targetGroupId": 18044,
    //         "name": "streakTestt13",
    //         "targetCountOfSequence": 2
    //     }
    // ],
    // "totalPeriods": 2,
    "description": "description update number 3",
    // "targetEvaluationType": "FIXED_CALENDAR_WINDOW",
    // "recurringCycles": 2,
    // "frequency": 2,
    // "targetCycleStartDate": "2025-05-15T00:00:00.000Z",
    // "targetCycleEndDate": "2025-05-15T23:59:59.000Z",
    // "trackingType": "NON_CONTINUOUS_STREAKS",
    "targets": [
        {
            "id": 2711,
    //         "name": "streaksnoncontTarget13",
    //         "emfRuleSetId": 1279391,
    //         "targetType": "COUNT",
    //         "targetEntity": "TRANSACTION",
    //         "eventName": "TransactionAdd",
    //         "targetGroupId": 18044,
            "description": "target level description update 1"//,
    //         "active": true,
            // "expression": "true",
            // "expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}"//,
    //         "filters": [],
    //         "enrolmentMethod": "TRANSACTION",
    //         "defaultValues": [
    //             {
    //                 "id": 39359,
    //                 "periodId": 22057,
    //                 "defaultValue": 1.000
    //             },
    //             {
    //                 "id": 39360,
    //                 "periodId": 22058,
    //                 "defaultValue": 1.000
    //             }
    //         ]
        }
    ]
}'

Prerequisites

  • Authentication: Basic or OAuth authentication
  • Default access group

Resource information

URIv3/targetGroups
HTTP methodPUT
PaginationNA
Rate limitNA
Batch supportNA

API endpoint example

https://eucrm.cc.capillarytech.com/v3/targetGroups/editTargetGroup/{targetGroupId}

Request path parameters

ParameterDescription
targetGroupIdIdentifier for the target group

Request body parameters

❗️

Attention

Only milestone name, expression and JSON expression parameters are editable.

ParameterData TypeDescription
idIntegerUnique target group identifier for the target group. This field is not editable.
nameStringName of the target group. <br><br> The character limit for the name is 200 characters.
fromDateDateStart date of the target group's active period.
toDateDateEnd date of the target group's active period.
activeBooleanStatus indicating if the target group is currently active.
preferredTillIdIntegerA reference ID for internal use, possibly related to prioritization.
periodsArrayA collection of periods within the target group.
-idIntegerUnique identifier for each period.
-startDateDateStart date of the period.
-endDateDateEnd date of the period.
-refCodeStringA reference code for the period.
-periodStatusEnumIndicates if the cycle of the Milestone is active/inactive. <br> Supported values: NOT_STARTED, RUNNING.
-targetGroupIdIntegerID of the target group to which the period belongs.
-descriptionStringDescription of the period.
-activeBooleanStatus indicating if the period is currently active.
streaksArrayA collection of streaks within the target group.
-idIntegerUnique identifier for each streak.
-targetGroupIdIntegerID of the target group to which the streak belongs.
-nameStringName of the streak.
-targetCountOfSequenceIntegerNumber of the times the user has to achieve the target to redeem the reward.
totalPeriodsIntegerThe total number of periods over which the tracking is evaluated.
descriptionStringDescription of the non-cont-streaks group.
targetEvaluationTypeStringThe evaluation strategy for the targets. Supported values: <br> FIXED_CALENDAR_WINDOW, CYCLIC_WINDOW, <br> PERIOD_AGNOSTIC_WINDOW
recurringCyclesIntegerNumber of recurring cycles.
frequencyIntegerFrequency of occurrence.
targetCycleStartDateDateTimeStart date and time of the target cycle.
targetCycleEndDateDateTimeEnd date and time of the target cycle.
targetCycleStartDateISOString

Defines the target’s start date in ISO 8601 format with the region offset.

For example:
The start date is at 14:30:45 on December 16, 2025, in India

Format for the request parameter:
2025-12-16T14:30:45+05:30

targetCycleEndDateISOString

Defines the target’s end date in ISO 8601 format with the region offset.

For example:
The start date is at 14:30:45 on December 16, 2025, in India

Format for the request parameter:
2025-12-16T14:30:45+05:30

targetsArrayA collection of targets within the target group.
-idIntegerUnique identifier for each target.
-nameStringName of the target.
descriptionStringDescription of the target.
-emfRuleSetIdIntegerRule set ID associated with the target.
-targetTypeEnumThe type of target. <br> Supported values: QUANTITY, SALES, COUNT, VISIT, GROSS_SALES, REGULAR_POINTS, PROMOTIONAL_POINTS, ALL_POINTS, EXTENDED_FIELD.
-targetEntityEnumThe KPI on which the target is tracked. <br> Supported values: Transaction, Lineitem, EVENT, REWARDS.
-eventNameStringThe behavioral name of the event that triggers the target.
-targetGroupIdIntegerID of the target group to which the target belongs.
-descriptionStringDescription of the target.
-expressionStringExpression defining the target condition.
-expressionJsonJSONJSON format of the expression defining the target condition.
-filtersArrayFilters applied to the target.
-enrolmentMethodStringMethod of enrolment for the target.
-defaultValuesArrayDefault values associated with periods for the target.
-idIntegerUnique identifier for each default value.
-periodIdIntegerID of the period to which the default value belongs.
-defaultValueDecimalDefault value for the period.

Request body

{
        "id": 18044,
        "name": "non-cont-streakTest13",
        "fromDate": "2024-02-19",
        "toDate": "2024-10-31",
        "active": true,
        "preferredTillId": 50698511,
        "periods": [
            {
                "id": 22057,
                "startDate": "2024-02-19",
                "endDate": "2024-11-17",
                "refCode": "period44",
                "periodStatus": "RUNNING",
                "targetGroupId": 18044,
                "description": "p1",
                "active": true
            },
            {
                "id": 22058,
                "startDate": "2024-11-18",
                "endDate": "2024-11-20",
                "refCode": "period45",
                "periodStatus": "NOT_STARTED",
                "targetGroupId": 18044,
                "description": "p1",
                "active": true
            }
        ],
        "streaks": [
            {
                "id": 1415,
                "targetGroupId": 18044,
                "name": "streakTest13test124",
                "targetCountOfSequence": 1
            },
            {
                "id": 1416,
                "targetGroupId": 18044,
                "name": "streakTestt13",
                "targetCountOfSequence": 2
            }
        ],
        "totalPeriods": 1,
        "description": "non-cont-streaks group",
        "targetEvaluationType": "FIXED_CALENDAR_WINDOW",
        "recurringCycles": 0,
        "frequency": 0,
        "targetCycleStartDate": "2024-02-19T00:00:00.000Z",
        "targetCycleEndDate": "2024-11-20T23:59:59.000Z",
        "trackingType": "NON_CONTINUOUS_STREAKS",
        "targets": [
            {
                "id": 33502,
                "name": "streaksnoncontTarget13",
                "emfRuleSetId": 1279391,
                "targetType": "COUNT",
                "targetEntity": "TRANSACTION",
                "eventName": "TransactionAdd",
                "targetGroupId": 18044,
                "description": "string",
                "active": true,
                "expression": "true",
                "expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
                "filters": [],
                "enrolmentMethod": "TRANSACTION",
                "defaultValues": [
                    {
                        "id": 39359,
                        "periodId": 22057,
                        "defaultValue": 1.000
                    },
                    {
                        "id": 39360,
                        "periodId": 22058,
                        "defaultValue": 1.000
                    }
                ]
            }
        ]
    
}

Example response

{
    "data": {
        "id": 2762,
        "attribution": {
            "createdOn": "2025-11-18T13:51:31.644+0000",
            "createdOnISO": "2025-11-18T13:51:31Z",
            "lastUpdatedOn": "2025-11-18T13:51:31.644+0000",
            "lastUpdatedOnISO": "2025-11-18T13:51:31Z",
            "lastUpdatedBy": {
                "id": 75152721,
                "code": null,
                "description": null,
                "name": null,
                "type": null
            },
            "createdBy": {
                "id": 75152721,
                "code": null,
                "description": null,
                "name": null,
                "type": null
            }
        },
        "orgId": 100737,
        "name": "uatTargetGroup80",
        "fromDate": "2025-05-11",
        "toDate": "2025-06-11",
        "active": true,
        "preferredTillId": 75155297,
        "periods": [
            {
                "id": 30148,
                "attribution": {
                    "createdOn": "2025-11-18T12:08:56.000+0000",
                    "createdOnISO": "2025-11-18T12:08:56Z",
                    "lastUpdatedOn": "2025-11-18T12:08:56.000+0000",
                    "lastUpdatedOnISO": "2025-11-18T12:08:56Z",
                    "lastUpdatedBy": {
                        "id": 75152721,
                        "code": "naman_doc",
                        "description": "",
                        "name": "naman",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 75152721,
                        "code": "naman_doc",
                        "description": "",
                        "name": "naman",
                        "type": "TILL"
                    }
                },
                "startDate": "2025-05-11",
                "endDate": "2025-05-11",
                "refCode": "Cycle_2",
                "periodStatus": "ENDED",
                "targetGroupId": 2762,
                "description": "",
                "active": true
            },
            {
                "id": 30147,
                "attribution": {
                    "createdOn": "2025-11-18T12:08:56.000+0000",
                    "createdOnISO": "2025-11-18T12:08:56Z",
                    "lastUpdatedOn": "2025-11-18T12:08:56.000+0000",
                    "lastUpdatedOnISO": "2025-11-18T12:08:56Z",
                    "lastUpdatedBy": {
                        "id": 75152721,
                        "code": "naman_doc",
                        "description": "",
                        "name": "naman",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 75152721,
                        "code": "naman_doc",
                        "description": "",
                        "name": "naman",
                        "type": "TILL"
                    }
                },
                "startDate": "2025-06-11",
                "endDate": "2025-06-11",
                "refCode": "Cycle_1",
                "periodStatus": "ENDED",
                "targetGroupId": 2762,
                "description": "",
                "active": true
            }
        ],
        "totalPeriods": 2,
        "description": "description update number 3",
        "targetEvaluationType": "FIXED_CALENDAR_WINDOW",
        "recurringCycles": 1,
        "frequency": 1,
        "targetCycleStartDate": "2025-05-11T00:00:00.000Z",
        "targetCycleEndDate": "2025-06-11T23:59:59.000Z",
        "targetCycleStartDateISO": "2025-05-11T00:00:00Z",
        "targetCycleEndDateISO": "2025-06-11T23:59:59Z",
        "frequencyType": "DAILY",
        "trackingType": "DEFAULT",
        "createdOn": 1763467736000,
        "targets": [
            {
                "id": 3006,
                "attribution": {
                    "createdOn": "2025-11-18T12:08:56.000+0000",
                    "createdOnISO": "2025-11-18T12:08:56Z",
                    "lastUpdatedOn": "2025-11-18T12:08:56.000+0000",
                    "lastUpdatedOnISO": "2025-11-18T12:08:56Z",
                    "lastUpdatedBy": {
                        "id": 75152721,
                        "code": "naman_doc",
                        "description": "",
                        "name": "naman",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 75152721,
                        "code": "naman_doc",
                        "description": "",
                        "name": "naman",
                        "type": "TILL"
                    }
                },
                "name": "uat_target_group_80",
                "emfRuleSetId": 126454877,
                "targetType": "COUNT",
                "targetEntity": "EVENT",
                "eventName": "TransactionAdd",
                "targetGroupId": 2762,
                "description": "",
                "active": true,
                "expression": "true",
                "expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
                "filters": [],
                "enrolmentMethod": "IMPORT",
                "defaultValues": [
                    {
                        "id": 127052,
                        "periodId": 30147,
                        "defaultValue": 1
                    },
                    {
                        "id": 127053,
                        "periodId": 30148,
                        "defaultValue": 1
                    }
                ],
                "targetPeriodDefaultValuesMap": {
                    "30147": {
                        "id": 127052,
                        "periodId": 30147,
                        "defaultValue": 1
                    },
                    "30148": {
                        "id": 127053,
                        "periodId": 30148,
                        "defaultValue": 1
                    }
                },
                "targetMilestoneTriggers": [],
                "extendedFieldInfo": {
                    "name": "points",
                    "aggregateFunction": "SUM"
                }
            }
        ],
        "leaderboardEnabled": false,
        "userCreated": false,
        "timeZoneName": "GMT"
    },
    "errors": null,
    "warnings": null
}

Response parameters

ParameterData TypeDescription
idIntegerUnique identifier for the non-cont-streakTest13.
attribution.createdOnStringThe creation date and time of the target group.
Note: This field will be deprecated in the future and is being replaced by createdOnISO.
attribution.createdOnISOString

Indicates the creation date and time of the target in ISO 8601 format, returned in the server time zone.

EU server example:
2025-12-16T14:30:45Z → 16 December 2025, 14:30:45 (UTC)

India server example:
2025-12-16T14:30:45+05:30 → 16 December 2025, 14:30:45 (IST)

Note: The response time zone always matches the server time zone, regardless of the time zone offset in the request.

attribution.lastUpdatedOnStringThe last updated date and time of the target group.
Note: This field will be deprecated in the future and is being replaced by lastUpdatedOnISO.
attribution.lastUpdatedOnISOString

Indicates the last updated date and time of the target cycle in ISO 8601 format, returned in the server time zone.

EU server example:
2025-12-16T14:30:45Z → 16 December 2025, 14:30:45 (UTC)

India server example:
2025-12-16T14:30:45+05:30 → 16 December 2025, 14:30:45 (IST)

Note: The response time zone always matches the server time zone, regardless of the time zone offset in the request.

attribution.lastUpdatedBy.idIntegerThe ID of the last user who updated the target group.
attribution.createdBy.idIntegerThe ID of the user who created the target group.
nameStringName of the target group.
fromDateDateStart date of the target group's active period.
toDateDateEnd date of the target group's active period.
activeBooleanStatus indicating if the target group is currently active.
preferredTillIdIntegerA reference ID for internal use, possibly related to prioritization.
periodsArrayA collection of periods within the target group.
-- idIntegerUnique identifier for each period.
-- startDateDateStart date of the period.
-- endDateDateEnd date of the period.
-- refCodeStringReference code for the period.
-- periodStatusStringStatus of the period (e.g., RUNNING, NOT_STARTED).
-- targetGroupIdIntegerID of the target group to which the period belongs.
-- descriptionStringDescription of the period.
-- activeBooleanStatus indicating if the period is currently active.
streaksArrayA collection of streaks within the target group.
-- idIntegerUnique identifier for each streak.
-- targetGroupIdIntegerID of the target group to which the streak belongs.
-- nameStringName of the streak.
-- targetCountOfSequenceIntegerTarget count of sequences for the streak.
activePeriod.idIntegerThe ID of the currently active period.
totalPeriodsIntegerTotal number of periods in the target group.
descriptionStringDescription of the non-cont-streaks group.
targetEvaluationTypeStringType of target evaluation (e.g., FIXED_CALENDAR_WINDOW).
recurringCyclesIntegerNumber of recurring cycles.
frequencyIntegerFrequency of occurrence.
frequencyTypeStringType of frequency (e.g., CUSTOM).
trackingTypeEnumThe type of tracking the milestone is created for. Supported values: <br>Default (single target tracking), <br>Unified (tracking multiple targets as a unit), <br>Streak (Tracking the achievement of a user across the cycles continuously), <br>Capping (Tracking the number of points a user has got over a period, so that capping can be applied).
targetCycleStartDateStringIndicates the start date and time of the target cycle in ISO 8601 format
Note: This field will be deprecated in the future and is being replaced by targetCycleStartDateISO.
targetCycleStartDateISOString

Indicates the start date and time of the target cycle in ISO 8601 format, returned in the server time zone.

EU server example
2025-12-16T14:30:45Z → 16 December 2025, 14:30:45 (UTC)

India server example
2025-12-16T14:30:45+05:30 → 16 December 2025, 14:30:45 (IST)

targetCycleEndDateStringIndicates the end date and time of the target cycle in ISO 8601 format
Note: This field will be deprecated in the future and is being replaced by targetCycleEndDateISO.
targetCycleEndDateISOString

Indicates the end date and time of the target cycle in ISO 8601 format, returned in the server time zone.

EU server example
2025-12-16T14:30:45Z → 16 December 2025, 14:30:45 (UTC)

India server example
2025-12-16T14:30:45+05:30 → 16 December 2025, 14:30:45 (IST)

Note: The response time zone always matches the server time zone, regardless of the time zone offset in the request.

-- nameStringName of the target.
-- emfRuleSetIdIntegerRule set ID associated with the target.
-- targetTypeEnumThe type of target. <br>Supported values: QUANTITY, SALES, COUNT, VISIT, GROSS_SALES, <br>REGULAR_POINTS, PROMOTIONAL_POINTS, <br>ALL_POINTS, EXTENDED_FIELD.
-- targetEntityEnumThe KPI on which the target is tracked. <br>For the transactional KPIs, the supported value for this are Transaction and Lineitem. <br>For the Behavioural or EMF events, the supported value is EVENT. <br>For the tracking based on rewards such as points, the supported value will be REWARDS.
-- eventNameStringEvent name associated with the target.
-- targetGroupIdIntegerID of the target group to which the target belongs.
-- descriptionStringDescription of the target.
-- expressionStringExpression defining the target condition.
-- expressionJsonJSONJSON format of the expression defining the target condition.
-- filtersArrayFilters applied to the target.
-- enrolmentMethodStringMethod of enrolment for the target.
-- defaultValuesArrayDefault values associated with periods for the target.
---- idIntegerUnique identifier for each default value.
---- periodIdIntegerID of the period to which the default value belongs.
---- defaultValueIntegerDefault value for the period.
leaderboardEnabledBooleanIndicates if the leaderboard feature is enabled.
userCreatedBooleanIndicates if the target is a user-created target.
timezoneNameStringIANA time zone name for the target group.
This is a reference label to identify the time zone where the target group is created. There is no validation for this parameter; it is recommended to follow the IANA format.
errorsnull or ObjectContains error details if any occurred during the API request.
warningsnull or ObjectContains warning details if any occurred during the API request.
Responses

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json