Get counters by service - assignments only

This endpoint allows querying the counter data of a service for a period not exceeding 366 days. Only assignments will be considered for the calculation.

GET /api/v2/businesses/{businessId}/services/{serviceId}/counters-with-only-assignments?businessCounterIds={id}&from={yyyy-MM-dd}&to={yyyy-MM-dd}

The identifiers to be used in the URL (businessCounterIds) are those linking the business to the counter. These identifiers can be consulted here.

If the request is correct, the response will contain the counter data specified in the URL.

Response example

GET /api/v2/businesses/BUSINESSID/services/SERVICEID/counters-with-only-assignments?businessCounterIds=4035&from=2026-08-18&to=2026-08-21
[
    {
        "counter": {
            "id": 4035,
            "counterType": {
                "id": 1,
                "key": "counter.weekly_net_hours",
                "shortName": "HNS",
                "scope": "WEEK",
                "dataType": "TIME"
            },
            "customName": "Net hours",
            "customShortName": "HN"
        },
        "counts": [
            {
                "key": "HNS_HN_20260817_20260823",
                "from": "2026-08-17",
                "to": "2026-08-23",
                "total": [
                    {
                        "employeeId": "1006350",
                        "count": 360.0,
                        "dailyCount": [
                            {
                                "day": "2026-08-19",
                                "count": 120
                            },
                            {
                                "day": "2026-08-18",
                                "count": 240
                            }
                        ]
                    },
                    {
                        "employeeId": "170326",
                        "count": 0.0,
                        "dailyCount": []
                    }
                ]
            }
        ]
    }
]
Details
  • counter: counter information.

    • id: identifier of the Business Counter (link between the business and the counter type).

    • counterType: counter type information.

      • id: internal identifier of the counter type.

      • key: counter type key defined internally.

      • shortName: abbreviation of the counter type.

      • scope: temporal scope of the counter (WEEK, MONTH, YEAR, etc.).

      • dataType: data type of the counter (TIME, INTEGER, etc.).

    • customName: custom name of the counter, present only if a custom configuration has been defined.

    • customShortName: custom abbreviation of the counter, present only if a custom abbreviation has been defined.

  • counts: list of periods with the counter values.

    • key: key identifying the calculation period.

    • from: start date of the calculation period.

    • to: end date of the calculation period.

    • total: list of values per employee in the period.

      • employeeId: external identifier of the employee.

      • count: counter value for the indicated period.

      • dailyCount: daily breakdown of the counter value for the employee. If there are no values, an empty array [] will appear.

        • day: date the value corresponds to.

        • count: counter value for that day.

In this example, the counter shows the weekly net hours worked by each employee, expressed in minutes.

Considerations

The response will depend on the counter’s configuration, such as its scope (weekly, monthly, yearly, etc.) or its data type (minutes, number of days, etc.).

Data for multiple counters can be retrieved in the same request by including different identifiers in the URL, separated by commas: ?businessCounterIds=id1,id2,…​.

If there is no data affecting the counter for the period specified in the URL, it will display "count": 0.0.

Employees who do not have an external identifier configured in the system (employeeId) will appear in the response without this field.

Error codes

In addition to the common errors, this endpoint can return the following codes:

Code Message Description

-

No value present

One of the identifiers indicated in businessCounterIds does not match one of the business’s counters.

406 Not Acceptable

The request exceded the maximum number of days allowed (366 days max)

The requested period between from and to exceeds the 366 days allowed.

What is a counter?

What is an assignment?