Edit streak

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.

  1. expression
  2. expressionJson
  3. filters (scope filters & rule filters)
  4. defaultValues

👍

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/OAuth authentication
  • Default access group

Resource information

URIv3/targetGroups\{groupId\}/targets\{targetIdd\}
HTTP methodPOST
PaginationNA
Rate limitNA
Batch supportNA

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 NameData TypeDescription
activeBooleanIndicates if the tracking is active or not.
descriptionStringA brief description of the target group or period.
nameStringThe name identifier for the target group or target.

Character limit: 200.
preferredTillIdNumberIdentifier for a preferred till.
trackingTypeStringType of tracking. Supported values:

- Default
- Unified
- Streak
- Capping
targetEvaluationTypeStringTarget evaluation strategy. Supported values:
- FIXED_CALENDAR_WINDOW
- CYCLIC_WINDOW
- PERIOD_AGNOSTIC_WINDOW
totalPeriodsNumberTotal number of periods to evaluate tracking.
frequencyTypeEnumFrequency of each cycle. Supported: Monthly, Quarterly, Half-yearly, Yearly, Weekly.
frequencyNumberFrequency count relevant to the frequencyType.
recurringCyclesNumberNumber of cycles for recurring tracking.
periodsObject[]Array of period objects, each with:
- active (Boolean)
- description (String)
- endDate (Date Time)
- periodStatus (String)
- refCode (String)
- startDate (Date Time)
targetsObject[]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)
extendedFieldInfoObjectOnly for targetType = EVENT_ATTRIBUTE. Includes:
- name (String)
- aggregateFunction (Enum: SUM)
defaultValuesObject[]Array of objects with:
- defaultValue* (Integer)
streaksObject[]Array of streak objects with:
- name (String)
- targetCountOfSequence (Integer)

Note: Parameters marked with * are required.

Response parameters

ParameterData TypeDescription
dataArrayList of objects containing the main data payload.
.idIntegerUnique identifier for the record.
.attributionObjectMetadata about the creation and updates of the record.
..createdOnStringTimestamp when the record was created (ISO 8601 format).
..createdOnISOStringTimestamp when the record was created, with the timezone included. (ISO 8601 format).
..lastUpdatedOnStringTimestamp when the record was last updated (ISO 8601 format).
..lastUpdatedOnISOStringTimestamp when the record was last updated, with the timezone included. (ISO 8601 format).
..lastUpdatedByObjectDetails of the user who last updated the record.
...idIntegerUnique identifier of the user.
...codeStringCode associated with the user.
...descriptionStringDescription of the user.
...nameStringName of the user.
...typeStringType of the user (e.g., "TILL", "ADMIN_USER").
..createdByObjectDetails of the user who created the record.
...idIntegerUnique identifier of the user.
...codeStringCode associated with the user.
...descriptionStringDescription of the user.
...nameStringName of the user.
...typeStringType of the user (e.g., "TILL", "ADMIN_USER").
.nameStringName of the target group or target.
.emfRuleSetIdIntegerIdentifier for the EMF rule set.
.targetTypeStringType of target. Possible values ALL, SALES, COUNT, VISIT, EXTENDED_FIELD.
.targetEntityStringEntity targeted Possible values: TRANSACTION, LINEITEM, EVENT, REWARDS.
.eventNameStringName of the event
.targetGroupIdIntegerIdentifier for the target group.
.descriptionStringDescription of the target group or target.
.activeBooleanIndicates whether the target group or target is active.
.expressionStringLogical expression for the target group or target
.expressionJsonStringJSON representation of the expression.
..arityStringThe arity of the expression
..valueStringThe value used in the expression (e.g., "true", ">", "500").
..typeStringThe type of the expression
.filtersArrayList of filters applied to the target (e.g., entityType and entityIds).
.enrolmentMethodStringThe method of enrolment for the target. TRANSACTION, IMPORT.
.defaultValuesArrayList of default value objects for the target.
..idIntegerUnique identifier for each default value.
..periodIdIntegerIdentifier for the period associated with the default value.
..defaultValueFloatDefault value for the period.
.targetPeriodDefaultValuesMapObjectMapping of period IDs to their default values.
...idIntegerUnique identifier for the default value.
...periodIdIntegerIdentifier for the period.
...defaultValueFloatDefault value for the period.
..30165ObjectObject containing default value details for period 30165.
...idIntegerUnique identifier for the default value.
...periodIdIntegerIdentifier for the period.
...defaultValueFloatDefault value for the period.
errorsObject/NullContains error details if any occurred during the API request.
warningsObject/NullContains 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
}
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!