Skip to content

Person

Represents a person with their relevant details. A person can be associated with offices, projects, and roles within the system. Optionally, a linked user account (related_user) can be assigned, enabling authentication with that identity.

Version
2.0.0
OpenAPI version
3.0.0

Security scheme type: oauth2

Flow type: password

Token URL: https://auth.4hse.com/realms/4hse/protocol/openid-connect/token

Flow type: refreshToken

Token URL: https://auth.4hse.com/realms/4hse/protocol/openid-connect/token

Security scheme type: apiKey

Query parameter name: access-token

POST
/v2/person/index

Returns a paginated and filterable list of persons. Use POST to allow complex filters via JSON payload.

Parameters for searching persons

object
filter
object
person_id
string format: uuid
code
string
<= 50 characters
first_name
string
<= 70 characters
last_name
string
<= 70 characters
street
string
<= 255 characters
locality
string
<= 50 characters
postal_code
string
<= 50 characters
region
string
<= 10 characters
sex
string
<= 10 characters
country
string
<= 50 characters
birth_date
string format: date
birth_place
string
<= 150 characters
tax_code
string
<= 30 characters
contract_type
string
is_employee
integer
Allowed values: 0 1
is_prevention_people
integer
Allowed values: 0 1
entity_id
string
project_id
string format: uuid
project_name
string
per-page
integer
default: 100 >= 1
page
integer
default: 1 >= 1
sort
string
Allowed values: first_name last_name code tax_code birth_date
history
boolean
Example
{
"filter": {
"first_name": "Mario",
"last_name": "Rossi",
"related_user": "relatedUser_manager",
"entity_id": "mario.rossi@4hse.com"
},
"per-page": 50,
"page": 2,
"sort": "-last_name"
}

List of persons

Array<object>
object
person_id
string format: uuid
code
string
<= 50 characters
first_name
string
<= 70 characters
last_name
string
<= 70 characters
street
string
<= 255 characters
locality
string
<= 50 characters
postal_code
string
<= 50 characters
region
string
<= 10 characters
sex
string
<= 10 characters
country
string
<= 50 characters
birth_date
string format: date
birth_place
string
<= 150 characters
tax_code
string
<= 30 characters
note
string
contract_type
string
is_employee
integer
Allowed values: 0 1
is_prevention_people
integer
Allowed values: 0 1
entity_id
string
project_id
string format: uuid
project_name
string
related_user
string
owned_active
boolean
parent_active
boolean
Example
{
"person_id": "person-1",
"first_name": "Mario",
"last_name": "Rossi",
"code": "MR001",
"birth_date": "1980-01-01",
"entity_id": "mario.rossi@4hse.com",
"project_id": "proj-1",
"related_user": "relatedUser_manager"
}
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

GET
/v2/person/view/{id}

Retrieve a person by its unique ID.

id
required
string format: uuid

ID of the person to retrieve. Required if code and project_id are not provided.

code
string

Code of the person to get. Required together with project_id if id is not provided

project_id
string format: uuid

Required together with code if id is not provided

Person found

object
person_id
string format: uuid
code
string
<= 50 characters
first_name
string
<= 70 characters
last_name
string
<= 70 characters
street
string
<= 255 characters
locality
string
<= 50 characters
postal_code
string
<= 50 characters
region
string
<= 10 characters
sex
string
<= 10 characters
country
string
<= 50 characters
birth_date
string format: date
birth_place
string
<= 150 characters
tax_code
string
<= 30 characters
note
string
contract_type
string
is_employee
integer
Allowed values: 0 1
is_prevention_people
integer
Allowed values: 0 1
entity_id
string
project_id
string format: uuid
project_name
string
related_user
string
owned_active
boolean
parent_active
boolean
Example
{
"person_id": "person-1",
"first_name": "Mario",
"last_name": "Rossi",
"code": "MR001",
"birth_date": "1980-01-01",
"entity_id": "mario.rossi@4hse.com",
"project_id": "proj-1",
"related_user": "relatedUser_manager"
}

Person not found

POST
/v2/person/create

Create a new person by providing the required details.

Person object to be created

