---
title: "IncidentResource"
url: "https://dev.4hse.com/api/incidentresource"
---

# IncidentResource

An **IncidentResource** represents a resource involved in an incident. Links an incident (Incident) to an office resource.

The `entity_id` field contains the resource ID and `entity_type` specifies its kind:

-   `EQUIPMENT`: an equipment item (`office_equipment_id`)
-   `WORK_ENVIRONMENT`: a work environment (`office_work_environment_id`)
-   `SUBSTANCE`: a substance (`office_substance_id`)
-   `WORK_GROUP`: a work group (`work_group_id`)
-   `MATERIAL`: a material type (`material_id`)
-   `MATERIAL_ITEM`: a material item (`material_item_id`)
-   `ACTION`: a preventive action (`action_id`)

Use this API to:

-   Register resources involved in an incident
-   Find all resources involved in an incident (filter by `office_incident_id`)
-   Find all incidents that involved a resource (filter by `entity_id`)

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-indexIncidentResource-post)

POST

/v2/incident-resource/index

-   

Returns a paginated list of resources involved in incidents.

Most useful filters:

-   `office_incident_id`: all resources involved in a specific incident
-   `entity_id`: all incidents that involved a specific resource
-   `entity_type`: filter by resource type

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Request Body

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

Parameters for searching

Select media typeapplication/json

object

**filter**

object

**office\_incident\_resource\_id**

string format: uuid

**office\_incident\_id**

string format: uuid

**entity\_id**

string format: uuid

**entity\_type**

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE WORK\_GROUP MATERIAL MATERIAL\_ITEM ACTION

**description**

string

**tenant\_id**

string format: uuid

**subtenant\_id**

string format: uuid

**entity\_name**

Name of the involved resource.

string

**entity\_code**

Code of the involved resource.

string

nullable

**incident\_code**

string

nullable

**incident\_name**

string

**incident\_date**

string format: date

**incident\_category**

string

**incident\_status**

string

Allowed values: new open closed

**project\_name**

string

**project\_type**

string

Allowed values: safety template

**office\_name**

string

**per-page**

integer

default: 100 \>= 1

**page**

integer

default: 1 \>= 1

**sort**

string

Allowed values: entity\_type entity\_name incident\_name office\_name

##### Example

```
{  "filter": {    "office_incident_id": "5c6d7e8f-9012-3456-abcd-ef5678901234"  },  "per-page": 20,  "page": 1,  "sort": "entity_name"}
```

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

List of involved resources

Select media typeapplication/json

Array<object>

object

**office\_incident\_resource\_id**

string format: uuid

**office\_incident\_id**

string format: uuid

**entity\_id**

string format: uuid

**entity\_type**

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE WORK\_GROUP MATERIAL MATERIAL\_ITEM ACTION

**description**

string

**tenant\_id**

string format: uuid

**subtenant\_id**

string format: uuid

**entity\_name**

Name of the involved resource.

string

**entity\_code**

Code of the involved resource.

string

nullable

**incident\_code**

string

nullable

**incident\_name**

string

**incident\_date**

string format: date

**incident\_category**

string

**incident\_status**

string

Allowed values: new open closed

**project\_name**

string

**project\_type**

string

Allowed values: safety template

**office\_name**

string

#### 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-createIncidentResource-post)

POST

/v2/incident-resource/create

-   

Registers a resource involved in an incident.

Requires `office_incident_id`, `entity_id`, `entity_type`, `subtenant_id` (office\_id), and `tenant_id` (project\_id). The `office_incident_resource_id` is auto-generated if not provided.

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

-   `EQUIPMENT`: pass the `office_equipment_id`
-   `WORK_ENVIRONMENT`: pass the `office_work_environment_id`
-   `SUBSTANCE`: pass the `office_substance_id`
-   `WORK_GROUP`: pass the `work_group_id`
-   `MATERIAL`: pass the `material_id`
-   `MATERIAL_ITEM`: pass the `material_item_id`
-   `ACTION`: pass the `action_id`

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Request Body required

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

Involved resource to register

Select media typeapplication/json

object

**office\_incident\_resource\_id**

Unique identifier. Auto-generated if not provided.

string format: uuid

**office\_incident\_id**

required

The incident. Pass the `office_incident_id` from the Incident API.

string format: uuid

**entity\_id**

required

