Employment Hero LogoEmployment Hero

Labour Rule

Returns a paginated list of labour rules for the organisation. Optionally filter by work_site_id to retrieve rules for a specific work site. When work_site_id is omitted, rules for all work sites the caller can see are returned.

GET
https://api.employmenthero.com/api/v1/organisations/:organisation_id/labour_rules

Path Parameters

organisation_iduuidrequired

The ID of the organisation.

Query Parameters

work_site_iduuid

Filter labour rules to a specific work site. When omitted, returns rules for all work sites the caller can see.

page_indexinteger

Page number (1-based). Defaults to 1.

item_per_pageinteger

Number of results per page. Defaults to 20. Maximum 100.

Response Body

Returns a paginated list of labour rules for the organisation.

dataobject

Paginated list of labour rules.

itemsobject[]

Array of labour rule objects.

item_per_pageinteger

Number of items per page.

page_indexinteger

Current page number.

total_itemsinteger

Total number of matching labour rules.

total_pagesinteger

Total number of pages.

Example

curl -X GET \  "https://api.employmenthero.com/api/v1/organisations/:organisation_id/labour_rules" \  -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ"

Response

{  "data": {    "items": [      {        "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",        "name": "Weekend Lunch Rush",        "coverage_type": "linear",        "metric_type": "gross_sales",        "metric_reporting_type_id": null,        "metric_forecasted": false,        "coverage_definition": {          "minimum_headcount": 2,          "step_headcount": 1,          "per_dollar_step_size": 500,          "maximum_headcount": null        },        "run_time_type": "within_operating_hours",        "start_buffer_amount": 0.5,        "start_buffer_direction": "before",        "end_buffer_amount": 0.5,        "end_buffer_direction": "after",        "work_site": {          "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",          "name": "City Store"        },        "hr_positions": [          {            "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",            "name": "Floor Staff"          }        ],        "disabled": false,        "disabled_reason": null      }    ],    "item_per_page": 20,    "page_index": 1,    "total_items": 1,    "total_pages": 1  }}

Returns the full details of a single labour rule by ID, including its disabled and disabled_reason state. Disabled rules remain readable.

GET
https://api.employmenthero.com/api/v1/organisations/:organisation_id/labour_rules/:id

Path Parameters

organisation_iduuidrequired

The ID of the organisation.

iduuidrequired

The ID of the labour rule.

Response Body

Returns the full details of the specified labour rule.

dataobject
iduuid

Unique identifier for the labour rule.

namestring

Name of the labour rule. Must be unique within the organisation.

coverage_typeenum<string>

How headcount coverage is determined. "linear" adds headcount in steps as the metric value grows; "range" picks headcount from a step table.

metric_typeenum<string>

The sales metric used to calculate required headcount.

metric_reporting_type_idstring

ID of the reporting type (e.g. a specific sales category or order type). Required when metrictype is "category" or "ordertype".

metric_forecastedboolean

Whether the metric uses forecasted data rather than actual data.

coverage_definitionobject

Definition of coverage requirements. Shape depends on coverage_type — see create/update docs for details.

run_time_typeenum<string>

When the labour rule is active. "anytime" applies at any time; "withinoperating_hours" applies only within the work site's operating hours.

start_buffer_amountnumber

Buffer duration (in hours, in 0.5-hour increments) before the start of operating hours. Only valid when runtimetype is "withinoperatinghours".

start_buffer_directionenum<string>

Whether the start buffer extends before or after the operating hours start. Only valid when runtimetype is "withinoperatinghours".

end_buffer_amountnumber

Buffer duration (in hours, in 0.5-hour increments) after the end of operating hours. Only valid when runtimetype is "withinoperatinghours".

end_buffer_directionenum<string>

Whether the end buffer extends before or after the operating hours end. Only valid when runtimetype is "withinoperatinghours".

work_siteobject

The work site this labour rule belongs to.

hr_positionsobject[]

Positions currently assigned to this labour rule.

disabledboolean

Whether the labour rule currently cannot take effect — either its work site is archived, or every position assigned to it is archived/deleted. Disabled rules remain readable, updatable and deletable.

disabled_reasonenum<string>

Reason the rule is disabled. Null when the rule is active.

Example

curl -X GET \  "https://api.employmenthero.com/api/v1/organisations/:organisation_id/labour_rules/:id" \  -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ"

Response

