Get active targets

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
❗️

This API is being phased out and will no longer be available for viewing milestones.

To view milestones, use the Get Details of all Loyalty Promotions API


This API gets active targets for an enrolled customer.

A targetrefers to a specific value or event that a user needs to achieve within a given period to receive certain benefits. A target that is currently active for a user is an active target.

👍

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.

Example request

curl --location 'https://eu.api.capillarytech.com/v3/users/565039506/enrolledTargets' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bWFkaHVfcmMjU2YQ==' \
--header 'Cookie: _cfuvid=H_OUDqsSJh7q7aUlkRgBjVIMRBFDNp2ic0PI6VAnYzw-1762857476978-0.0.1.1-604800000'

Prerequisites

  • Basic authentication
  • Default access group

Resource information

URIv3/users\{userId\}/enrolledTargets
HTTP MethodGET
PaginationNo
Batch supportNo
Rate limit informationNone

Request Path Parameters

FieldData TypeDescription
userIDIntegerThe customer ID of the user. For more information refer to the Get Customer ID API.

Request query parameters

FieldData TypeDescription
targetRuleIdsLongRule ID of the target. targetRuleIds query parameter accepts the individual target ids that are generated while creation of a target or targets under a target group. You can add multiple rule IDs separated by commas.
trackingDateDateThe date when the target was created. Epoch time format
enrollmentTypeStringThe target enrollment type refers to the method used to enroll customers and set target values. Possible values are: TRANSACTION, IMPORT, and AUDIENCE_FILTER. <br> TRANSACTION: Enroll loyalty customers who transact during the target period. <br> IMPORT: Import a list of customers with custom target values.
includeOnlyUserCreatedBooleanInclude only the user-created targets. A user-created target is a promotion that rewards customers for achieving goals they set themselves.

Response body

