EntityEmployee
An EntityEmployee represents the assignment of a person to an office resource: a safety role, a piece of equipment, a work environment, or a substance.
For example: assigning “John Smith” to the role “Safety Officer” or to the equipment “Forklift A”.
The entity_id field contains the resource ID and the type field specifies its kind:
ROLE: a safety organization role (office_role_id)EQUIPMENT: a piece of equipment (office_equipment_id)WORK_ENVIRONMENT: a work environment (office_work_environment_id)SUBSTANCE: a substance (office_substance_id)
Use this API to:
- Assign a person to a role, equipment, work environment, or substance
- Find all people assigned to a resource (filter by
entity_id) - Find all resources a person is assigned to (filter by
person_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/entity-employee/index
Returns a paginated list of person-resource assignments.
Most useful filters:
entity_id: all people assigned to a specific resourceperson_office_id: all resources a person is assigned totype: filter by resource type (ROLE,EQUIPMENT,WORK_ENVIRONMENT,SUBSTANCE)office_id: all assignments in an office
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”Parameters for searching
object
object
The person ID.
Employee code.
Whether the person is external prevention staff.
Code of the assigned resource.
Name of the assigned resource.
Name of the office.
Name of the project.
Whether this assignment is currently active.
Whether the parent entities are currently active.
If true, includes historicized entries.
Example
{ "filter": { "entity_id": "1a2b3c4d-5e6f-7890-abcd-ef1234567890", "type": "ROLE" }, "per-page": 20, "page": 1, "sort": "person_last_name"}Responses
Section titled “ Responses ”List of person-resource assignments
object
The person ID.
Employee code.
Whether the person is external prevention staff.
Code of the assigned resource.
Name of the assigned resource.
Name of the office.
Name of the project.
Whether this assignment is currently active.
Whether the parent entities are 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/entity-employee/create
Assigns a person to a resource.
Requires entity_id, person_office_id, office_id, and project_id.
The entity_employee_id is auto-generated if not provided.
What to pass as entity_id depends on the type:
ROLE: pass theoffice_role_idEQUIPMENT: pass theoffice_equipment_idWORK_ENVIRONMENT: pass theoffice_work_environment_idSUBSTANCE: pass theoffice_substance_id
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Assignment to create
object
Unique identifier. Auto-generated if not provided.
The resource this person is assigned to. What to pass depends on type:
ROLE: pass theoffice_role_idEQUIPMENT: pass theoffice_equipment_idWORK_ENVIRONMENT: pass theoffice_work_environment_idSUBSTANCE: pass theoffice_substance_id
The person-office assignment. Pass the person_office_id from the PersonOffice API.
Type of resource:
ROLE: a safety organization roleEQUIPMENT: a piece of equipmentWORK_ENVIRONMENT: a work environmentSUBSTANCE: a substance
The office. Pass the office_id.
The project (company). Pass the project_id.
Responses
Section titled “ Responses ”Assignment created successfully
object
Unique identifier. Auto-generated if not provided.
The resource this person is assigned to. What to pass depends on type:
ROLE: pass theoffice_role_idEQUIPMENT: pass theoffice_equipment_idWORK_ENVIRONMENT: pass theoffice_work_environment_idSUBSTANCE: pass theoffice_substance_id
The person-office assignment. Pass the person_office_id from the PersonOffice API.
Type of resource:
ROLE: a safety organization roleEQUIPMENT: a piece of equipmentWORK_ENVIRONMENT: a work environmentSUBSTANCE: a substance
The office. Pass the office_id.
The project (company). Pass the project_id.
GET /v2/entity-employee/view/{id}
Retrieves a single assignment by its ID.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The entity_employee_id to retrieve.
Responses
Section titled “ Responses ”Assignment found
object
The person ID.
Employee code.
Whether the person is external prevention staff.
Code of the assigned resource.
Name of the assigned resource.
Name of the office.
Name of the project.
Whether this assignment is currently active.
Whether the parent entities are currently active.
Assignment not found
update
Section titled “update” PUT /v2/entity-employee/update/{id}
Updates an existing assignment.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The entity_employee_id to update.
Request Body required
Section titled “Request Body required ”Fields to update
object
Unique identifier. Auto-generated if not provided.
The resource this person is assigned to. What to pass depends on type:
ROLE: pass theoffice_role_idEQUIPMENT: pass theoffice_equipment_idWORK_ENVIRONMENT: pass theoffice_work_environment_idSUBSTANCE: pass theoffice_substance_id
The person-office assignment. Pass the person_office_id from the PersonOffice API.
Type of resource:
ROLE: a safety organization roleEQUIPMENT: a piece of equipmentWORK_ENVIRONMENT: a work environmentSUBSTANCE: a substance
The office. Pass the office_id.
The project (company). Pass the project_id.
Responses
Section titled “ Responses ”Assignment updated successfully
object
Unique identifier. Auto-generated if not provided.
The resource this person is assigned to. What to pass depends on type:
ROLE: pass theoffice_role_idEQUIPMENT: pass theoffice_equipment_idWORK_ENVIRONMENT: pass theoffice_work_environment_idSUBSTANCE: pass theoffice_substance_id
The person-office assignment. Pass the person_office_id from the PersonOffice API.
Type of resource:
ROLE: a safety organization roleEQUIPMENT: a piece of equipmentWORK_ENVIRONMENT: a work environmentSUBSTANCE: a substance
The office. Pass the office_id.
The project (company). Pass the project_id.
Assignment not found
delete
Section titled “delete” DELETE /v2/entity-employee/delete/{id}
Deletes a person-resource assignment.
If force=false (default), the response lists child entities.
If force=true, the assignment and related entities are deleted.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The entity_employee_id to delete.
Query Parameters
Section titled “Query Parameters ”If true, deletes the assignment and all child entities.
Responses
Section titled “ Responses ”Assignment deleted successfully
Preview of entities that would be deleted (returned when force=false)