{  "data": {    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",    "name": "Weekend Lunch Rush",    "coverage_type": "linear",    "metric_type": "gross_sales",    "metric_reporting_type_id": null,    "metric_forecasted": false,    "coverage_definition": {      "minimum_headcount": 2,      "step_headcount": 1,      "per_dollar_step_size": 500,      "maximum_headcount": null    },    "run_time_type": "within_operating_hours",    "start_buffer_amount": 0.5,    "start_buffer_direction": "before",    "end_buffer_amount": 0.5,    "end_buffer_direction": "after",    "work_site": {      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",      "name": "City Store"    },    "hr_positions": [      {        "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",        "name": "Floor Staff"      }    ],    "disabled": false,    "disabled_reason": null  }}

Creates a new labour rule for a work site. The fields each coverage_type requires are listed in the coverage_definition parameter.

POST
https://api.employmenthero.com/api/v1/organisations/:organisation_id/labour_rules

Path Parameters

organisation_iduuidrequired

The ID of the organisation.

Request Body

work_site_iduuidrequired

ID of the work site this labour rule belongs to.

namestringrequired

Name of the labour rule. Must be unique within the organisation.

coverage_typeenum<string>required

How headcount coverage is determined. "linear" adds headcount in steps as the metric value grows; "range" picks headcount from a step table.

metric_typeenum<string>required

The sales metric used to calculate required headcount.

metric_reporting_type_idstring

ID of the reporting type. Required when metrictype is "category" or "ordertype".

metric_forecastedbooleanrequired

Whether to use forecasted metric data rather than actual data.

coverage_definitionobjectrequired

Coverage requirements definition. Shape depends on coverage_type:

linear — requires: minimum_headcount (positive number), step_headcount (positive number), per_dollar_step_size (positive number). Optional: maximum_headcount (positive number ≥ minimumheadcount). Headcount = minimum_headcount + step_headcount × floor(metric value ÷ per_dollar_step_size), capped at `maximumheadcount` when set.

range — requires: steps array with at least 2 objects, each with headcount (> 0), from (≥ 0), and to (> from, or null on the last step).

hr_position_idsuuid[]

IDs of positions to assign to the new rule. Defaults to none when omitted.

run_time_typeenum<string>

When the labour rule is active. "anytime" applies at any time; "withinoperating_hours" applies only within the work site's configured operating hours.

start_buffer_amountnumber

Buffer duration in hours (0.5-hour increments) before or after operating hours start. Only valid when runtimetype is "withinoperatinghours".

start_buffer_directionenum<string>

Direction of the start buffer relative to operating hours start. Only valid when runtimetype is "withinoperatinghours".

end_buffer_amountnumber

Buffer duration in hours (0.5-hour increments) before or after operating hours end. Only valid when runtimetype is "withinoperatinghours".

end_buffer_directionenum<string>

Direction of the end buffer relative to operating hours end. Only valid when runtimetype is "withinoperatinghours".

Response Body

Returns the full details of the newly created labour rule.

dataobject
iduuid

Unique identifier for the labour rule.

namestring

Name of the labour rule. Must be unique within the organisation.

coverage_typeenum<string>

How headcount coverage is determined. "linear" adds headcount in steps as the metric value grows; "range" picks headcount from a step table.

metric_typeenum<string>

The sales metric used to calculate required headcount.

metric_reporting_type_idstring

ID of the reporting type (e.g. a specific sales category or order type). Required when metrictype is "category" or "ordertype".

metric_forecastedboolean

Whether the metric uses forecasted data rather than actual data.

coverage_definitionobject

Definition of coverage requirements. Shape depends on coverage_type — see create/update docs for details.

run_time_typeenum<string>

When the labour rule is active. "anytime" applies at any time; "withinoperating_hours" applies only within the work site's operating hours.

start_buffer_amountnumber

Buffer duration (in hours, in 0.5-hour increments) before the start of operating hours. Only valid when runtimetype is "withinoperatinghours".

start_buffer_directionenum<string>

Whether the start buffer extends before or after the operating hours start. Only valid when runtimetype is "withinoperatinghours".

end_buffer_amountnumber

Buffer duration (in hours, in 0.5-hour increments) after the end of operating hours. Only valid when runtimetype is "withinoperatinghours".

end_buffer_directionenum<string>

Whether the end buffer extends before or after the operating hours end. Only valid when runtimetype is "withinoperatinghours".

work_siteobject

The work site this labour rule belongs to.

hr_positionsobject[]

Positions currently assigned to this labour rule.

disabledboolean

