---
title: "WorkGroupEntity"
url: "https://dev.4hse.com/api/workgroupentity"
---

# WorkGroupEntity

A **WorkGroupEntity** represents the assignment of a resource (equipment, work environment, or substance) to a work group.

The `entity_id` field is the resource ID and the `entity_type` specifies its type:

-   `EQUIPMENT`: an equipment item (`office_equipment_id`)
-   `WORK_ENVIRONMENT`: a work environment (`office_work_environment_id`)
-   `SUBSTANCE`: a substance (`office_substance_id`)

Use this API to:

-   Assign equipment, work environments, or substances to a work group
-   Find all resources in a work group (filter by `work_group_id`)
-   Find all work groups a resource belongs to (filter by `entity_id`)

The combination of `entity_id` + `work_group_id` must be unique.

Optionally, exposure time can be recorded (`time_spent_measure` + `unit_of_measure_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-indexWorkGroupEntity-post)

POST

/v2/work-group-entity/index

-   

Returns a paginated list of resource-work group assignments.

Most useful filters:

-   `work_group_id`: all resources in a specific work group
-   `entity_id`: all work groups a resource belongs to
-   `entity_type`: filter by resource type (`EQUIPMENT`, `WORK_ENVIRONMENT`, `SUBSTANCE`)

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Request Body

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

Parameters for searching

Select media typeapplication/json

object

**filter**

object

**work\_group\_entity\_id**

string format: uuid

**work\_group\_id**

string format: uuid

**entity\_id**

string format: uuid

**entity\_type**

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE

**description**

string

**time\_spent\_measure**

string

**unit\_of\_measure\_id**

string format: uuid

**entity\_name**

Name of the assigned resource.

string

**entity\_code**

Code of the assigned resource.

string

**work\_group\_code**

string

**work\_group\_name**

string

**work\_group\_type**

string

Allowed values: WORK\_PLACE HGROUP JOB

**unit\_of\_measure\_code**

string

**unit\_of\_measure\_name**

string

**office\_id**

string format: uuid

**office\_name**

string

**office\_code**

string

**project\_id**

string format: uuid

**project\_name**

string

**project\_type**

string

Allowed values: safety template

**owned\_active**

Whether this assignment is currently active.

boolean

nullable

**parent\_active**

Whether the parent entities are currently active.

boolean

nullable

**per-page**

integer

default: 100 \>= 1

**page**

integer

default: 1 \>= 1

**sort**

string

Allowed values: work\_group\_code work\_group\_name work\_group\_type entity\_name entity\_code entity\_type

**history**

If true, includes historicized entries.

boolean

##### Example

```
{  "filter": {    "work_group_id": "3a4b5c6d-7e8f-9012-abcd-ef3456789012",    "entity_type": "EQUIPMENT"  },  "per-page": 20,  "page": 1,  "sort": "entity_name"}
```

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

List of resource-work group assignments

Select media typeapplication/json

Array<object>

object

**work\_group\_entity\_id**

string format: uuid

**work\_group\_id**

string format: uuid

**entity\_id**

string format: uuid

**entity\_type**

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE

**description**

string

**time\_spent\_measure**

string

**unit\_of\_measure\_id**

string format: uuid

**entity\_name**

Name of the assigned resource.

string

**entity\_code**

Code of the assigned resource.

string

**work\_group\_code**

string

**work\_group\_name**

string

**work\_group\_type**

string

Allowed values: WORK\_PLACE HGROUP JOB

**unit\_of\_measure\_code**

string

**unit\_of\_measure\_name**

string

**office\_id**

string format: uuid

**office\_name**

string

**office\_code**

string

**project\_id**

string format: uuid

**project\_name**

string

**project\_type**

string

Allowed values: safety template

**owned\_active**

Whether this assignment is currently active.

boolean

nullable

**parent\_active**

Whether the parent entities are 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-createWorkGroupEntity-post)

POST

/v2/work-group-entity/create

-   

Assigns a resource to a work group.

Requires `work_group_id`, `entity_id`, and `entity_type`. The `work_group_entity_id` is auto-generated if not provided.

What to pass as `entity_id` depends on the `entity_type`:

-   `EQUIPMENT`: pass the `office_equipment_id`
-   `WORK_ENVIRONMENT`: pass the `office_work_environment_id`
-   `SUBSTANCE`: pass the `office_substance_id`

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Request Body required

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

Assignment to create

Select media typeapplication/json

object

**work\_group\_entity\_id**

Unique identifier. Auto-generated if not provided.

string format: uuid

**work\_group\_id**

required

The work group. Pass the `work_group_id` from the WorkGroup API.

string format: uuid

**entity\_id**

required

The resource to assign. What to pass depends on `entity_type`:

-   `EQUIPMENT`: pass the `office_equipment_id`
-   `WORK_ENVIRONMENT`: pass the `office_work_environment_id`
-   `SUBSTANCE`: pass the `office_substance_id`

string format: uuid

**entity\_type**

required

Type of resource being assigned.

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE

**description**

Optional description of the assignment.

string

nullable <= 4000 characters

**time\_spent\_measure**

Exposure time value. If specified, `unit_of_measure_id` is also required.

string

<= 50 characters

**unit\_of\_measure\_id**

Unit of measure for the exposure time. Required if `time_spent_measure` is set.

string format: uuid

#### Responses

[Section titled “ Responses ”](#responses)

##### 201

[Section titled “201 ”](#201)

Resource assigned to work group successfully

Select media typeapplication/json

object

**work\_group\_entity\_id**

Unique identifier. Auto-generated if not provided.

string format: uuid

**work\_group\_id**

required

The work group. Pass the `work_group_id` from the WorkGroup API.

string format: uuid

**entity\_id**

required

The resource to assign. What to pass depends on `entity_type`:

-   `EQUIPMENT`: pass the `office_equipment_id`
-   `WORK_ENVIRONMENT`: pass the `office_work_environment_id`
-   `SUBSTANCE`: pass the `office_substance_id`

string format: uuid

**entity\_type**

required

Type of resource being assigned.

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE

**description**

Optional description of the assignment.

string

nullable <= 4000 characters

**time\_spent\_measure**

Exposure time value. If specified, `unit_of_measure_id` is also required.

string

<= 50 characters

**unit\_of\_measure\_id**

Unit of measure for the exposure time. Required if `time_spent_measure` is set.

string format: uuid

### view

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

GET

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

-   

Retrieves a single assignment by its ID.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Path Parameters

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

**id**

required

string format: uuid

The work\_group\_entity\_id to retrieve.

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

Assignment found

Select media typeapplication/json

object

**work\_group\_entity\_id**

string format: uuid

**work\_group\_id**

string format: uuid

**entity\_id**

string format: uuid

**entity\_type**

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE

**description**

string

**time\_spent\_measure**

string

**unit\_of\_measure\_id**

string format: uuid

**entity\_name**

Name of the assigned resource.

string

**entity\_code**

Code of the assigned resource.

string

**work\_group\_code**

string

**work\_group\_name**

string

**work\_group\_type**

string

Allowed values: WORK\_PLACE HGROUP JOB

**unit\_of\_measure\_code**

string

**unit\_of\_measure\_name**

string

**office\_id**

string format: uuid

**office\_name**

string

**office\_code**

string

**project\_id**

string format: uuid

**project\_name**

string

**project\_type**

string

Allowed values: safety template

**owned\_active**

Whether this assignment is currently active.

boolean

nullable

**parent\_active**

Whether the parent entities are currently active.

boolean

nullable

##### 404

[Section titled “404 ”](#404)

Assignment not found

### update

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

PUT

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

-   

Updates an existing assignment.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Path Parameters

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

**id**

required

string format: uuid

The work\_group\_entity\_id to update.

#### Request Body required

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

Fields to update

Select media typeapplication/json

object

**work\_group\_entity\_id**

Unique identifier. Auto-generated if not provided.

string format: uuid

**work\_group\_id**

required

The work group. Pass the `work_group_id` from the WorkGroup API.

string format: uuid

**entity\_id**

required

The resource to assign. What to pass depends on `entity_type`:

-   `EQUIPMENT`: pass the `office_equipment_id`
-   `WORK_ENVIRONMENT`: pass the `office_work_environment_id`
-   `SUBSTANCE`: pass the `office_substance_id`

string format: uuid

**entity\_type**

required

Type of resource being assigned.

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE

**description**

Optional description of the assignment.

string

nullable <= 4000 characters

**time\_spent\_measure**

Exposure time value. If specified, `unit_of_measure_id` is also required.

string

<= 50 characters

**unit\_of\_measure\_id**

Unit of measure for the exposure time. Required if `time_spent_measure` is set.

string format: uuid

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

Assignment updated successfully

Select media typeapplication/json

object

**work\_group\_entity\_id**

Unique identifier. Auto-generated if not provided.

string format: uuid

**work\_group\_id**

required

The work group. Pass the `work_group_id` from the WorkGroup API.

string format: uuid

**entity\_id**

required

The resource to assign. What to pass depends on `entity_type`:

-   `EQUIPMENT`: pass the `office_equipment_id`
-   `WORK_ENVIRONMENT`: pass the `office_work_environment_id`
-   `SUBSTANCE`: pass the `office_substance_id`

string format: uuid

**entity\_type**

required

Type of resource being assigned.

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE

**description**

Optional description of the assignment.

string

nullable <= 4000 characters

**time\_spent\_measure**

Exposure time value. If specified, `unit_of_measure_id` is also required.

string

<= 50 characters

**unit\_of\_measure\_id**

Unit of measure for the exposure time. Required if `time_spent_measure` is set.

string format: uuid

##### 404

[Section titled “404 ”](#404)

Assignment not found

### delete

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

DELETE

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

-   

Deletes a resource-work group assignment.

If `force=false` (default), the response lists child entities. If `force=true`, the assignment and related entities are deleted.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Path Parameters

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

**id**

required

string format: uuid

The work\_group\_entity\_id to delete.

#### Query Parameters

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

**force**

boolean

If true, deletes the assignment and all child entities.

#### Responses

[Section titled “ Responses ”](#responses)

##### 204

[Section titled “204 ”](#204)

Assignment 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.