| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
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 fetches the events that are associated with a target or streak for a customer. Enter a userId (customer Id) and the targetRuleId of the target the customer is enrolled in to fetch the data of the customer events (behavioural and non-behavioural).
NoteFor detailed information about the APIs and for hands-on testing, refer to the API overview documentation and step-by-step guide on making your first API call.
Prerequisites
- Authentication: Basic/OAuth authentication
- Default access group
Resource Information
| URI | /users/USERID/trackedTargetEvents/{targetRuleId} |
| HTTP method | GET |
| Pagination | Yes. Sorting is not supported. Results are displayed in chronological order. |
| Rate limit | NA |
| Batch support | NA |
API cURL example
curl --location 'https://eu.api.capillarytech.com/v3/users/564332013/trackedTargetEvents/1986?periodId=9889&limit=5&offset=0' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic bmFtYW5fZG9jOmEzY2I2MmEy' \
--header 'Cookie: _cfuvid=zcU0pObn4E.A.gGF79a_o-1737693237027-0.0.1.1-604800000'Path parameters
| Parameter Name | Data Type | Description |
|---|---|---|
| userId | Long | Unique ID of the customer. |
| targetRuleId | Long | Unique ID of the target rule. |
Use the Get associated target groups of a user API to fetch the targetRuleId for a customer enrolled in a milestone target. |
Query parameters
| Parameter Name | Data Type | Description |
|---|---|---|
periodId | Long | Unique ID of the target period. Provide a periodId to filter events for a specific time period / target cycle within the target. Use the Get target periods API and use the targetGroupId of the target to fetch the periodId for a customer enrolled in a milestone / target. |
limit | Integer | Number of events to display per page. For example, if the total events are 15 and the limit is 5, the first page will display the first 5 events. |
offset | Integer | Page number to retrieve. To view the first page, set the value to 0. |
| periodId | Long | Unique ID of the target period. Provide a periodId to filter events for a specific time period target cycle within the target. |
Response parameters
| Parameter | Description |
|---|---|
| pagination | Object containing details of the page. |
| .limit | Number of events displayed on the page. |
| .offset | Current page number. |
| .total | Total number of pages. |
| data | Object containing details of the events. |
| .eventLogId | Unique ID of the event that is triggered. |
| .eventName | Name of the event. Possible values: GENERIC_EVENT, ADD_TRANSACTION, RETURN_BILL, ENROL, UNENROL |
| .customerId | Unique ID of the customer who triggered the event. |
| .eventDisplayName | Unique name of the behavioral event that is triggered. null for transactional events. |
| .uniqueId | Unique ID of the event. Behavioral: requestId. Non-behavioral: eventSubjectId. |
| .eventDate | Date when the event is triggered in ISO 8601 format. Note: This field will be deprecated in the future and is being replaced by eventDateISO. |
| .eventDateISO | Indicates the creation date and time of the event 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. |
| .eventProcessedDate | Date when the event is processed ISO 8601 format. Note: This field will be deprecated in the future and is being replaced by eventProcessedDateISO. |
| .eventProcessedDateISO | Indicates the creation date and time when the event was processed 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. |
| .periodId | Unique ID of the target period. |
| .targetGroupId | Unique ID of the target group. |
| .targetRuleId | Unique ID of the target rule. |
| .targetValue | Total transaction amount for transactional events; always 1.000 for behavioral events. |
| errors | Object containing errors, if any. |
| warnings | Object containing warnings, if any. |
{
"pagination": {
"limit": 10,
"offset": 0,
"total": 4
},
"data": [
{
"eventLogId": -1,
"eventName": "ENROL",
"customerId": 564709342,
"eventDisplayName": null,
"uniqueId": null,
"eventDate": null,
"eventProcessedDate": null,
"eventDateISO": null,
"eventProcessedDateISO": null,
"periodId": 29318,
"targetGroupId": 2514,
"targetRuleId": 2711,
"targetValue": 999
},
{
"eventLogId": 636678134,
"eventName": "ADD_TRANSACTION",
"customerId": 564709342,
"eventDisplayName": null,
"uniqueId": "889282751",
"eventDate": "2025-07-29 04:00:00.0",
"eventProcessedDate": "2025-07-29 04:00:00.0",
"eventDateISO": "2025-07-29T04:00:00Z",
"eventProcessedDateISO": "2025-07-29T04:00:00Z",
"periodId": 29324,
"targetGroupId": 2514,
"targetRuleId": 2711,
"targetValue": 20
},
{
"eventLogId": 636678182,
"eventName": "ADD_TRANSACTION",
"customerId": 564709342,
"eventDisplayName": null,
"uniqueId": "889282761",
"eventDate": "2025-07-29 04:00:00.0",
"eventProcessedDate": "2025-07-29 04:00:00.0",
"eventDateISO": "2025-07-29T04:00:00Z",
"eventProcessedDateISO": "2025-07-29T04:00:00Z",
"periodId": 29324,
"targetGroupId": 2514,
"targetRuleId": 2711,
"targetValue": 20
},
{
"eventLogId": 636678190,
"eventName": "ADD_TRANSACTION",
"customerId": 564709342,
"eventDisplayName": null,
"uniqueId": "889282764",
"eventDate": "2025-07-29 04:00:00.0",
"eventProcessedDate": "2025-07-29 04:00:00.0",
"eventDateISO": "2025-07-29T04:00:00Z",
"eventProcessedDateISO": "2025-07-29T04:00:00Z",
"periodId": 29324,
"targetGroupId": 2514,
"targetRuleId": 2711,
"targetValue": 1959
}
],
"errors": [],
"warnings": []
}{
"pagination": {
"limit": 1,
"offset": 0,
"total": 2
},
"data": [
{
"eventLogId": 31748158,
"eventName": "GENERIC_EVENT",
"customerId": 387544807,
"eventDisplayName": "testBehavioural",
"uniqueId": "6621dee9-6c2a-43ad-aa41-be2bf138de04",
"eventDate": "2024-12-05 00:00:00.0",
"eventProcessedDate": "2024-12-12 18:42:52.0",
"periodId": 77865,
"targetGroupId": 52065,
"targetRuleId": 79192,
"targetValue": 1.000
}
],
"errors": [],
"warnings": []
}{
"pagination": {
"limit": 30,
"offset": 0,
"total": 2
},
"data": [
{
"eventLogId": 615460983,
"eventName": "ADD_TRANSACTION",
"customerId": 564332013,
"eventDisplayName": null,
"uniqueId": "881101809",
"eventDate": "2025-01-22 14:00:00.0",
"eventProcessedDate": "2025-01-22 14:00:00.0",
"periodId": 9889,
"targetGroupId": 1717,
"targetRuleId": 1986,
"targetValue": 1000
},
{
"eventLogId": 615461137,
"eventName": "ADD_TRANSACTION",
"customerId": 564332013,
"eventDisplayName": null,
"uniqueId": "881101873",
"eventDate": "2025-01-22 14:00:00.0",
"eventProcessedDate": "2025-01-22 14:00:00.0",
"periodId": 9889,
"targetGroupId": 1717,
"targetRuleId": 1986,
"targetValue": 1000
}
],
"errors": [],
"warnings": []
}API error codes
| Error Code | Description | Reason |
|---|---|---|
| 310019 | Target period not found | periodId is incorrect or invalid. |
| 310018 | Target rule not found | ruleId is incorrect or invalid. |
| 310011 | Invalid userId | userId is incorrect or invalid. |
| 310149 | No record found in user target for given UserId and TargetId | No events are recorded for the user. |