object
person_id
required
string
code
string
first_name
required
string
last_name
required
string
street
string
locality
string
postal_code
string
region
string
sex
string
country
string
birth_date
required
string format: date
birth_place
string
tax_code
string
note
string
contract_type
string
is_employee
integer
Allowed values: 0 1
is_prevention_people
integer
Allowed values: 0 1
entity_id
required
string
project_id
required
string
related_user
required
string
unique_code

If true and a person with the same code already exists, the person will be updated instead of created. If the person was historicized, a new period will be started.

boolean
Example
{
"first_name": "Mario",
"last_name": "Rossi",
"code": "MR001",
"birth_date": "1980-01-01",
"entity_id": "mario.rossi@4hse.com",
"project_id": "proj-1",
"related_user": "relatedUser_manager"
}

Person created successfully

object
person_id
required
string
code
string
first_name
required
string
last_name
required
string
street
string
locality
string
postal_code
string
region
string
sex
string
country
string
birth_date
required
string format: date
birth_place
string
tax_code
string
note
string
contract_type
string
is_employee
integer
Allowed values: 0 1
is_prevention_people
integer
Allowed values: 0 1
entity_id
required
string
project_id
required
string
related_user
required
string
Example
{
"person_id": "person-2",
"first_name": "Mario",
"last_name": "Rossi",
"code": "MR001",
"birth_date": "1980-01-01",
"entity_id": "mario.rossi@4hse.com",
"project_id": "proj-1",
"related_user": "relatedUser_manager"
}
PUT
/v2/person/update/{id}

Update an existing person by its unique ID.

id
required
string format: uuid

ID of the person to update. Required if code and project_id are not provided.

code
string

Code of the person to update. Required together with project_id if id is not provided

project_id
string format: uuid

Required together with code if id is not provided

Person object with updated data

object
person_id
required
string
code
string
first_name
required
string
last_name
required
string
street
string
locality
string
postal_code
string
region
string
sex
string
country
string
birth_date
required
string format: date
birth_place
string
tax_code
string
note
string
contract_type
string
is_employee
integer
Allowed values: 0 1
is_prevention_people
integer
Allowed values: 0 1
entity_id
required
string
project_id
required
string
related_user
required
string
Example
{
"first_name": "Mario",
"last_name": "Rossi",
"code": "MR002"
}

Person updated successfully

object
person_id
required
string
code
string
first_name
required
string
last_name
required
string
street
string
locality
string
postal_code
string
region
string
sex
string
country
string
birth_date
required
string format: date
birth_place
string
tax_code
string
note
string
contract_type
string
is_employee
integer
Allowed values: 0 1
is_prevention_people
integer
Allowed values: 0 1
entity_id
required
string
project_id
required
string
related_user
required
string
Example
{
"person_id": "person-1",
"first_name": "Mario",
"last_name": "Rossi",
"code": "MR002"
}

Person not found

POST
/v2/person/historicize/{id}

Historicize an existing person.

id
required
string format: uuid

ID of the person to historicize. Required if code and project_id are not provided.

code
string

Code of the person to historicize. Required together with project_id if id is not provided

project_id
string format: uuid

Required together with code if id is not provided

Date used to historicize the person

object
date

The date of the historicization. If not provided, the current date will be used.

string format: date
2025-06-10 00:00:00

Person historicized successfully

object
person_id
required
string
code
string
first_name
required
string
last_name
required
string
street
string
locality
string
postal_code
string
region
string
sex
string
country
string
birth_date
required
string format: date
birth_place
string
tax_code
string
note
string
contract_type
string
is_employee
integer
Allowed values: 0 1
is_prevention_people
integer
Allowed values: 0 1
entity_id
required
string
project_id
required
string
related_user
required
string

Person not found

DELETE
/v2/person/delete/{id}

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

id
required
string format: uuid

ID of the person to delete. Required if code and project_id are not provided.

code
string

Code of the person to delete. Required together with project_id if id is not provided

project_id
string format: uuid

Required together with code if id is not provided

historicize
boolean

If true, the person will be historicized instead of deleted.

force
boolean

Force the deletion of the entity and all related entities

Person deleted successfully

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