Get top ranked users

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

The API fetches a ranked list of users who have achieved a target within a timeframe

šŸ‘

Note

For detailed information about our APIs and for hands-on testing, refer documentation on API overview and step-by-step guide on making your first API call.

Prerequisites

  • Authentication: Basic/OAuth authentication
  • Default access group
  • Enable leaderboards for the organisation.
  • Create a target milestone or streak.
  • Enable leaderboards for the milestone or streak

Resource Information

URIapi_gateway/intouch-api-v3/v3.1/leaderboards/targetGroups\{targetGroup\}
HTTP MethodGET
PaginationYes
Rate limit informationNA

API Endpoint Example

https://eu.api.capillarytech.com/api_gateway/intouch-api-v3/v3.1/leaderboards/targetGroups/232?targetId=366&periodId=243&pageOffset=4&pageSize=10

Headers

HeaderDescription
DATA-SCOPE-ORGList of Organisation IDs
DATA-SCOPEScopes define what data can be accessed using the API. You can use scopes to control access to data from a parent or child organisation. Defining a scope ensures that the response contains only data from the respective organisation. Supported headers: SELF, OTHER and ALL. Refer to connected orgs data scopes for more information.

Request path parameters

Request path parameters

ParametersTypeDescription
targetGroupIdIntegerThe ID of the target group. A target group is an entity that contains targets.

Request query parameters

Parameter Note: Parameters marked with * are mandatory.TypeDescription
targetId*LongThe ID of the target. A target is a set of conditions or rules that need to be met to achieve a specific goal.
periodIdLongThe period ID of the target. A period is a set of parameters that define the timeframe for a target. If periodId is not provided, the current period of the target group will be used.
pageSizeIntegerThe number of results required. For example, to view the top five ranks only, set the value to 5.
pageOffsetIntegerThe start page from which data retrieval starts. This value should not be negative. For example, a value of 5 indicates that data retrieval will begin from the 4th page.
pageLimitIntegerNumber of pages from which results are displayed. A maximum of 100 pages can be viewed in one request.

Response body

"pagination": {
    "limit": 3,
    "offset": 0,
    "total": 4527
},
"data": {
    "lastSyncTime": "2024-06-24T17:37:00.000IST",
    "lastSyncTimeISO": "2024-06-24T12:07:00.000Z",
    "targetGroupId": 232,
    "targetGroupName": "Target",
    "periodId": 243,
    "periodRefCode": "target_period",
    "targetRuleId": 366,
    "targetRuleName": "target1",
    "rankings": [
        {
            "rank": 1,
            "userId": 381329844,
            "achievedValue": 21000,
            "lastActivityTime": "2022-11-25T21:44:40.000IST",
            "lastActivityTimeISO": "2022-11-25T16:14:40.000Z",
            "userEnrichmentDetails": {
                "birthday": "NOT-CAPTURED",
                "gender": "Male",
                "mobile": "Sawyer",
                "last_name": "To",
                "first_name": "Sawyer",
                "anniversary": "NOT-CAPTURED",
                "email": "[email protected]"
            }
        },
        {
            "rank": 2,
            "userId": 381332324,
            "achievedValue": 21000,
            "lastActivityTime": "2022-11-29T00:14:48.000IST",
            "lastActivityTimeISO": "2022-11-28T18:44:48.000Z",
            "userEnrichmentDetails": {
                "birthday": "NOT-CAPTURED",
                "gender": "Male",
                "mobile": "919988221101",
                "last_name": "Finn",
                "first_name": "Huckleberry",
                "anniversary": "NOT-CAPTURED",
                "email": "[email protected]"
            }
        },
        {
            "rank": 3,
            "userId": 381333386,
            "achievedValue": 21000,
            "lastActivityTime": "2022-11-29T13:48:28.000IST",
            "lastActivityTimeISO": "2022-11-29T08:18:28.000Z",
            "userEnrichmentDetails": {
                "birthday": "NOT-CAPTURED",
                "gender": "Male",
                "mobile": "919988221102",
                "last_name": "Crusoe",
                "first_name": "Robinson",
                "anniversary": "NOT-CAPTURED",
                "email": "robinson.crusoe@capillaryte"
            }
        }
    ]
},
"errors": [],
"warnings": []

Response parameters

Parameters

Type

Description

pagination

Object

Object containing pagination details.

– limit

String

Number of entries per page.

– offset

String

Page number of the current result set.

– total

String

Total number of entries.

data

Object

Object containing details of the leaderboard.

– lastSyncTime

String

Time when data was updated Supported format: YYYY-MM-DDTHH:MM:SS.000z.
Note: This field will be deprecated in the future and is being replaced by lastSyncTimeISO.

– lastSyncTimeISO

Indicates the last sync date and time in ISO 8601 format, returned in the server 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.

–targetGroupId

Integer

The unique ID of the target group. A target group contains an array of targets.

–targetGroupName

String

Unique name of the target group.

–periodId

Integer

Unique ID of the target period. A period is a set of parameters that define the timeframe for a target.

–periodRefCode

String

Unique name of the target period.

–targetRuleId

Integer

Unique ID of the target rule. A target rule is a set of parameters that define the rules for achieving a target.

–targetRuleName

String

Unique name of the target rule.

–rankings

Object

Object containing user ranking details.

–rank

Integer

Rank of the user.

–userId

Integer

Unique identifier of the customer.

–achievedValue

Integer

The achieved value of the customer in the period. Example: If the customer has earned 5000 points, the value will be 5000.

–lastActivityTime

String

Last activity time Supported format: YYYY-MM-DDTHH:MM:SS.000z.

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

-lastActivityTimeISO

DateTime

Indicates the last activity's date and time in ISO 8601 format, returned in the server 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.

--mobile

Integer

Mobile number associated with the user.

–userEnrichmentDetails

Object

An object containing information related to the user.

--birthday

String

Birthday of the user.

gender

String

Gender of the user.

--last_name

String

Last name of the user.

--first_name

String

First name of the user.

--anniversary

String

Anniversary date of the user.

--email

String

Email address associated with the user.

API-specific warnings and errors

Error Code

Description

Reason


Page offset can not be in negative, fetching the first page by default

The page offset value is negative.


Page Size can not be more than 100, capping the page size to 100

The page size value is more than the supported limit of 100.

310133

Leaderboards are not enabled for the following orgs

Leaderboards are not enabled for the organisation.

310017

Target group not found or deactivated

The target group passed is either invalid or currently inactive.

310134

Leaderboard is not enabled for the target group

Leaderboard is not enabled for the requested target group.

310079

target rule id doesn't belong to target group

The target rule ID passed does not belong to the target group or is invalid.

310118

Target Period not found for the target

The target period ID passed does not belong to the target group or is invalid or does not exist.

Path Params
string
required
Query Params
int64
required

The ID of the target. A target is a set of conditions or rules that need to be met to achieve a specific goal.

int64

The period ID of the target. A period is a set of parameters that define the timeframe for a target. If periodId is not provided, the current period of the target group will be used.

int32

The number of results required. For example, to view the top five ranks only, set the value to 5.

int32

The start page from which data retrieval starts. This value should not be negative. For example, a value of 5 indicates that data retrieval will begin from the 5th page.

int32

Number of pages from which results are displayed. A maximum of 100 pages can be viewed in one request.

Headers
string

List of Organisation IDs

string

Scopes define what data can be accessed using the API. You can use scopes to control access to data from a parent or child organisation. Defining a scope ensures that the response contains only data from the respective organisation. Supported headers: SELF, OTHER and ALL.

Responses

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