Whether the labour rule currently cannot take effect — either its work site is archived, or every position assigned to it is archived/deleted. Disabled rules remain readable, updatable and deletable.

disabled_reasonenum<string>

Reason the rule is disabled. Null when the rule is active.

Example

curl -X POST \  "https://api.employmenthero.com/api/v1/organisations/:organisation_id/labour_rules" \  -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ" \  -H "Content-Type: application/json" \  -d '{    "work_site_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",    "name": "Weekend Lunch Rush",    "coverage_type": "linear",    "metric_type": "gross_sales",    "metric_forecasted": false,    "coverage_definition": {      "minimum_headcount": 2,      "step_headcount": 1,      "per_dollar_step_size": 500    },    "hr_position_ids": [      "c3d4e5f6-a7b8-9012-cdef-123456789012"    ],    "run_time_type": "within_operating_hours",    "start_buffer_amount": 0.5,    "start_buffer_direction": "before",    "end_buffer_amount": 0.5,    "end_buffer_direction": "after"  }'

Response

{  "data": {    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",    "name": "Weekend Lunch Rush",    "coverage_type": "linear",    "metric_type": "gross_sales",    "metric_reporting_type_id": null,    "metric_forecasted": false,    "coverage_definition": {      "minimum_headcount": 2,      "step_headcount": 1,      "per_dollar_step_size": 500,      "maximum_headcount": null    },    "run_time_type": "within_operating_hours",    "start_buffer_amount": 0.5,    "start_buffer_direction": "before",    "end_buffer_amount": 0.5,    "end_buffer_direction": "after",    "work_site": {      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",      "name": "City Store"    },    "hr_positions": [      {        "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",        "name": "Floor Staff"      }    ],    "disabled": false,    "disabled_reason": null  }}

Partially updates an existing labour rule. All fields are optional — only the fields present in the request body are updated; every other field (including work_site_id) keeps its current value.

coverage_definition is fully replaced when provided; partial updates to it are not supported.

hr_position_ids has special omit-vs-empty semantics:

  • Omit the key to leave the rule's current position assignments untouched.
  • Pass an explicit [] to clear every assignment.
  • Pass a list of position IDs to replace the assignments with exactly that list.

Re-assigning an active position to a rule that was disabled only because all of its positions were archived or deleted re-enables it. A disabled rule can still be updated.

PATCH
https://api.employmenthero.com/api/v1/organisations/:organisation_id/labour_rules/:id

Path Parameters

organisation_iduuidrequired

The ID of the organisation.

iduuidrequired

The ID of the labour rule to update.

Request Body

work_site_iduuid

ID of the work site to move the rule to. Omit to keep the current work site.

namestring

Updated name. Must be unique within the organisation.

coverage_typeenum<string>

How headcount coverage is determined.

metric_typeenum<string>

The sales metric used to calculate required headcount.

metric_reporting_type_idstring

ID of the reporting type. Required when metrictype is "category" or "ordertype".

metric_forecastedboolean

Whether to use forecasted metric data.

coverage_definitionobject

Full replacement of the coverage definition. Shape depends on coverage_type — see create docs for details.

hr_position_idsuuid[]

Omit to leave current assignments untouched; pass [] to clear them; pass a list of IDs to replace the assignments with exactly that list.

run_time_typeenum<string>

When the labour rule is active.

start_buffer_amountnumber

Buffer duration in hours (0.5-hour increments) at the start of operating hours. Only valid when runtimetype is "withinoperatinghours".

start_buffer_directionenum<string>

Direction of the start buffer.

end_buffer_amountnumber

Buffer duration in hours (0.5-hour increments) at the end of operating hours.

end_buffer_directionenum<string>

Direction of the end buffer.

Response Body

Returns the full details of the updated labour rule.

dataobject
iduuid

Unique identifier for the labour rule.

namestring

Name of the labour rule. Must be unique within the organisation.

coverage_typeenum<string>

How headcount coverage is determined. "linear" adds headcount in steps as the metric value grows; "range" picks headcount from a step table.

metric_typeenum<string>

The sales metric used to calculate required headcount.

metric_reporting_type_idstring

ID of the reporting type (e.g. a specific sales category or order type). Required when metrictype is "category" or "ordertype".

metric_forecastedboolean

Whether the metric uses forecasted data rather than actual data.

coverage_definitionobject

Definition of coverage requirements. Shape depends on coverage_type — see create/update docs for details.

run_time_typeenum<string>

When the labour rule is active. "anytime" applies at any time; "withinoperating_hours" applies only within the work site's operating hours.

