Role
A Role represents a safety organization role defined in an office. Examples: safety officer (RSPP), workers’ safety representative (RLS), fire warden, first aid officer, supervisor.
Belongs to an office. People are assigned to roles via EntityEmployee.
A role can be subject to check actions on the compliance schedule
(ActionSubscription with subscriber_type: ROLE).
Use this API to:
- Define the safety organization roles for an office
- Get the
office_role_idneeded to create compliance schedule entries or certificates - Browse the roles of an office (filter by
office_id)
Supports historicization.
- Version
- 2.0.0
- OpenAPI version
- 3.0.0
Authentication
Section titled “ Authentication ”OAuth2
Section titled “OAuth2 ”Security scheme type: oauth2
Flow type: password
Token URL: https://auth.4hse.com/realms/4hse/protocol/openid-connect/token
AccessToken
Section titled “AccessToken ”Security scheme type: apiKey
Query parameter name: access-token
Operations
Section titled “Operations” POST /v2/role/index
Returns a paginated list of roles.
Most useful filters:
office_id: all roles in a specific officename: search by role name
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”Parameters for searching roles
object
object
Unique identifier. Used as subscriber_id (ROLE) or resource_id.
Name of the office.
Name of the project.
Whether this role is currently active.
Whether the parent office is currently active.
If true, includes historicized entries.
Example
{ "filter": { "office_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }, "per-page": 20, "page": 1, "sort": "name"}Responses
Section titled “ Responses ”List of roles
object
Unique identifier. Used as subscriber_id (ROLE) or resource_id.
Name of the office.
Name of the project.
Whether this role is currently active.
Whether the parent office is currently active.
Headers
Section titled “Headers ”Current page
Total number of pages
Number of items per page
Total number of items
create
Section titled “create” POST /v2/role/create
Creates a new safety role in an office.
Requires office_id, project_id, and name.
The office_role_id is auto-generated if not provided.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Role to create
object
Unique identifier. Auto-generated if not provided. Used as subscriber_id (with subscriber_type: ROLE) in the compliance schedule and as resource_id in certificates.
The office this role belongs to. Pass the office_id.
Identifier code.
Name of the role.
Optional description.
The project (company). Pass the project_id.
Responses
Section titled “ Responses ”Role created successfully
object
Unique identifier. Auto-generated if not provided. Used as subscriber_id (with subscriber_type: ROLE) in the compliance schedule and as resource_id in certificates.
The office this role belongs to. Pass the office_id.
Identifier code.
Name of the role.
Optional description.
The project (company). Pass the project_id.
GET /v2/role/view/{id}
Retrieves a single role by its ID.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The office_role_id to retrieve.
Responses
Section titled “ Responses ”Role found
object
Unique identifier. Used as subscriber_id (ROLE) or resource_id.
Name of the office.
Name of the project.
Whether this role is currently active.
Whether the parent office is currently active.
Role not found
update
Section titled “update” PUT /v2/role/update/{id}
Updates an existing role.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The office_role_id to update.
Request Body required
Section titled “Request Body required ”Fields to update
object
Unique identifier. Auto-generated if not provided. Used as subscriber_id (with subscriber_type: ROLE) in the compliance schedule and as resource_id in certificates.
The office this role belongs to. Pass the office_id.
Identifier code.
Name of the role.
Optional description.
The project (company). Pass the project_id.
Responses
Section titled “ Responses ”Role updated successfully
object
Unique identifier. Auto-generated if not provided. Used as subscriber_id (with subscriber_type: ROLE) in the compliance schedule and as resource_id in certificates.
The office this role belongs to. Pass the office_id.
Identifier code.
Name of the role.
Optional description.
The project (company). Pass the project_id.
Role not found
delete
Section titled “delete” DELETE /v2/role/delete/{id}
Deletes a role.
If force=false (default), the response lists child entities.
If force=true, the role and all related entities are deleted.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The office_role_id to delete.
Query Parameters
Section titled “Query Parameters ”If true, deletes the role and all child entities.
Responses
Section titled “ Responses ”Role deleted successfully
Preview of entities that would be deleted (returned when force=false)