---
title: "Attribute"
url: "https://dev.4hse.com/api/attribute"
---

# Attribute

An **Attribute** is a custom field that records a measurable or descriptive detail of a resource: the noise level of a work environment, the load capacity of a forklift, the size of a PPE item.

Each attribute carries a `name`, a `value` and a unit of measure (`unit_of_measure_id`), and is attached to a single resource through `entity_id` and `entity_type` — a person, a piece of equipment, a work environment, or a substance.

Use this API to:

-   Record details of a resource that its standard fields do not cover
-   Find all attributes of a resource (filter by `entity_id`)
-   Update a measured value after an inspection

Version

2.0.0

OpenAPI version

3.0.0

## Operations

[Section titled “Operations”](#operations)

### index

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

POST

/v2/attribute/index

-   

Returns a paginated and filterable list of attributes for a given entity. Use POST to allow complex filters via JSON payload. The `entity_id` parameter is required and can be provided as a query parameter or in the request body.

#### Query Parameters

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

**entity\_id**

required

string format: uuid

The ID of the entity to retrieve attributes for. Required.

#### Request Body

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

Parameters for searching attributes

Select media typeapplication/json

object

**filter**

object

**attribute\_id**

string format: uuid

**code**

string

<= 45 characters

**name**

required

string

<= 255 characters

**description**

string

<= 4000 characters

**entity\_id**

required

The ID of the entity this attribute is associated with.

string format: uuid

**entity\_type**

required

The type of the entity this attribute is associated with.

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE OFFICE PERSON MATERIAL\_ITEM MATERIAL CUSTOMER

**unit\_of\_measure\_id**

required

string

<= 50 characters

**value**

required

string

<= 250 characters

**measure**

string

<= 255 characters

**measure\_data**

string

<= 4000 characters

**tenant\_id**

string format: uuid

```
{  "attribute_id": "123e4567-e89b-12d3-a456-426655440000",  "name": "Room Size",  "description": "The room size",  "entity_id": "569bc3c7-ead1-41e8-85ab-fdccf7085c5f",  "entity_type": "WORK_ENVIRONMENT",  "unit_of_measure_id": "M3",  "value": "50"}
```

**per-page**

integer

default: 100 \>= 1

**page**

integer

default: 1 \>= 1

**sort**

string

Allowed values: name code entity\_type value

##### Example

```
{  "filter": {    "name": "Room Size"  },  "per-page": 50,  "page": 1}
```

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

List of attributes

Select media typeapplication/json

Array<object>

object

**attribute\_id**

string format: uuid

**code**

string

<= 45 characters

**name**

required

string

<= 255 characters

**description**

string

<= 4000 characters

**entity\_id**

required

The ID of the entity this attribute is associated with.

string format: uuid

**entity\_type**

required

The type of the entity this attribute is associated with.

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE OFFICE PERSON MATERIAL\_ITEM MATERIAL CUSTOMER

**unit\_of\_measure\_id**

required

string

<= 50 characters

**value**

required

string

<= 250 characters

**measure**

string

<= 255 characters

**measure\_data**

string

<= 4000 characters

**tenant\_id**

string format: uuid

```
{  "attribute_id": "123e4567-e89b-12d3-a456-426655440000",  "name": "Room Size",  "description": "The room size",  "entity_id": "569bc3c7-ead1-41e8-85ab-fdccf7085c5f",  "entity_type": "WORK_ENVIRONMENT",  "unit_of_measure_id": "M3",  "value": "50"}
```

##### Example

```
{  "attribute_id": "123e4567-e89b-12d3-a456-426655440000",  "name": "Room Size",  "description": "The room size",  "entity_id": "569bc3c7-ead1-41e8-85ab-fdccf7085c5f",  "entity_type": "WORK_ENVIRONMENT",  "unit_of_measure_id": "M3",  "value": "50"}
```

#### 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

### view

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

GET

/v2/attribute/view/{id}

-   

Retrieve a single attribute by its unique ID.

#### Path Parameters

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

**id**

required

string format: uuid

The ID of the attribute to retrieve

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

Attribute found

Select media typeapplication/json

object

**attribute\_id**

string format: uuid

**code**

string

<= 45 characters

**name**

required

string

<= 255 characters

**description**

string

<= 4000 characters

**entity\_id**

required

The ID of the entity this attribute is associated with.

string format: uuid

**entity\_type**

required

The type of the entity this attribute is associated with.

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE OFFICE PERSON MATERIAL\_ITEM MATERIAL CUSTOMER

**unit\_of\_measure\_id**

required

string

<= 50 characters

**value**

required

string

<= 250 characters

**measure**

string

<= 255 characters

**measure\_data**

string

<= 4000 characters

**tenant\_id**

string format: uuid

##### Example

```
{  "attribute_id": "123e4567-e89b-12d3-a456-426655440000",  "name": "Room Size",  "description": "The room size",  "entity_id": "569bc3c7-ead1-41e8-85ab-fdccf7085c5f",  "entity_type": "WORK_ENVIRONMENT",  "unit_of_measure_id": "M3",  "value": "50"}
```

##### 404

[Section titled “404 ”](#404)

Attribute not found

### create

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

POST

/v2/attribute/create

-   

Create a new attribute for an entity.

#### Request Body required

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

The attribute to create

Select media typeapplication/json

object

**attribute\_id**

string format: uuid

**code**

string

<= 45 characters

**name**

required

string

<= 255 characters

**description**

string

<= 4000 characters

**entity\_id**

required

The ID of the entity this attribute is associated with.

string format: uuid

**entity\_type**

required

The type of the entity this attribute is associated with.

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE OFFICE PERSON MATERIAL\_ITEM MATERIAL CUSTOMER

**unit\_of\_measure\_id**

required

string

<= 50 characters

**value**

required

string

<= 250 characters

**measure**

string

<= 255 characters

**measure\_data**

string

<= 4000 characters

**tenant\_id**

string format: uuid

##### Example

```
{  "name": "Room Size",  "description": "The room size",  "entity_id": "569bc3c7-ead1-41e8-85ab-fdccf7085c5f",  "entity_type": "WORK_ENVIRONMENT",  "unit_of_measure_id": "M3",  "value": "50"}
```

#### Responses

[Section titled “ Responses ”](#responses)

##### 201

[Section titled “201 ”](#201)

Attribute created successfully

Select media typeapplication/json

object

**attribute\_id**

string format: uuid

**code**

string

<= 45 characters

**name**

required

string

<= 255 characters

**description**

string

<= 4000 characters

**entity\_id**

required

The ID of the entity this attribute is associated with.

string format: uuid

**entity\_type**

required

The type of the entity this attribute is associated with.

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE OFFICE PERSON MATERIAL\_ITEM MATERIAL CUSTOMER

**unit\_of\_measure\_id**

required

string

<= 50 characters

**value**

required

string

<= 250 characters

**measure**

string

<= 255 characters

**measure\_data**

string

<= 4000 characters

**tenant\_id**

string format: uuid

##### Example

```
{  "attribute_id": "123e4567-e89b-12d3-a456-426655440000",  "name": "Room Size",  "description": "The room size",  "entity_id": "569bc3c7-ead1-41e8-85ab-fdccf7085c5f",  "entity_type": "WORK_ENVIRONMENT",  "unit_of_measure_id": "M3",  "value": "50"}
```

### update

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

PUT

/v2/attribute/update/{id}

-   

Update an existing attribute by its unique ID.

#### Path Parameters

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

**id**

required

string format: uuid

The ID of the attribute to update

#### Request Body required

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

The updated attribute

Select media typeapplication/json

object

**attribute\_id**

string format: uuid

**code**

string

<= 45 characters

**name**

required

string

<= 255 characters

**description**

string

<= 4000 characters

**entity\_id**

required

The ID of the entity this attribute is associated with.

string format: uuid

**entity\_type**

required

The type of the entity this attribute is associated with.

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE OFFICE PERSON MATERIAL\_ITEM MATERIAL CUSTOMER

**unit\_of\_measure\_id**

required

string

<= 50 characters

**value**

required

string

<= 250 characters

**measure**

string

<= 255 characters

**measure\_data**

string

<= 4000 characters

**tenant\_id**

string format: uuid

##### Example

```
{  "name": "Updated Room Size",  "value": "60"}
```

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

Attribute updated successfully

Select media typeapplication/json

object

**attribute\_id**

string format: uuid

**code**

string

<= 45 characters

**name**

required

string

<= 255 characters

**description**

string

<= 4000 characters

**entity\_id**

required

The ID of the entity this attribute is associated with.

string format: uuid

**entity\_type**

required

The type of the entity this attribute is associated with.

string

Allowed values: EQUIPMENT WORK\_ENVIRONMENT SUBSTANCE OFFICE PERSON MATERIAL\_ITEM MATERIAL CUSTOMER

**unit\_of\_measure\_id**

required

string

<= 50 characters

**value**

required

string

<= 250 characters

**measure**

string

<= 255 characters

**measure\_data**

string

<= 4000 characters

**tenant\_id**

string format: uuid

##### Example

```
{  "attribute_id": "123e4567-e89b-12d3-a456-426655440000",  "name": "Updated Room Size",  "value": "60"}
```

##### 404

[Section titled “404 ”](#404)

Attribute not found

### delete

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

DELETE

/v2/attribute/delete/{id}

-   

Delete an attribute by its unique ID.  
If force=true, all related entities will also be deleted.

#### Path Parameters

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

**id**

required

string format: uuid

The ID of the attribute to delete

#### Query Parameters

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

**force**

boolean

Force the deletion of the entity and all related entities

#### Responses

[Section titled “ Responses ”](#responses)

##### 204

[Section titled “204 ”](#204)

Attribute deleted successfully

##### 400

[Section titled “400 ”](#400)

If force=false, the operation is interrupted and the list of connected entities that will be deleted in case of confirmation (force=true) is returned

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.