The involved resource. 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`
-   `WORK_GROUP`: pass the `work_group_id`
-   `MATERIAL`: pass the `material_id`
-   `MATERIAL_ITEM`: pass the `material_item_id`
-   `ACTION`: pass the `action_id`

string format: uuid

**entity\_type**

required

Type of involved resource.

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE WORK\_GROUP MATERIAL MATERIAL\_ITEM ACTION

**description**

Description of the resource’s involvement.

string

nullable

**tenant\_id**

required

The project (company). Pass the `project_id`.

string format: uuid

**subtenant\_id**

required

The office. Pass the `office_id`.

string format: uuid

#### Responses

[Section titled “ Responses ”](#responses)

##### 201

[Section titled “201 ”](#201)

Involved resource registered successfully

Select media typeapplication/json

object

**office\_incident\_resource\_id**

Unique identifier. Auto-generated if not provided.

string format: uuid

**office\_incident\_id**

required

The incident. Pass the `office_incident_id` from the Incident API.

string format: uuid

**entity\_id**

required

The involved resource. 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`
-   `WORK_GROUP`: pass the `work_group_id`
-   `MATERIAL`: pass the `material_id`
-   `MATERIAL_ITEM`: pass the `material_item_id`
-   `ACTION`: pass the `action_id`

string format: uuid

**entity\_type**

required

Type of involved resource.

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE WORK\_GROUP MATERIAL MATERIAL\_ITEM ACTION

**description**

Description of the resource’s involvement.

string

nullable

**tenant\_id**

required

The project (company). Pass the `project_id`.

string format: uuid

**subtenant\_id**

required

The office. Pass the `office_id`.

string format: uuid

### view

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

GET

/v2/incident-resource/view/{id}

-   

Retrieves a single involved resource by its ID.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Path Parameters

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

**id**

required

string format: uuid

The office\_incident\_resource\_id to retrieve.

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

Involved resource found

Select media typeapplication/json

object

**office\_incident\_resource\_id**

string format: uuid

**office\_incident\_id**

string format: uuid

**entity\_id**

string format: uuid

**entity\_type**

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE WORK\_GROUP MATERIAL MATERIAL\_ITEM ACTION

**description**

string

**tenant\_id**

string format: uuid

**subtenant\_id**

string format: uuid

**entity\_name**

Name of the involved resource.

string

**entity\_code**

Code of the involved resource.

string

nullable

**incident\_code**

string

nullable

**incident\_name**

string

**incident\_date**

string format: date

**incident\_category**

string

**incident\_status**

string

Allowed values: new open closed

**project\_name**

string

**project\_type**

string

Allowed values: safety template

**office\_name**

string

##### 404

[Section titled “404 ”](#404)

Not found

### update

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

PUT

/v2/incident-resource/update/{id}

-   

Updates an existing involved resource record.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Path Parameters

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

**id**

required

string format: uuid

The office\_incident\_resource\_id to update.

#### Request Body required

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

Fields to update

Select media typeapplication/json

object

**office\_incident\_resource\_id**

Unique identifier. Auto-generated if not provided.

string format: uuid

**office\_incident\_id**

required

The incident. Pass the `office_incident_id` from the Incident API.

string format: uuid

**entity\_id**

required

The involved resource. 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`
-   `WORK_GROUP`: pass the `work_group_id`
-   `MATERIAL`: pass the `material_id`
-   `MATERIAL_ITEM`: pass the `material_item_id`
-   `ACTION`: pass the `action_id`

string format: uuid

**entity\_type**

required

Type of involved resource.

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE WORK\_GROUP MATERIAL MATERIAL\_ITEM ACTION

**description**

Description of the resource’s involvement.

string

nullable

**tenant\_id**

required

The project (company). Pass the `project_id`.

string format: uuid

**subtenant\_id**

required

The office. Pass the `office_id`.

string format: uuid

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

Updated successfully

Select media typeapplication/json

object

**office\_incident\_resource\_id**

Unique identifier. Auto-generated if not provided.

string format: uuid

**office\_incident\_id**

required

The incident. Pass the `office_incident_id` from the Incident API.

string format: uuid

**entity\_id**

required

The involved resource. 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`
-   `WORK_GROUP`: pass the `work_group_id`
-   `MATERIAL`: pass the `material_id`
-   `MATERIAL_ITEM`: pass the `material_item_id`
-   `ACTION`: pass the `action_id`

string format: uuid

**entity\_type**

required

Type of involved resource.

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE WORK\_GROUP MATERIAL MATERIAL\_ITEM ACTION

**description**

Description of the resource’s involvement.

string

nullable

**tenant\_id**

required

The project (company). Pass the `project_id`.

string format: uuid

**subtenant\_id**

required

The office. Pass the `office_id`.

string format: uuid

##### 404

[Section titled “404 ”](#404)

Not found

### delete

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

DELETE

/v2/incident-resource/delete/{id}

-   

Deletes an involved resource record.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Path Parameters

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

**id**

required

string format: uuid

The office\_incident\_resource\_id to delete.

#### Query Parameters

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

**force**

boolean

If true, deletes the record.

#### Responses

[Section titled “ Responses ”](#responses)

##### 204

[Section titled “204 ”](#204)

Deleted successfully

##### 400

[Section titled “400 ”](#400)

Preview of affected entities (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.