put
https://{host}/v3/targetGroups//targets/
A streak refers to a consecutive series of actions or engagements by a customer, based on which loyalty benefits are provided.
Only the target-related part of the streak can be edited once the streak is created. The target-group-related section and the period-related section are not editable once created. So, to edit a create, first the target-group ID & the target ID needs to be figured out.
Then, by using the update target API, we can edit the following components of the streak.
- expression
- expressionJson
- filters (scope filters & rule filters)
- defaultValues
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 .
Prerequisites
- Authentication: Basic/OAuth authentication
- Default access group
Resource information
| URI | v3/targetGroups\{groupId\}/targets\{targetIdd\} |
| HTTP method | POST |
| Pagination | NA |
| Rate limit | NA |
| Batch support | NA |
Request example
curl -L -X PUT 'https://eu.api.capillarytech.com/v3/targetGroups/2773/targets/3018' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic M2YjZlY2I2MmEy' \
-H 'Cookie: _cfuvid=PZ2Qs9Lv6_ngy2fSsa2ZHebqE7qq7WrhJNpax_n8cXA-1759145375283-0.0.1.1-604800000; _cfuvid=0zNe_b9djdt5BjjZvYS6qo81F5QhQ4Zf.sj6dKZkcr8-1763976260985-0.0.1.1-604800000' \
-d '{
"active": true,
"description": "",
"expression": "true",
"expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
"filters": [],
"name": "uat_target_group_101_update",
"targetEntity": "EVENT",
"targetType": "COUNT",
"defaultValues": [
{
"defaultValue": 1.0
},
{
"defaultValue": 1.0
}
]
}'Request Body Parameters
| Parameter Name | Data Type | Description |
|---|---|---|
active | Boolean | Indicates if the tracking is active or not. |
description | String | A brief description of the target group or period. |
name | String | The name identifier for the target group or target. Character limit: 200. |
preferredTillId | Number | Identifier for a preferred till. |
trackingType | String | Type of tracking. Supported values: - Default- Unified- Streak- Capping |
targetEvaluationType | String | Target evaluation strategy. Supported values: - FIXED_CALENDAR_WINDOW- CYCLIC_WINDOW- PERIOD_AGNOSTIC_WINDOW |
totalPeriods | Number | Total number of periods to evaluate tracking. |
frequencyType | Enum | Frequency of each cycle. Supported: Monthly, Quarterly, Half-yearly, Yearly, Weekly. |
frequency | Number | Frequency count relevant to the frequencyType. |
recurringCycles | Number | Number of cycles for recurring tracking. |
periods | Object[] | Array of period objects, each with: - active (Boolean)- description (String)- endDate (Date Time)- periodStatus (String)- refCode (String)- startDate (Date Time) |
targets | Object[] | Array of target objects, each with: - active (Boolean)- description (String)- expression* (String)- expressionJson* (String)- filters* (Object)- entityType* (Enum: STORE, ZONE, CONCEPT)- entityIds* (Array)- name (String)- targetEntity (Enum: TRANSACTION, LINEITEM, EVENT, REWARDS)- eventName (String)- targetType (Enum: QUANTITY, SALES, COUNT, VISIT, GROSS_SALES, REGULAR_POINTS, PROMOTIONAL_POINTS, ALL_POINTS, EXTENDED_FIELD, EVENT_ATTRIBUTE) |
extendedFieldInfo | Object | Only for targetType = EVENT_ATTRIBUTE. Includes:- name (String)- aggregateFunction (Enum: SUM) |
defaultValues | Object[] | Array of objects with: - defaultValue* (Integer) |
streaks | Object[] | Array of streak objects with: - name (String)- targetCountOfSequence (Integer) |
Note: Parameters marked with
*are required.
Response parameters
| Parameter | Data Type | Description |
|---|---|---|
| data | Array | List of objects containing the main data payload. |
| .id | Integer | Unique identifier for the record. |
| .attribution | Object | Metadata about the creation and updates of the record. |
| ..createdOn | String | Timestamp when the record was created (ISO 8601 format). |
| ..createdOnISO | String | Timestamp when the record was created, with the timezone included. (ISO 8601 format). |
| ..lastUpdatedOn | String | Timestamp when the record was last updated (ISO 8601 format). |
| ..lastUpdatedOnISO | String | Timestamp when the record was last updated, with the timezone included. (ISO 8601 format). |
| ..lastUpdatedBy | Object | Details of the user who last updated the record. |
| ...id | Integer | Unique identifier of the user. |
| ...code | String | Code associated with the user. |
| ...description | String | Description of the user. |
| ...name | String | Name of the user. |
| ...type | String | Type of the user (e.g., "TILL", "ADMIN_USER"). |
| ..createdBy | Object | Details of the user who created the record. |
| ...id | Integer | Unique identifier of the user. |
| ...code | String | Code associated with the user. |
| ...description | String | Description of the user. |
| ...name | String | Name of the user. |
| ...type | String | Type of the user (e.g., "TILL", "ADMIN_USER"). |
| .name | String | Name of the target group or target. |
| .emfRuleSetId | Integer | Identifier for the EMF rule set. |
| .targetType | String | Type of target. Possible values ALL, SALES, COUNT, VISIT, EXTENDED_FIELD. |
| .targetEntity | String | Entity targeted Possible values: TRANSACTION, LINEITEM, EVENT, REWARDS. |
| .eventName | String | Name of the event |
| .targetGroupId | Integer | Identifier for the target group. |
| .description | String | Description of the target group or target. |
| .active | Boolean | Indicates whether the target group or target is active. |
| .expression | String | Logical expression for the target group or target |
| .expressionJson | String | JSON representation of the expression. |
| ..arity | String | The arity of the expression |
| ..value | String | The value used in the expression (e.g., "true", ">", "500"). |
| ..type | String | The type of the expression |
| .filters | Array | List of filters applied to the target (e.g., entityType and entityIds). |
| .enrolmentMethod | String | The method of enrolment for the target. TRANSACTION, IMPORT. |
| .defaultValues | Array | List of default value objects for the target. |
| ..id | Integer | Unique identifier for each default value. |
| ..periodId | Integer | Identifier for the period associated with the default value. |
| ..defaultValue | Float | Default value for the period. |
| .targetPeriodDefaultValuesMap | Object | Mapping of period IDs to their default values. |
| ...id | Integer | Unique identifier for the default value. |
| ...periodId | Integer | Identifier for the period. |
| ...defaultValue | Float | Default value for the period. |
| ..30165 | Object | Object containing default value details for period 30165. |
| ...id | Integer | Unique identifier for the default value. |
| ...periodId | Integer | Identifier for the period. |
| ...defaultValue | Float | Default value for the period. |
| errors | Object/Null | Contains error details if any occurred during the API request. |
| warnings | Object/Null | Contains warning details if any occurred during the API request. |
{
"data": {
"id": 3018,
"attribution": {
"createdOn": "2025-11-24T09:23:57.000+0000",
"createdOnISO": "2025-11-24T09:23:57Z",
"lastUpdatedOn": "2025-11-24T09:23:57.000+0000",
"lastUpdatedOnISO": "2025-11-24T09:23:57Z",
"lastUpdatedBy": {
"id": 75152721,
"code": "tom_doc",
"description": "",
"name": "tom",
"type": "TILL"
},
"createdBy": {
"id": 75152721,
"code": "tom_doc",
"description": "",
"name": "tom",
"type": "TILL"
}
},
"name": "uat_target_group_101_update",
"emfRuleSetId": 126456403,
"targetType": "COUNT",
"targetEntity": "EVENT",
"eventName": "TransactionAdd",
"targetGroupId": 2773,
"description": "",
"active": true,
"expression": "true",
"expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
"filters": [],
"enrolmentMethod": "IMPORT",
"defaultValues": [
{
"id": 127069,
"periodId": 30164,
"defaultValue": 1.000
},
{
"id": 127070,
"periodId": 30165,
"defaultValue": 1.000
}
],
"targetPeriodDefaultValuesMap": {
"30164": {
"id": 127069,
"periodId": 30164,
"defaultValue": 1.000
},
"30165": {
"id": 127070,
"periodId": 30165,
"defaultValue": 1.000
}
}
},
"errors": null,
"warnings": null
}