Update target group

This API allows you to update 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 .

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 non-cont-streakTest13.
nameStringName of the target group.

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.
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:
FIXED_CALENDAR_WINDOW, CYCLIC_WINDOW,
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.
trackingTypeEnumThe type of tracking the milestone is created for. Supported values:
Default (single target tracking),
Unified (tracking multiple targets as a unit),
Streak (Tracking the achievement of a user across the cycles continuously),
Capping (Tracking the number of points a user has got over a period, so that capping can be applied).
targetsArrayA collection of targets within the target group.
-- idIntegerUnique identifier for each target.
-- nameStringName of the target.
-- emfRuleSetIdIntegerRule set ID associated with the target.
-- targetTypeEnumThe type of target.
Supported values: QUANTITY, SALES, COUNT, VISIT, GROSS_SALES,
REGULAR_POINTS, PROMOTIONAL_POINTS,
ALL_POINTS, EXTENDED_FIELD.
-- targetEntityEnumThe KPI on which the target is tracked.
For the transactional KPIs, the supported value for this are Transaction and Lineitem.
For the Behavioural or EMF events, the supported value is EVENT.
For the tracking based on rewards such as points, the supported value will be 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.
{
        "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
                    }
                ]
            }
        ]
    
}

Response parameters

ParameterData TypeDescription
idIntegerUnique identifier for the non-cont-streakTest13.
attribution.createdOnStringThe creation date and time of the target group.
attribution.lastUpdatedOnStringThe last update date and time of the target group.
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.
targetCycleStartDateDateTimeStart date and time of the target cycle.
targetCycleEndDateDateTimeEnd date and time of the target cycle.
frequencyTypeStringType of frequency (e.g., CUSTOM).
trackingTypeEnumThe type of tracking the milestone is created for. Supported values:
Default (single target tracking),
Unified (tracking multiple targets as a unit),
Streak (Tracking the achievement of a user across the cycles continuously),
Capping (Tracking the number of points a user has got over a period, so that capping can be applied).
createdOnLongThe creation timestamp of the data in milliseconds since epoch.
targetsArrayA collection of targets within the target group.
-- idIntegerUnique identifier for each target.
-- nameStringName of the target.
-- emfRuleSetIdIntegerRule set ID associated with the target.
-- targetTypeEnumThe type of target.
Supported values: QUANTITY, SALES, COUNT, VISIT, GROSS_SALES,
REGULAR_POINTS, PROMOTIONAL_POINTS,
ALL_POINTS, EXTENDED_FIELD.
-- targetEntityEnumThe KPI on which the target is tracked.
For the transactional KPIs, the supported value for this are Transaction and Lineitem.
For the Behavioural or EMF events, the supported value is EVENT.
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.
{
    "data": {
        "id": 18044,
        "attribution": {
            "createdOn": "2024-04-01T16:04:29.145+0530",
            "lastUpdatedOn": "2024-04-01T16:04:29.145+0530",
            "lastUpdatedBy": {
                "id": 50698511,
                "code": null,
                "description": null,
                "name": null,
                "type": null
            },
            "createdBy": {
                "id": 50698511,
                "code": null,
                "description": null,
                "name": null,
                "type": null
            }
        },
        "name": "non-cont-streakTest13",
        "fromDate": "2024-02-19",
        "toDate": "2024-11-20",
        "active": true,
        "preferredTillId": 50698511,
        "periods": [
            {
                "id": 22057,
                "attribution": {
                    "createdOn": "2024-02-19T15:41:53.000+0530",
                    "lastUpdatedOn": "2024-02-19T15:41:53.000+0530",
                    "lastUpdatedBy": {
                        "id": 50698511,
                        "code": "tillrulocaldemonightly1",
                        "description": "",
                        "name": "tillrulocaldemonightly1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50698511,
                        "code": "tillrulocaldemonightly1",
                        "description": "",
                        "name": "tillrulocaldemonightly1",
                        "type": "TILL"
                    }
                },
                "startDate": "2024-02-19",
                "endDate": "2024-11-17",
                "refCode": "period44",
                "periodStatus": "RUNNING",
                "targetGroupId": 18044,
                "description": "p1",
                "active": true
            },
            {
                "id": 22058,
                "attribution": {
                    "createdOn": "2024-02-19T15:41:53.000+0530",
                    "lastUpdatedOn": "2024-02-19T15:41:53.000+0530",
                    "lastUpdatedBy": {
                        "id": 50698511,
                        "code": "tillrulocaldemonightly1",
                        "description": "",
                        "name": "tillrulocaldemonightly1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50698511,
                        "code": "tillrulocaldemonightly1",
                        "description": "",
                        "name": "tillrulocaldemonightly1",
                        "type": "TILL"
                    }
                },
                "startDate": "2024-11-18",
                "endDate": "2024-11-20",
                "refCode": "period45",
                "periodStatus": "NOT_STARTED",
                "targetGroupId": 18044,
                "description": "p1",
                "active": true
            }
        ],
        "streaks": [
            {
                "id": 1415,
                "attribution": {
                    "createdOn": "2024-04-01T16:04:29.145+0530",
                    "lastUpdatedOn": "2024-04-01T16:04:29.145+0530",
                    "lastUpdatedBy": {
                        "id": 50698511,
                        "code": "tillrulocaldemonightly1",
                        "description": "",
                        "name": "tillrulocaldemonightly1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50698511,
                        "code": "tillrulocaldemonightly1",
                        "description": "",
                        "name": "tillrulocaldemonightly1",
                        "type": "TILL"
                    }
                },
                "targetGroupId": 18044,
                "name": "streakTest13test124",
                "targetCountOfSequence": 1
            },
            {
                "id": 1416,
                "attribution": {
                    "createdOn": "2024-04-01T16:04:29.145+0530",
                    "lastUpdatedOn": "2024-04-01T16:04:29.145+0530",
                    "lastUpdatedBy": {
                        "id": 50698511,
                        "code": "tillrulocaldemonightly1",
                        "description": "",
                        "name": "tillrulocaldemonightly1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50698511,
                        "code": "tillrulocaldemonightly1",
                        "description": "",
                        "name": "tillrulocaldemonightly1",
                        "type": "TILL"
                    }
                },
                "targetGroupId": 18044,
                "name": "streakTestt13",
                "targetCountOfSequence": 2
            }
        ],
        "activePeriod": {
            "id": 22057,
            "attribution": {
                "createdOn": "2024-02-19T15:41:53.000+0530",
                "lastUpdatedOn": "2024-02-19T15:41:53.000+0530",
                "lastUpdatedBy": {
                    "id": 50698511,
                    "code": "tillrulocaldemonightly1",
                    "description": "",
                    "name": "tillrulocaldemonightly1",
                    "type": "TILL"
                },
                "createdBy": {
                    "id": 50698511,
                    "code": "tillrulocaldemonightly1",
                    "description": "",
                    "name": "tillrulocaldemonightly1",
                    "type": "TILL"
                }
            },
            "startDate": "2024-02-19",
            "endDate": "2024-11-17",
            "refCode": "period44",
            "periodStatus": "RUNNING",
            "targetGroupId": 18044,
            "description": "p1",
            "active": true
        },
        "totalPeriods": 2,
        "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",
        "frequencyType": "CUSTOM",
        "trackingType": "NON_CONTINUOUS_STREAKS",
        "createdOn": 1711967626000,
        "targets": [
            {
                "id": 33502,
                "attribution": {
                    "createdOn": "2024-02-19T15:41:53.000+0530",
                    "lastUpdatedOn": "2024-02-19T15:41:53.000+0530",
                    "lastUpdatedBy": {
                        "id": 50698511,
                        "code": "tillrulocaldemonightly1",
                        "description": "",
                        "name": "tillrulocaldemonightly1",
                        "type": "TILL"
                    },
                    "createdBy": {
                        "id": 50698511,
                        "code": "tillrulocaldemonightly1",
                        "description": "",
                        "name": "tillrulocaldemonightly1",
                        "type": "TILL"
                    }
                },
                "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
                    }
                ]
            }
        ]
    },
    "errors": null,
    "warnings": null
}
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!