Get constraints catalog

This endpoint returns the constraints catalog available in the business.

GET /api/v2/businesses/{businessId}/constraints/catalog

If the data provided in the request is correct —businessId—, the response will include the information defined for each constraint, including its identifier and parameters schema.

Response example

[
    {
        "parameters_schema": {
            "weekDays": {
                "type": "WEEK_ISO_DAYS",
                "optional": false
            }
        },
        "id": "constraint.days_off_after_free_weekend"
    },
    {
        "parameters_schema": {
            "min": {
                "type": "TIME",
                "defaultValue": 9720.0,
                "optional": true
            },
            "max": {
                "type": "TIME",
                "defaultValue": 12000.0,
                "optional": false
            }
        },
        "id": "constraint.monthly_net_hours_limit"
    }
]
Details
  • parameters_schema. Map of configurable parameters for the constraint, where each key is the parameter name.

    • <parameter name>. Identifying name of the parameter within the constraint (e.g., weekDays, min, max, etc.).

      • type. Data type of the parameter: BOOLEAN, DATE, DECIMAL, INTEGER, LOCATION, PERCENTAGE, STRING, TIME, TIME_SLOTS, WEEK_ISO_DAYS, etc.

      • defaultValue. Default value of the parameter. Only present when the parameter has a predefined value in the system.

      • optional. Indicates whether the parameter is optional (true) or required (false) when configuring the constraint.

  • id. Unique identifier of the constraint in the system.

The example shows two constraints from the catalog:

  • constraint.days_off_after_free_weekend. Requires a single parameter, weekDays, of type WEEK_ISO_DAYS, which is mandatory.

  • constraint.monthly_net_hours_limit. Accepts two parameters of type TIME: an optional minimum and a mandatory maximum, both with default values.

Considerations

The response includes all constraints defined in the system that can be applied to the employees of the business.

The parameters of each constraint vary depending on how the constraint is configured.

What is a constraint?