---
title: "OrgRole"
url: "https://dev.4hse.com/api/orgrole"
---

# OrgRole

An **OrgRole** represents a role in the company organization chart. Unlike office safety roles (Role/OfficeRole), these are organizational roles at company level.

Examples: “Director”, “Production Manager”, “Quality Officer”.

Belongs to a project (not to an office). People are assigned to organizational roles via OrgPerson.

Use this API to:

-   Define organizational chart roles
-   Browse available roles in a project (filter by `project_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-indexOrgRole-post)

POST

/v2/org-role/index

-   

Returns a paginated list of organizational roles.

Most useful filters:

-   `project_id`: all roles in a company
-   `name`: search by name

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Request Body

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

Parameters for searching

Select media typeapplication/json

object

**filter**

object

**org\_role\_id**

string format: uuid

**code**

string

**name**

string

**description**

string

**project\_id**

string format: uuid

**owned\_active**

Whether this role is currently active.

boolean

nullable

**parent\_active**

Whether the parent project is currently active.

boolean

nullable

**per-page**

integer

default: 100 \>= 1

**page**

integer

default: 1 \>= 1

**sort**

string

Allowed values: code name

**history**

If true, includes historicized entries.

boolean

##### Example

```
{  "filter": {    "project_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01"  },  "per-page": 20,  "page": 1,  "sort": "name"}
```

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

List of organizational roles

Select media typeapplication/json

Array<object>

object

**org\_role\_id**

string format: uuid

**code**

string

**name**

string

**description**

string

**project\_id**

string format: uuid

**owned\_active**

Whether this role is currently active.

boolean

nullable

**parent\_active**

Whether the parent project 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-createOrgRole-post)

POST

/v2/org-role/create

-   

Creates a new organizational role.

Requires `name` and `project_id`. The `org_role_id` is auto-generated if not provided.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Request Body required

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

Role to create

Select media typeapplication/json

object

**org\_role\_id**

Unique identifier. Auto-generated if not provided.

string format: uuid

**code**

Identifier code.

string

<= 50 characters

**name**

required

Name of the organizational role.

string

<= 255 characters

**description**

Optional description.

string

nullable

**project\_id**

required

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

string format: uuid

#### Responses

[Section titled “ Responses ”](#responses)

##### 201

[Section titled “201 ”](#201)

Role created successfully

Select media typeapplication/json

object

**org\_role\_id**

Unique identifier. Auto-generated if not provided.

string format: uuid

**code**

Identifier code.

string

<= 50 characters

**name**

required

Name of the organizational role.

string

<= 255 characters

**description**

Optional description.

string

nullable

**project\_id**

required

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

string format: uuid

### view

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

GET

/v2/org-role/view/{id}

-   

Retrieves a single organizational role by its ID.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Path Parameters

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

**id**

required

string format: uuid

The org\_role\_id to retrieve.

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

Role found

Select media typeapplication/json

object

**org\_role\_id**

string format: uuid

**code**

string

**name**

string

**description**

string

**project\_id**

string format: uuid

**owned\_active**

Whether this role is currently active.

boolean

nullable

**parent\_active**

Whether the parent project is currently active.

boolean

nullable

##### 404

[Section titled “404 ”](#404)

Not found

### update

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

PUT

/v2/org-role/update/{id}

-   

Updates an existing organizational role.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Path Parameters

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

**id**

required

string format: uuid

The org\_role\_id to update.

#### Request Body required

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

Fields to update

Select media typeapplication/json

object

**org\_role\_id**

Unique identifier. Auto-generated if not provided.

string format: uuid

**code**

Identifier code.

string

<= 50 characters

**name**

required

Name of the organizational role.

string

<= 255 characters

**description**

Optional description.

string

nullable

**project\_id**

required

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

string format: uuid

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

Updated successfully

Select media typeapplication/json

object

**org\_role\_id**

Unique identifier. Auto-generated if not provided.

string format: uuid

**code**

Identifier code.

string

<= 50 characters

**name**

required

Name of the organizational role.

string

<= 255 characters

**description**

Optional description.

string

nullable

**project\_id**

required

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

string format: uuid

##### 404

[Section titled “404 ”](#404)

Not found

### delete

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

DELETE

/v2/org-role/delete/{id}

-   

Deletes an organizational role.

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

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Path Parameters

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

**id**

required

string format: uuid

The org\_role\_id to delete.

#### Query Parameters

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

**force**

boolean

If true, deletes the role and all child entities.

#### Responses

[Section titled “ Responses ”](#responses)

##### 204

[Section titled “204 ”](#204)

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.