PersonOffice
A PersonOffice represents the assignment of a person to an office. It is the entity that links a person (worker) to a work location within the same project.
A person can be assigned to multiple offices, and an office can have multiple people assigned to it.
Use this API to:
- Assign a person to an office after creating them
- Find all people assigned to an office (filter by
office_id) - Find all offices a person is assigned to (filter by
person_id) - Look up personal details in the context of their office assignment
The index and view responses include the person’s details and office information, providing a complete view without additional calls.
When a PersonOffice is historicized, its child entities (work groups, etc.) are automatically
excluded from normal queries. The parent_active field reflects this state.
- 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/person-office/index
Returns a paginated list of person-office assignments.
Most useful filters:
office_id: all people assigned to a specific officeperson_id: all offices a person is assigned toperson_last_name+office_id: find a person by last name in a specific officeperson_tax_code: find by tax code
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”Parameters for searching person-office assignments
object
object
Unique identifier of the assignment.
The office the person is assigned to.
The assigned person.
The project this assignment belongs to.
Employee code of the person.
First name of the person.
Last name of the person.
Whether the person is a company employee.
Whether the person is external prevention staff.
Residential address.
City.
Postal code.
Region or province.
Country code.
Date of birth.
Place of birth.
Tax code (fiscal code).
Free-text notes.
Employment contract type.
Email of the linked user account.
Sex.
Name of the project (company).
Type of the parent project.
Code of the office.
Name of the office.
Whether this assignment is currently active in its validity period.
Whether the parent entities (office, person) are currently active.
Field to sort by. Prefix with minus for descending order (e.g. “-person_last_name”).
If true, includes historicized (no longer active) entries in the results. By default only current entries are returned.
Example
{ "filter": { "office_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "person_last_name": "Smith" }, "per-page": 50, "page": 1, "sort": "person_last_name"}Responses
Section titled “ Responses ”List of person-office assignments
object
Unique identifier of the assignment.
The office the person is assigned to.
The assigned person.
The project this assignment belongs to.
Employee code of the person.
First name of the person.
Last name of the person.
Whether the person is a company employee.
Whether the person is external prevention staff.
Residential address.
City.
Postal code.
Region or province.
Country code.
Date of birth.
Place of birth.
Tax code (fiscal code).
Free-text notes.
Employment contract type.
Email of the linked user account.
Sex.
Name of the project (company).
Type of the parent project.
Code of the office.
Name of the office.
Whether this assignment is currently active in its validity period.
Whether the parent entities (office, person) are currently active.
Example
[ { "person_office_id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890", "office_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "person_id": "e3a1f5d2-8c4b-4e7a-9f6d-2b1c3d4e5f6a", "project_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01", "person_code": "JS001", "person_first_name": "John", "person_last_name": "Smith", "person_tax_code": "SMTJHN85C15H501Z", "person_birth_date": "1985-03-15", "person_is_employee": true, "office_name": "Rome North Site", "office_code": "RN-001", "project_name": "Acme Construction Ltd", "project_type": "safety", "owned_active": true, "parent_active": true }]Headers
Section titled “Headers ”Current page
Total number of pages
Number of items per page
Total number of items
GET /v2/person-office/view/{id}
Retrieves a single person-office assignment by its ID.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The person_office_id to retrieve.
Responses
Section titled “ Responses ”Person-office assignment found
object
Unique identifier of the assignment.
The office the person is assigned to.
The assigned person.
The project this assignment belongs to.
Employee code of the person.
First name of the person.
Last name of the person.
Whether the person is a company employee.
Whether the person is external prevention staff.
Residential address.
City.
Postal code.
Region or province.
Country code.
Date of birth.
Place of birth.
Tax code (fiscal code).
Free-text notes.
Employment contract type.
Email of the linked user account.
Sex.
Name of the project (company).
Type of the parent project.
Code of the office.
Name of the office.
Whether this assignment is currently active in its validity period.
Whether the parent entities (office, person) are currently active.
Example
{ "person_office_id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890", "office_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "person_id": "e3a1f5d2-8c4b-4e7a-9f6d-2b1c3d4e5f6a", "project_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01", "person_code": "JS001", "person_first_name": "John", "person_last_name": "Smith", "person_tax_code": "SMTJHN85C15H501Z", "person_birth_date": "1985-03-15", "person_is_employee": true, "office_name": "Rome North Site", "office_code": "RN-001", "project_name": "Acme Construction Ltd", "project_type": "safety", "owned_active": true, "parent_active": true}Person-office assignment not found
create
Section titled “create” POST /v2/person-office/create
Creates a new person-office assignment.
Requires office_id, person_id, and project_id. The person_office_id is auto-generated if not provided.
The person and the office must already exist and belong to the same project.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Person-office assignment to create
object
Unique identifier of the assignment. Auto-generated if not provided on creation.
The office (work location) the person is assigned to. Pass the office_id obtained from the Office API.
The person assigned to this office. Pass the person_id obtained from the Person API.
The project (company) this assignment belongs to. Must be the same project as both the person and the office.
Example
{ "office_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "person_id": "e3a1f5d2-8c4b-4e7a-9f6d-2b1c3d4e5f6a", "project_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01"}Responses
Section titled “ Responses ”Person-office assignment created successfully
object
Unique identifier of the assignment. Auto-generated if not provided on creation.
The office (work location) the person is assigned to. Pass the office_id obtained from the Office API.
The person assigned to this office. Pass the person_id obtained from the Person API.
The project (company) this assignment belongs to. Must be the same project as both the person and the office.
Example
{ "person_office_id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890", "office_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "person_id": "e3a1f5d2-8c4b-4e7a-9f6d-2b1c3d4e5f6a", "project_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01"}update
Section titled “update” PUT /v2/person-office/update/{id}
Updates an existing person-office assignment.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The person_office_id to update.
Request Body required
Section titled “Request Body required ”Person-office fields to update
object
Unique identifier of the assignment. Auto-generated if not provided on creation.
The office (work location) the person is assigned to. Pass the office_id obtained from the Office API.
The person assigned to this office. Pass the person_id obtained from the Person API.
The project (company) this assignment belongs to. Must be the same project as both the person and the office.
Example
{ "office_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901"}Responses
Section titled “ Responses ”Person-office assignment updated successfully
object
Unique identifier of the assignment. Auto-generated if not provided on creation.
The office (work location) the person is assigned to. Pass the office_id obtained from the Office API.
The person assigned to this office. Pass the person_id obtained from the Person API.
The project (company) this assignment belongs to. Must be the same project as both the person and the office.
Example
{ "person_office_id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890", "office_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "person_id": "e3a1f5d2-8c4b-4e7a-9f6d-2b1c3d4e5f6a", "project_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01"}Person-office assignment not found
delete
Section titled “delete” DELETE /v2/person-office/delete/{id}
Deletes a person-office assignment.
If force=false (default), the operation is interrupted and the response lists
child entities that would be deleted.
If force=true, the assignment and all related entities are deleted.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The person_office_id to delete.
Query Parameters
Section titled “Query Parameters ”If true, deletes the assignment and all child entities. If false, returns a preview of affected entities.
Responses
Section titled “ Responses ”Person-office assignment deleted successfully
Preview of entities that would be deleted (returned when force=false)