| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
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.
NoteFor 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
| URI | v3/targetGroups |
| HTTP method | PUT |
| Pagination | NA |
| Rate limit | NA |
| Batch support | NA |
API endpoint example
https://eucrm.cc.capillarytech.com/v3/targetGroups/editTargetGroup/{targetGroupId}
Request path parameters
| Parameter | Description |
|---|---|
| targetGroupId | Identifier for the target group |
Request body parameters
AttentionOnly milestone name, expression and JSON expression parameters are editable.
| Parameter | Data Type | Description |
|---|---|---|
| id | Integer | Unique target group identifier for the target group. This field is not editable. |
| name | String | Name of the target group. <br><br> The character limit for the name is 200 characters. |
| fromDate | Date | Start date of the target group's active period. |
| toDate | Date | End date of the target group's active period. |
| active | Boolean | Status indicating if the target group is currently active. |
| preferredTillId | Integer | A reference ID for internal use, possibly related to prioritization. |
| periods | Array | A collection of periods within the target group. |
| -id | Integer | Unique identifier for each period. |
| -startDate | Date | Start date of the period. |
| -endDate | Date | End date of the period. |
| -refCode | String | A reference code for the period. |
| -periodStatus | Enum | Indicates if the cycle of the Milestone is active/inactive. <br> Supported values: NOT_STARTED, RUNNING. |
| -targetGroupId | Integer | ID of the target group to which the period belongs. |
| -description | String | Description of the period. |
| -active | Boolean | Status indicating if the period is currently active. |
| streaks | Array | A collection of streaks within the target group. |
| -id | Integer | Unique identifier for each streak. |
| -targetGroupId | Integer | ID of the target group to which the streak belongs. |
| -name | String | Name of the streak. |
| -targetCountOfSequence | Integer | Number of the times the user has to achieve the target to redeem the reward. |
| totalPeriods | Integer | The total number of periods over which the tracking is evaluated. |
| description | String | Description of the non-cont-streaks group. |
| targetEvaluationType | String | The evaluation strategy for the targets. Supported values: <br> FIXED_CALENDAR_WINDOW, CYCLIC_WINDOW, <br> PERIOD_AGNOSTIC_WINDOW |
| recurringCycles | Integer | Number of recurring cycles. |
| frequency | Integer | Frequency of occurrence. |
| targetCycleStartDate | DateTime | Start date and time of the target cycle. |
| targetCycleEndDate | DateTime | End date and time of the target cycle. |
| targetCycleStartDateISO | String | Defines the target’s start date in ISO 8601 format with the region offset. For example: Format for the request parameter: |
| targetCycleEndDateISO | String | Defines the target’s end date in ISO 8601 format with the region offset. For example: Format for the request parameter: |
| targets | Array | A collection of targets within the target group. |
| -id | Integer | Unique identifier for each target. |
| -name | String | Name of the target. |
| description | String | Description of the target. |
| -emfRuleSetId | Integer | Rule set ID associated with the target. |
| -targetType | Enum | The type of target. <br> Supported values: QUANTITY, SALES, COUNT, VISIT, GROSS_SALES, REGULAR_POINTS, PROMOTIONAL_POINTS, ALL_POINTS, EXTENDED_FIELD. |
| -targetEntity | Enum | The KPI on which the target is tracked. <br> Supported values: Transaction, Lineitem, EVENT, REWARDS. |
| -eventName | String | The behavioral name of the event that triggers the target. |
| -targetGroupId | Integer | ID of the target group to which the target belongs. |
| -description | String | Description of the target. |
| -expression | String | Expression defining the target condition. |
| -expressionJson | JSON | JSON format of the expression defining the target condition. |
| -filters | Array | Filters applied to the target. |
| -enrolmentMethod | String | Method of enrolment for the target. |
| -defaultValues | Array | Default values associated with periods for the target. |
| -id | Integer | Unique identifier for each default value. |
| -periodId | Integer | ID of the period to which the default value belongs. |
| -defaultValue | Decimal | Default 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
| Parameter | Data Type | Description |
|---|---|---|
| id | Integer | Unique identifier for the non-cont-streakTest13. |
| attribution.createdOn | String | The creation date and time of the target group. Note: This field will be deprecated in the future and is being replaced by createdOnISO. |
| attribution.createdOnISO | String | Indicates the creation date and time of the target in ISO 8601 format, returned in the server time zone. EU server example: India server example: Note: The response time zone always matches the server time zone, regardless of the time zone offset in the request. |
| attribution.lastUpdatedOn | String | The 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.lastUpdatedOnISO | String | Indicates the last updated date and time of the target cycle in ISO 8601 format, returned in the server time zone. EU server example: India server example: Note: The response time zone always matches the server time zone, regardless of the time zone offset in the request. |
| attribution.lastUpdatedBy.id | Integer | The ID of the last user who updated the target group. |
| attribution.createdBy.id | Integer | The ID of the user who created the target group. |
| name | String | Name of the target group. |
| fromDate | Date | Start date of the target group's active period. |
| toDate | Date | End date of the target group's active period. |
| active | Boolean | Status indicating if the target group is currently active. |
| preferredTillId | Integer | A reference ID for internal use, possibly related to prioritization. |
| periods | Array | A collection of periods within the target group. |
| -- id | Integer | Unique identifier for each period. |
| -- startDate | Date | Start date of the period. |
| -- endDate | Date | End date of the period. |
| -- refCode | String | Reference code for the period. |
| -- periodStatus | String | Status of the period (e.g., RUNNING, NOT_STARTED). |
| -- targetGroupId | Integer | ID of the target group to which the period belongs. |
| -- description | String | Description of the period. |
| -- active | Boolean | Status indicating if the period is currently active. |
| streaks | Array | A collection of streaks within the target group. |
| -- id | Integer | Unique identifier for each streak. |
| -- targetGroupId | Integer | ID of the target group to which the streak belongs. |
| -- name | String | Name of the streak. |
| -- targetCountOfSequence | Integer | Target count of sequences for the streak. |
| activePeriod.id | Integer | The ID of the currently active period. |
| totalPeriods | Integer | Total number of periods in the target group. |
| description | String | Description of the non-cont-streaks group. |
| targetEvaluationType | String | Type of target evaluation (e.g., FIXED_CALENDAR_WINDOW). |
| recurringCycles | Integer | Number of recurring cycles. |
| frequency | Integer | Frequency of occurrence. |
| frequencyType | String | Type of frequency (e.g., CUSTOM). |
| trackingType | Enum | The 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). |
| targetCycleStartDate | String | Indicates 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. |
| targetCycleStartDateISO | String | Indicates the start date and time of the target cycle in ISO 8601 format, returned in the server time zone. EU server example India server example |
| targetCycleEndDate | String | Indicates 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. |
| targetCycleEndDateISO | String | Indicates the end date and time of the target cycle in ISO 8601 format, returned in the server time zone. EU server example India server example Note: The response time zone always matches the server time zone, regardless of the time zone offset in the request. |
| -- name | String | Name of the target. |
| -- emfRuleSetId | Integer | Rule set ID associated with the target. |
| -- targetType | Enum | The type of target. <br>Supported values: QUANTITY, SALES, COUNT, VISIT, GROSS_SALES, <br>REGULAR_POINTS, PROMOTIONAL_POINTS, <br>ALL_POINTS, EXTENDED_FIELD. |
| -- targetEntity | Enum | The 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. |
| -- eventName | String | Event name associated with the target. |
| -- targetGroupId | Integer | ID of the target group to which the target belongs. |
| -- description | String | Description of the target. |
| -- expression | String | Expression defining the target condition. |
| -- expressionJson | JSON | JSON format of the expression defining the target condition. |
| -- filters | Array | Filters applied to the target. |
| -- enrolmentMethod | String | Method of enrolment for the target. |
| -- defaultValues | Array | Default values associated with periods for the target. |
| ---- id | Integer | Unique identifier for each default value. |
| ---- periodId | Integer | ID of the period to which the default value belongs. |
| ---- defaultValue | Integer | Default value for the period. |
| leaderboardEnabled | Boolean | Indicates if the leaderboard feature is enabled. |
| userCreated | Boolean | Indicates if the target is a user-created target. |
| timezoneName | String | IANA 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. |
| errors | null or Object | Contains error details if any occurred during the API request. |
| warnings | null or Object | Contains warning details if any occurred during the API request. |