start_buffer_amountnumber

Buffer duration (in hours, in 0.5-hour increments) before the start of operating hours. Only valid when runtimetype is "withinoperatinghours".

start_buffer_directionenum<string>

Whether the start buffer extends before or after the operating hours start. Only valid when runtimetype is "withinoperatinghours".

end_buffer_amountnumber

Buffer duration (in hours, in 0.5-hour increments) after the end of operating hours. Only valid when runtimetype is "withinoperatinghours".

end_buffer_directionenum<string>

Whether the end buffer extends before or after the operating hours end. Only valid when runtimetype is "withinoperatinghours".

work_siteobject

The work site this labour rule belongs to.

hr_positionsobject[]

Positions currently assigned to this labour rule.

disabledboolean

Whether the labour rule currently cannot take effect — either its work site is archived, or every position assigned to it is archived/deleted. Disabled rules remain readable, updatable and deletable.

disabled_reasonenum<string>

Reason the rule is disabled. Null when the rule is active.

Example

curl -X PATCH \  "https://api.employmenthero.com/api/v1/organisations/:organisation_id/labour_rules/:id" \  -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ" \  -H "Content-Type: application/json" \  -d '{    "name": "Weekend Lunch Rush — Updated",    "coverage_definition": {      "minimum_headcount": 3,      "step_headcount": 1,      "per_dollar_step_size": 400    }  }'

Response

{  "data": {    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",    "name": "Weekend Lunch Rush — Updated",    "coverage_type": "linear",    "metric_type": "gross_sales",    "metric_reporting_type_id": null,    "metric_forecasted": false,    "coverage_definition": {      "minimum_headcount": 3,      "step_headcount": 1,      "per_dollar_step_size": 400    },    "run_time_type": "within_operating_hours",    "start_buffer_amount": 0.5,    "start_buffer_direction": "before",    "end_buffer_amount": 0.5,    "end_buffer_direction": "after",    "work_site": {      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",      "name": "City Store"    },    "hr_positions": [      {        "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",        "name": "Floor Staff"      }    ],    "disabled": false,    "disabled_reason": null  }}

Permanently deletes a labour rule. This action cannot be undone. Positions assigned to the rule are unassigned, not deleted. A disabled rule can still be deleted.

DELETE
https://api.employmenthero.com/api/v1/organisations/:organisation_id/labour_rules/:id

Path Parameters

organisation_iduuidrequired

The ID of the organisation.

iduuidrequired

The ID of the labour rule to delete.

Response Body

Returns HTTP 204 No Content on success. The labour rule is permanently deleted.

Example

curl -X DELETE \  "https://api.employmenthero.com/api/v1/organisations/:organisation_id/labour_rules/:id" \  -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ"

Response

This endpoint does not return a response body.

Returns the sales/labour metrics available to build a labour rule against for a work site. Use this to populate the metric selector when creating or editing a labour rule. The work_site_id query parameter is required.

gross_sales (actual and forecasted) and transaction_count are always available. net_sales, category and forecasted variants only appear once the work site has an active POS connection from a supporting provider.

GET
https://api.employmenthero.com/api/v1/organisations/:organisation_id/labour_rules/metrics

Path Parameters

organisation_iduuidrequired

The ID of the organisation.

Query Parameters

work_site_iduuidrequired

The ID of the work site to retrieve available metrics for. Required.

Response Body

Returns the metrics available for building a labour rule at the specified work site.

dataobject[]

List of metrics available for building a labour rule at the work site.

typeenum<string>

The metric type. Use as metric_type when creating or updating a labour rule.

reporting_type_idstring

Set for category metrics — the POS category ID. Use as metric_reporting_type_id when creating or updating a labour rule.

forecastedboolean

Whether this metric uses forecasted data rather than actual data. Use as metric_forecasted.

labelstring

Human-readable label for the metric.

Example

curl -X GET \  "https://api.employmenthero.com/api/v1/organisations/:organisation_id/labour_rules/metrics" \  -H "Authorization: Bearer AUXJ3123xyrj123fdsjkl124aAJKQ"

Response

{  "data": [    {      "type": "gross_sales",      "reporting_type_id": null,      "forecasted": false,      "label": "Sales (Actual)"    },    {      "type": "gross_sales",      "reporting_type_id": null,      "forecasted": true,      "label": "Sales (Forecasted)"    },    {      "type": "transaction_count",      "reporting_type_id": null,      "forecasted": false,      "label": "Transaction count (Actual)"    }  ]}