---
title: "WorkGroup"
url: "https://dev.4hse.com/api/workgroup"
---

# WorkGroup

A **WorkGroup** represents a functional grouping within an office. There are three types:

-   `JOB`: a **job role / duty** (e.g. welder, crane operator, warehouse worker)
-   `WORK_PLACE`: a **work phase / operational area** (e.g. assembly line, painting department)
-   `HGROUP`: a **homogeneous exposure group** (e.g. workers exposed to noise)

Work groups can contain people (WorkGroupPerson), resources like equipment, work environments, or substances (WorkGroupEntity), and suppliers (WorkGroupSupplier).

A work group can be subject to check actions on the compliance schedule. In compliance schedule entries (ActionSubscription), the `subscriber_type` is `WORK_GROUP` and the `subscriber_id` is the `work_group_id`.

Use this API to:

-   Define job roles, work phases, or homogeneous groups for an office
-   Get the `work_group_id` needed to create compliance schedule entries or certificates
-   Browse work groups for an office (filter by `office_id`)

Supports historicization.

Version

2.0.0

OpenAPI version

3.0.0

## Authentication

[Section titled “ Authentication ”](#authentication)

### OAuth2

[Section titled “OAuth2 ”](#oauth2)

**Security scheme type:** oauth2

**Flow type:** password

**Token URL:** [https://auth.4hse.com/realms/4hse/protocol/openid-connect/token](https://auth.4hse.com/realms/4hse/protocol/openid-connect/token)

### AccessToken

[Section titled “AccessToken ”](#accesstoken)

**Security scheme type:** apiKey

**Query parameter name:** access-token

## Operations

[Section titled “Operations”](#operations)

### index

[Section titled “index”](#operation-indexWorkGroup-post)

POST

/v2/work-group/index

-   

Returns a paginated list of work groups.

Most useful filters:

-   `office_id`: all work groups in a specific office
-   `work_group_type`: filter by type (`JOB`, `WORK_PLACE`, or `HGROUP`)
-   `name`: search by name

## Authorizations

[Section titled “Authorizations ”](#authorizations)

-   **[OAuth2](/api/workgroup/#oauth2)**
-   **[AccessToken](/api/workgroup/#accesstoken)**

#### Request Body

[Section titled “Request Body ”](#request-body)

Parameters for searching work groups

Select media typeapplication/json

object

**filter**

object

**work\_group\_id**

Unique identifier. Used as `subscriber_id` (WORK\_GROUP) or `resource_id`.

string format: uuid

**code**

string

**name**

string

**description**

string

**office\_id**

string format: uuid

**work\_group\_type**

Type of work group.

string

Allowed values: WORK\_PLACE HGROUP JOB

**project\_id**

The project (company) this work group belongs to.

string format: uuid

**project\_name**

Name of the project.

string

**project\_type**

string

Allowed values: safety template

**office\_name**

Name of the office.

string

**owned\_active**

Whether this work group is currently active.

boolean

nullable

**parent\_active**

Whether the parent office is currently active.

boolean

nullable

**per-page**

integer

default: 100 \>= 1

**page**

integer

default: 1 \>= 1

**sort**

string

Allowed values: code name work\_group\_type office\_name

**history**

If true, includes historicized entries.

boolean

##### Example

```
{  "filter": {    "office_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",    "work_group_type": "JOB"  },  "per-page": 20,  "page": 1,  "sort": "name"}
```

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

List of work groups

Select media typeapplication/json

Array<object>

object

**work\_group\_id**

Unique identifier. Used as `subscriber_id` (WORK\_GROUP) or `resource_id`.

string format: uuid

**code**

string

**name**

string

**description**

string

**office\_id**

string format: uuid

**work\_group\_type**

Type of work group.

string

Allowed values: WORK\_PLACE HGROUP JOB

**project\_id**

The project (company) this work group belongs to.

string format: uuid

**project\_name**

Name of the project.

string

**project\_type**

string

Allowed values: safety template

**office\_name**

Name of the office.

string

**owned\_active**

Whether this work group is currently active.

boolean

nullable

**parent\_active**

Whether the parent office is currently active.

boolean

nullable

#### Headers

[Section titled “Headers ”](#headers)

**X-Pagination-Current-Page**

integer

Current page

**X-Pagination-Page-Count**

integer

Total number of pages

**X-Pagination-Per-Page**

integer

Number of items per page

**X-Pagination-Total-Count**

integer

Total number of items

### create

[Section titled “create”](#operation-createWorkGroup-post)

POST

/v2/work-group/create

-   

Creates a new work group in an office.

Requires `name` and `office_id`. The `work_group_id` is auto-generated if not provided.

After creation, assign people via WorkGroupPerson, resources via WorkGroupEntity, and suppliers via WorkGroupSupplier.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

-   **[OAuth2](/api/workgroup/#oauth2)**
-   **[AccessToken](/api/workgroup/#accesstoken)**

#### Request Body required

[Section titled “Request Body required ”](#request-body)

Work group to create

Select media typeapplication/json

object

**work\_group\_id**

Unique identifier. Auto-generated if not provided. Used as `subscriber_id` (with `subscriber_type: WORK_GROUP`) in the compliance schedule and as `resource_id` in certificates.

string format: uuid

**code**

Identifier code.

string

<= 45 characters

**name**

required

Name of the work group.

string

<= 255 characters

**description**

Optional description.

string

nullable

**office\_id**

required

The office this work group belongs to. Pass the `office_id`.

string format: uuid

**work\_group\_type**

Type of work group:

-   `JOB`: a job role or duty (e.g. welder, crane operator)
-   `WORK_PLACE`: a work phase or operational area (e.g. assembly line)
-   `HGROUP`: a homogeneous exposure group (e.g. workers exposed to noise)

string

<= 50 characters

Allowed values: WORK\_PLACE HGROUP JOB

#### Responses

[Section titled “ Responses ”](#responses)

##### 201

[Section titled “201 ”](#201)

Work group created successfully

Select media typeapplication/json

object

**work\_group\_id**

Unique identifier. Auto-generated if not provided. Used as `subscriber_id` (with `subscriber_type: WORK_GROUP`) in the compliance schedule and as `resource_id` in certificates.

string format: uuid

**code**

Identifier code.

string

<= 45 characters

**name**

required

Name of the work group.

string

<= 255 characters

**description**

Optional description.

string

nullable

**office\_id**

required

The office this work group belongs to. Pass the `office_id`.

string format: uuid

**work\_group\_type**

Type of work group:

-   `JOB`: a job role or duty (e.g. welder, crane operator)
-   `WORK_PLACE`: a work phase or operational area (e.g. assembly line)
-   `HGROUP`: a homogeneous exposure group (e.g. workers exposed to noise)

string

<= 50 characters

Allowed values: WORK\_PLACE HGROUP JOB

### view

[Section titled “view”](#operation-viewWorkGroup-get)

GET

/v2/work-group/view/{id}

-   

Retrieves a single work group by its ID.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

-   **[OAuth2](/api/workgroup/#oauth2)**
-   **[AccessToken](/api/workgroup/#accesstoken)**

#### Path Parameters

[Section titled “Path Parameters ”](#path-parameters)

**id**

required

string format: uuid

The work\_group\_id to retrieve.

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

Work group found

Select media typeapplication/json

object

**work\_group\_id**

Unique identifier. Used as `subscriber_id` (WORK\_GROUP) or `resource_id`.

string format: uuid

**code**

string

**name**

string

**description**

string

**office\_id**

string format: uuid

**work\_group\_type**

Type of work group.

string

Allowed values: WORK\_PLACE HGROUP JOB

**project\_id**

The project (company) this work group belongs to.

string format: uuid

**project\_name**

Name of the project.

string

**project\_type**

string

Allowed values: safety template

**office\_name**

Name of the office.

string

**owned\_active**

Whether this work group is currently active.

boolean

nullable

**parent\_active**

Whether the parent office is currently active.

boolean

nullable

##### 404

[Section titled “404 ”](#404)

Work group not found

### update

[Section titled “update”](#operation-updateWorkGroup-put)

PUT

/v2/work-group/update/{id}

-   

Updates an existing work group.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

-   **[OAuth2](/api/workgroup/#oauth2)**
-   **[AccessToken](/api/workgroup/#accesstoken)**

#### Path Parameters

[Section titled “Path Parameters ”](#path-parameters)

**id**

required

string format: uuid

The work\_group\_id to update.

#### Request Body required

[Section titled “Request Body required ”](#request-body)

Fields to update

Select media typeapplication/json

object

**work\_group\_id**

Unique identifier. Auto-generated if not provided. Used as `subscriber_id` (with `subscriber_type: WORK_GROUP`) in the compliance schedule and as `resource_id` in certificates.

string format: uuid

**code**

Identifier code.

string

<= 45 characters

**name**

required

Name of the work group.

string

<= 255 characters

**description**

Optional description.

string

nullable

**office\_id**

required

The office this work group belongs to. Pass the `office_id`.

string format: uuid

**work\_group\_type**

Type of work group:

-   `JOB`: a job role or duty (e.g. welder, crane operator)
-   `WORK_PLACE`: a work phase or operational area (e.g. assembly line)
-   `HGROUP`: a homogeneous exposure group (e.g. workers exposed to noise)

string

<= 50 characters

Allowed values: WORK\_PLACE HGROUP JOB

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

Work group updated successfully

Select media typeapplication/json

object

**work\_group\_id**

Unique identifier. Auto-generated if not provided. Used as `subscriber_id` (with `subscriber_type: WORK_GROUP`) in the compliance schedule and as `resource_id` in certificates.

string format: uuid

**code**

Identifier code.

string

<= 45 characters

**name**

required

Name of the work group.

string

<= 255 characters

**description**

Optional description.

string

nullable

**office\_id**

required

The office this work group belongs to. Pass the `office_id`.

string format: uuid

**work\_group\_type**

Type of work group:

-   `JOB`: a job role or duty (e.g. welder, crane operator)
-   `WORK_PLACE`: a work phase or operational area (e.g. assembly line)
-   `HGROUP`: a homogeneous exposure group (e.g. workers exposed to noise)

string

<= 50 characters

Allowed values: WORK\_PLACE HGROUP JOB

##### 404

[Section titled “404 ”](#404)

Work group not found

### delete

[Section titled “delete”](#operation-deleteWorkGroup-delete)

DELETE

/v2/work-group/delete/{id}

-   

Deletes a work group.

If `force=false` (default), the response lists child entities (people, resources, suppliers). If `force=true`, the work group and all related entities are deleted.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

-   **[OAuth2](/api/workgroup/#oauth2)**
-   **[AccessToken](/api/workgroup/#accesstoken)**

#### Path Parameters

[Section titled “Path Parameters ”](#path-parameters)

**id**

required

string format: uuid

The work\_group\_id to delete.

#### Query Parameters

[Section titled “Query Parameters ”](#query-parameters)

**force**

boolean

If true, deletes the work group and all child entities.

#### Responses

[Section titled “ Responses ”](#responses)

##### 204

[Section titled “204 ”](#204)

Work group deleted successfully

##### 400

[Section titled “400 ”](#400)

Preview of entities that would be deleted (returned when force=false)

This site is protected by reCAPTCHA and the Google [Privacy Policy](https://policies.google.com/privacy) and [Terms of Service](https://policies.google.com/terms) apply.