Get target groups based on ID

This API fetches target group information. Enter a target group ID to get details of a specific target.

API endpoint example

'https://eu.api.capillarytech.com/v3/targetGroups?includeUserCreatedTargetGroups=true&includeOnlyActive=true

Prerequisites

  • Basic or OAuth authentication

  • Default access group

API Specification

URIv3/targetGroups
HTTP MethodGET
PaginationNo
Batch supportNo
Rate limit informationNone

Request path parameters

Parameter NameData TypeDescription
targetGroupIdLongGroup ID of the target to retrieve

Request query parameters

Parameter NameData TypeDescription
includePeriodsBooleanInclude the period information associated with the target. <br>The period object contains information on the start date, end date and current status of the target.
includeUserCreatedTargetGroupsBooleanInclude the user created target groups in the response. This value is false by default.
includeOnlyActiveBooleanInclude only targets that are currently active.

Response body

{
    "data": [
        {
            "id": 2711,
            "attribution": {
                "createdOn": "2025-07-23T07:18:01.000+0000",
                "createdOnISO": "2025-07-23T07:18:01Z",
                "lastUpdatedOn": "2025-07-23T07:18:01.000+0000",
                "lastUpdatedOnISO": "2025-07-23T07:18:01Z",
                "lastUpdatedBy": {
                    "id": 75155292,
                    "code": "1736163452_",
                    "description": "",
                    "name": "Tom Sawyer",
                    "type": "ADMIN_USER"
                },
                "createdBy": {
                    "id": 75155292,
                    "code": "1736163452_",
                    "description": "",
                    "name": "Tom Sawyer",
                    "type": "ADMIN_USER"
                }
            },
            "name": "Test Milestone UAT 23 July",
            "emfRuleSetId": 126421625,
            "targetType": "SALES",
            "targetEntity": "TRANSACTION",
            "eventName": "TransactionAdd",
            "targetGroupId": 2514,
            "description": "Test Milestone UAT 23 July Update 2",
            "active": false,
            "expression": "true",
            "expressionJson": "\n{\n  \"arity\":\"literal\",\n  \"value\":\"true\",\n  \"type\":\"boolean:primitive\"\n}",
            "filters": [],
            "enrolmentMethod": "TRANSACTION",
            "defaultValues": [
                {
                    "id": 125985,
                    "periodId": 29318,
                    "defaultValue": 2000.000
                },
                {
                    "id": 125986,
                    "periodId": 29319,
                    "defaultValue": 2000.000
                },
                {
                    "id": 125987,
                    "periodId": 29320,
                    "defaultValue": 2000.000
                },
                {
                    "id": 125988,
                    "periodId": 29321,
                    "defaultValue": 2000.000
                },
                {
                    "id": 125989,
                    "periodId": 29322,
                    "defaultValue": 2000.000
                },
                {
                    "id": 125990,
                    "periodId": 29323,
                    "defaultValue": 2000.000
                },
                {
                    "id": 125991,
                    "periodId": 29324,
                    "defaultValue": 2000.000
                },
                {
                    "id": 125992,
                    "periodId": 29325,
                    "defaultValue": 2000.000
                },
                {
                    "id": 125993,
                    "periodId": 29326,
                    "defaultValue": 2000.000
                }
            ],
            "targetPeriodDefaultValuesMap": {
                "29318": {
                    "id": 125985,
                    "periodId": 29318,
                    "defaultValue": 2000.000
                },
                "29319": {
                    "id": 125986,
                    "periodId": 29319,
                    "defaultValue": 2000.000
                },
                "29320": {
                    "id": 125987,
                    "periodId": 29320,
                    "defaultValue": 2000.000
                },
                "29321": {
                    "id": 125988,
                    "periodId": 29321,
                    "defaultValue": 2000.000
                },
                "29322": {
                    "id": 125989,
                    "periodId": 29322,
                    "defaultValue": 2000.000
                },
                "29323": {
                    "id": 125990,
                    "periodId": 29323,
                    "defaultValue": 2000.000
                },
                "29324": {
                    "id": 125991,
                    "periodId": 29324,
                    "defaultValue": 2000.000
                },
                "29325": {
                    "id": 125992,
                    "periodId": 29325,
                    "defaultValue": 2000.000
                },
                "29326": {
                    "id": 125993,
                    "periodId": 29326,
                    "defaultValue": 2000.000
                }
            },
            "targetMilestoneTriggers": [
                {
                    "id": 418,
                    "triggerName": "Sub target 1",
                    "isActive": true,
                    "triggerType": "CUSTOM_TRIGGER",
                    "triggerValueType": "PERCENTAGE",
                    "triggerValue": 50.000,
                    "targetRuleId": 2711
                }
            ]
        }
    ],
    "errors": null,
    "warnings": null
}
{
  "data": [
    {
      "id": 39536,
      "attribution": {
        "createdOn": "2025-07-23T07:18:01.000+0000",
        "createdOnISO": "2025-07-23T07:18:01Z",
        "lastUpdatedOn": "2025-07-23T07:18:01.000+0000",
        "lastUpdatedOnISO": "2025-07-23T07:18:01Z",
        "lastUpdatedBy": {
          "id": 50691660,
          "code": "adm01",
          "description": "",
          "name": "adm01",
          "type": "TILL"
        },
        "createdBy": {
          "id": 50691660,
          "code": "adm01",
          "description": "",
          "name": "adm01",
          "type": "TILL"
        }
      },
      "name": "Fixed Window Milestone Group 1724657937",
      "active": true,
      "preferredTillId": 50692189,
      "activePeriod": {
        "id": 55434,
        "attribution": {
          "createdOn": "2024-08-26T12:50:11.000+0530",
          "lastUpdatedOn": "2024-08-26T12:50:11.000+0530",
          "lastUpdatedBy": {
            "id": 50691660,
            "code": "adm01",
            "description": "",
            "name": "adm01",
            "type": "TILL"
          },
          "createdBy": {
            "id": 50691660,
            "code": "adm01",
            "description": "",
            "name": "adm01",
            "type": "TILL"
          }
        },
        "startDate": "2024-08-20",
        "endDate": "2024-09-19",
        "refCode": "TP1",
        "periodStatus": "RUNNING",
        "targetGroupId": 39536,
        "active": true
      },
      "totalPeriods": 2,
      "description": "test via postman",
      "targetEvaluationType": "FIXED_CALENDAR_WINDOW",
      "recurringCycles": -1,
      "frequency": 0,
      "targetCycleStartDate": "2024-08-20T08:42:01.000Z",
      "targetCycleEndDate": "2024-10-20T08:42:01.000Z",
      "frequencyType": "MONTHLY",
      "trackingType": "DEFAULT",
      "createdOn": 1724657938000,
      "targets": [
        {
          "id": 71087,
          "attribution": {
            "createdOn": "2024-08-26T12:50:11.000+0530",
            "lastUpdatedOn": "2024-08-26T12:50:11.000+0530",
            "lastUpdatedBy": {
              "id": 50691660,
              "code": "adm01",
              "description": "",
              "name": "adm01",
              "type": "TILL"
            },
            "createdBy": {
              "id": 50691660,
              "code": "adm01",
              "description": "",
              "name": "adm01",
              "type": "TILL"
            }
          },
          "name": "target-2024-08-26T07:20:09.894Z",
          "emfRuleSetId": 1334912,
          "targetType": "COUNT",
          "targetEntity": "EVENT",
          "eventName": "TransactionAdd",
          "targetGroupId": 39536,
          "description": "targetf",
          "active": true,
          "expression": "true",
          "expressionJson": "{\"arity\":\"literal\",\"value\":\"true\",\"type\":\"boolean:primitive\"}",
          "enrolmentMethod": "IMPORT",
          "defaultValues": [
            {
              "id": 96664,
              "periodId": 55434,
              "defaultValue": 500
            },
            {
              "id": 96665,
              "periodId": 55435,
              "defaultValue": 500
            }
          ],
          "targetPeriodDefaultValuesMap": {
            "55434": {
              "id": 96664,
              "periodId": 55434,
              "defaultValue": 500
            },
            "55435": {
              "id": 96665,
              "periodId": 55435,
              "defaultValue": 500
            }
          },
          "extendedFieldInfo": {
            "name": "cartId",
            "aggregateFunction": "SUM",
            "aggregateWindow": null
          },
          "targetMilestoneTriggers": []
        }
      ],
      "userCreated": true
    }
  ],
  "errors": null,
  "warnings": null
}