{
  "data": [
    {
      "id": 2995,
      "attribution": {
        "createdOn": "2025-11-11T10:26:09.000+0000",
        "createdOnISO": "2025-11-11T10:26:09Z",
        "lastUpdatedOn": "2025-11-11T10:26:09.000+0000",
        "lastUpdatedOnISO": "2025-11-11T10:26:09Z",
        "lastUpdatedBy": {
          "id": 75160044,
          "code": "1739864914683_",
          "description": "",
          "name": "tom ",
          "type": "ADMIN_USER"
        },
        "createdBy": {
          "id": 75160044,
          "code": "1739864914683_",
          "description": "",
          "name": "madhurima ",
          "type": "ADMIN_USER"
        }
      },
      "name": "Run10Km",
      "emfRuleSetId": 126452799,
      "targetType": "SALES",
      "targetEntity": "TRANSACTION",
      "targetGroupId": 2749,
      "description": "Run 10 kilometers",
      "active": true,
      "expression": "true",
      "expressionJson": "\n{\n  \"arity\":\"literal\",\n  \"value\":\"true\",\n  \"type\":\"boolean:primitive\"\n}",
      "filters": [],
      "enrolmentMethod": "TRANSACTION",
      "targetPeriodDefaultValuesMap": {}
    },
    {
      "id": 2996,
      "attribution": {
        "createdOn": "2025-11-11T10:36:23.000+0000",
        "createdOnISO": "2025-11-11T10:36:23Z",
        "lastUpdatedOn": "2025-11-11T10:36:23.000+0000",
        "lastUpdatedOnISO": "2025-11-11T10:36:23Z",
        "lastUpdatedBy": {
          "id": 75160044,
          "code": "1739864914683_",
          "description": "",
          "name": "tom ",
          "type": "ADMIN_USER"
        },
        "createdBy": {
          "id": 75160044,
          "code": "1739864914683_",
          "description": "",
          "name": "tom ",
          "type": "ADMIN_USER"
        }
      },
      "name": "Run20Km",
      "emfRuleSetId": 126452805,
      "targetType": "SALES",
      "targetEntity": "TRANSACTION",
      "targetGroupId": 2750,
      "description": "Run 20 kilometers",
      "active": true,
      "expression": "true",
      "expressionJson": "\n{\n  \"arity\":\"literal\",\n  \"value\":\"true\",\n  \"type\":\"boolean:primitive\"\n}",
      "filters": [],
      "enrolmentMethod": "TRANSACTION",
      "targetPeriodDefaultValuesMap": {}
    }
  ],
  "errors": null,
  "warnings": null
}
{
    "data": [
        {
            "id": 2579,
            "attribution": {
                "createdOn": "2024-08-09T08:05:59.000+0000",
                "lastUpdatedOn": "2024-08-09T08:05:59.000+0000",
                "lastUpdatedBy": {
                    "id": 4,
                    "code": "First",
                    "description": null,
                    "name": "User",
                    "type": "ADMIN_USER"
                },
                "createdBy": {
                    "id": 4,
                    "code": "First",
                    "description": null,
                    "name": "User",
                    "type": "ADMIN_USER"
                }
            },
            "name": "Custom Enroll",
            "emfRuleSetId": 2030169,
            "emfUnrolledRulesetId": 2030168,
            "targetType": "GROSS_SALES",
            "targetEntity": "LINEITEM",
            "targetGroupId": 1898,
            "active": true,
            "expression": "true",
            "expressionJson": "\n{\n  \"arity\":\"literal\",\n  \"value\":\"true\",\n  \"type\":\"boolean:primitive\"\n}",
            "filters": [
                {
                    "entityType": "ZONE",
                    "entityIds": [
                        50674361,
                        50675571
                    ]
                }
            ],
            "enrolmentMethod": "IMPORT",
            "targetPeriodDefaultValuesMap": {}
        }
    ],
    "errors": null,
    "warnings": null
}
{
    "data": [
        {
            "id": 50,
            "attribution": {
                "createdOn": "2022-08-09T10:46:00.000+0000",
                "lastUpdatedOn": "2022-08-09T10:46:00.000+0000",
                "lastUpdatedBy": {
                    "id": 75015489,
                    "code": "1491395484_919600167818",
                    "description": "",
                    "name": "Achyuthanandan S",
                    "type": "ADMIN_USER"
                },
                "createdBy": {
                    "id": 75015489,
                    "code": "1491395484_919600167818",
                    "description": "",
                    "name": "Achyuthanandan S",
                    "type": "ADMIN_USER"
                }
            },
            "name": "Mentorship",
            "emfRuleSetId": 19029,
            "emfUnrolledRulesetId": 19028,
            "targetType": "SALES",
            "targetEntity": "LINEITEM",
            "targetGroupId": 40,
            "active": true,
            "expression": "currentTxn.basketAmountSumNonDiscounted>25",
            "expressionJson": "\n{\n  \"arity\":\"binary_operation\",\n  \"value\":\">\",\n  \"type\":\"boolean:primitive\",\n  \"operands\":[\n    {\n      \"arity\":\"object_dereference\",\n      \"type\":\"real:object:primitive\",\n      \"operands\":[\n        {\n          \"arity\":\"name\",\n          \"value\":\"currentTxn\",\n          \"type\":\"tx:object:primitive\"\n        },\n        {\n          \"arity\":\"name\",\n          \"value\":\"basketAmountSumNonDiscounted\",\n          \"type\":\"real:object:primitive\"\n        }\n      ]\n    },\n    {\n      \"arity\":\"literal\",\n      \"value\":\"25\",\n      \"type\":\"number:primitive\"\n    }\n  ]\n}",
            "filters": [
                {
                    "entityType": "STORE",
                    "entityIds": [
                        75027647,
                        75046489,
                        75027642,
                        75037225,
                        75051583,
                        75051591,
                        75036444,
                        75061222,
                        75027644,
                        75056850,
                        75056852,
                        75046525,
                        75052295,
                        75027631,
                        75046512,
                        75049264,
                        75049270,
                        75027635,
                        75027639,
                        75027637,
                        75043566,
                        75027640,
                        75049268,
                        75027632,
                        75055796,
                        75055797,
                        75061682,
                        75061683,
                        75061684,
                        75061685,
                        75052145,
                        75046491,
                        75027633,
                        75027634,
                        75027643,
                        75027641,
                        75027636,
                        75043257,
                        75043255,
                        75043253,
                        75049266,
                        75043181,
                        75043183,
                        75043185,
                        75043578,
                        75043576,
                        75056557,
                        75056559,
                        75045026,
                        75055010,
                        75055426,
                        75055427,
                        75049256,
                        75049272,
                        75049274,
                        75027648,
                        75027645,
                        75027646,
                        75027638,
                        75046490
                    ]
                }
            ],
            "enrolmentMethod": "TRANSACTION",
            "targetPeriodDefaultValuesMap": {}
        }
    ],
    "errors": null,
    "warnings": null
{
    "data": null,
    "errors": [
        {
            "code": 310011,
            "message": "Invalid userId"
        }
    ],
    "warnings": null
}
{
    "data": null,
    "errors": [
        {
            "code": 310130,
            "message": "Invalid enrollment type as input"
        }
    ],
    "warnings": null
}

Response parameter

FieldData TypeDescription
idIntegerUnique identifier for the target
attributionObjectAttributes of the target.
-createdOnString

Creation date and time for the target. ISO 8601 format.

Note: This field will be deprecated in the future and is being replaced by createdOnISO.

-createdOnISOString

Indicates the creation date and time of the target in ISO 8601 format, returned in the server's time zone.

EU server example
2025-12-16T14:30:45Z → 16 December 2025, 14:30:45 (UTC)

India server example
2025-12-16T14:30:45+05:30 → 16 December 2025, 14:30:45 (IST)

Note: The response time zone always matches the server time zone, regardless of the time zone offset in the request.

-lastUpdatedOnString

Last updated date and time for the target. ISO 8601 format.

Note: This field will be deprecated in the future and is being replaced by lastUpdatedOnISO.

-lastUpdatedOnISOString

Indicates the last updated date and time of the target in ISO 8601 format, returned in the server's time zone.

EU server example
2025-12-16T14:30:45Z → 16 December 2025, 14:30:45 (UTC)

India server example
2025-12-16T14:30:45+05:30 → 16 December 2025, 14:30:45 (IST)

Note: The response time zone always matches the server time zone, regardless of the time zone offset in the request.

-lastUpdatedByObjectDetails on the latest updates of the target
--idIntegerID of the last user who updated the target.
--descriptionStringDescription related information of the last user who updated the target.
--nameStringName of the last user who updated the target.
--typeStringType of the last user who updated the target. <br>Standard User: Limited access to their own profile; cannot manage users/permissions; permissions must be assigned by an Org Owner or Admin. <br>Admin User: Can manage Standard Users and permissions, with additional admin abilities beyond a Standard User. <br>Org Owner: Full authority over the organization, managing all users/permissions, with access to all modules; must be at least one per organization.
-createdByObjectDetails on the creation of the target.
--idIntegerID of the user who created the target.`
--descriptionStringDescription related information of the user who created the target.
--nameStringName of the user who created the target.
--typeStringType of the user who created the target. <br>Standard User: Limited access to their own profile; cannot manage users/permissions; permissions must be assigned by an Org Owner or Admin. <br>Admin User: Can manage Standard Users and permissions, with additional admin abilities beyond a Standard User. <br>Org Owner: Full authority over the organization, managing all users/permissions, with access to all modules; must be at least one per organization.
nameStringName of the target
emfRuleSetIdIntegerID of the rule set associated with the The Event Management Framework (EMF) This refers to various customer-level events within loyalty workflows, such as return transactions and points redemptions.
targetTypeStringType of target. <br>COUNT: This type tracks the number of times a specific action or event occurs. <br>VISIT: This type tracks the number of visits or occurrences of a specific event. <br>SUM: This type is used when the target involves summing up values, such as the total amount spent or the total number of items added to a cart.
targetEntityStringType of target entity. <br>TRANSACTION and LINEITEM: transactional KPIs <br>EVENT: behavioral events and EMF events <br>To , use REWARDS: rewards-based metrics, such as points
targetGroupIdIntegerGroup ID of the target. Target groups are entities within which individual targets can be created.
activeBooleanIndicates whether the target is active or not.
expressionStringThe expression associated with the target.
expressionJsonString (JSON)JSON representation of the expression.
filtersArrayList of filters applied to the target.
enrolmentMethodStringThe method of enrolment for the target. Supported values: TRANSACTION, IMPORT
targetPeriodDefaultValuesMapArrayLists the default target period and ID. A target period is a specific time frame within a target group during which certain goals or milestones are set to be achieved.
errorsObjectList of errors, if any.
warningsObjectList of warnings, if any.

Error codes

CodeDescription
310011Invalid userId
310130Invalid enrollment type as input
Query Params
int64
date
string
boolean
Headers
string
string
string
string
Response

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json