Response parameters

ParameterTypeDescription
dataArrayList of objects containing the main data payload.
data[].idIntegerUnique identifier for the record.
data[].attributionObjectMetadata about the creation and updates of the record.
attribution.createdOnStringTimestamp when the record was created (ISO 8601 format).
attribution.createdOnISOStringTimestamp when the record was created with timezone included. (ISO 8601 format).
attribution.lastUpdatedOnStringTimestamp when the record was last updated. (ISO 8601 format).
attribution.lastUpdatedOnISOStringTimestamp when the record was last updated with timezone included. (ISO 8601 format).
attribution.lastUpdatedByObjectDetails of the user who last updated the record.
lastUpdatedBy.idIntegerUnique identifier of the user.
lastUpdatedBy.codeStringCode associated with the user.
lastUpdatedBy.descriptionStringDescription of the user (empty in this case).
lastUpdatedBy.nameStringName of the user.
lastUpdatedBy.typeStringType of the user (e.g., "TILL").
attribution.createdByObjectDetails of the user who created the record (same structure as lastUpdatedBy).
data[].nameStringName of the target group (e.g., "uat_target_group_32").
data[].emfRuleSetIdIntegerIdentifier for the EMF rule set.
data[].targetTypeStringType of target (e.g., "ALL").
data[].targetEntityStringEntity targeted (e.g., "TRANSACTION").
data[].eventNameStringName of the event (e.g., "TransactionAdd").
data[].targetGroupIdIntegerIdentifier for the target group.
data[].descriptionStringDescription of the target group (empty in this case).
data[].activeBooleanIndicates whether the target group is active.
data[].expressionStringLogical expression for the target group (e.g., "true").
data[].expressionJsonStringJSON representation of the expression.
data[].filtersArrayList of filters applied (empty in this case).
data[].enrolmentMethodStringMethod of enrolment (e.g., "IMPORT").
data[].defaultValuesArrayList of default values for the target group.
defaultValues[].idIntegerUnique identifier for the default value.
defaultValues[].periodIdIntegerIdentifier for the period associated with the default value.
defaultValues[].defaultValueFloatDefault value for the period.
data[].targetPeriodDefaultValuesMapObjectMapping of period IDs to their default values.
targetPeriodDefaultValuesMap.<periodId>ObjectDetails of the default value for the specified period.
<periodId>.idIntegerUnique identifier for the default value.
<periodId>.periodIdIntegerIdentifier for the period.
<periodId>.defaultValueFloatDefault value for the period.
data[].targetMilestoneTriggersArrayList of milestone triggers (empty in this case).
data[].extendedFieldInfoObjectAdditional information about the extended field.
extendedFieldInfo.nameStringName of the extended field (e.g., "points").
extendedFieldInfo.aggregateFunctionStringAggregation function for the field (e.g., "SUM").
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!