ActionSession
An ActionSession represents a scheduled occurrence of a preventive action. The business meaning changes depending on the action type:
- For
TRAINING: a course edition - For
HEALTH: a medical visit - For
PER: a PPE delivery - For
MAINTENANCE: a maintenance order - For
CHECK: a check session or inspection report
A session belongs to an action and can have:
- One or more dates (ActionSessionDate): the days when it takes place
- One or more subscriptions (ActionSessionSubscription): the resources enrolled in this specific occurrence
Use this API to:
- Schedule a course edition, maintenance order, medical visit, or PPE delivery
- Find sessions for an action (filter by
action_id) - Check enrollment counts and their status (completed, failed, pending)
A session can have its own validity and validity_unit values, which override the action’s
values for certificates generated from this specific occurrence.
- 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/action-session/index
Returns a paginated list of action sessions.
Most useful filters:
action_id: all sessions for a specific actionaction_type+subtenant_id: all sessions of a type in an officetenant_id: all sessions in a company
The response includes enrollment counts and session dates.
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”Parameters for searching action sessions
object
object
Unique identifier of the session.
The action this session belongs to.
Validity unit specific to this session.
Number of validity units specific to this session.
Data fields for TRAINING sessions (course editions).
object
Type of course edition: base = initial course, update = refresher/update course.
Name of the instructor/teacher.
Name of the training provider/supplier.
Location where the course takes place.
Data fields for HEALTH sessions (medical visits).
object
Type of medical visit:
PERIODIC: periodic surveillance visitPREVENTIVE: pre-employment/preventive visitREQUEST: visit requested by the workerJOBCHANGE: visit due to change of job roleEND: end-of-employment visitSICK: visit after sick leave
Name or address of the medical facility.
Data fields for MAINTENANCE sessions (maintenance orders).
object
Name or code of the maintenance order.
Detailed description of the maintenance work (may contain HTML).
Location where the maintenance takes place.
Data fields for CHECK sessions (inspection reports).
object
Location where the check/inspection takes place.
Data fields for PER sessions (PPE deliveries).
object
Location where the PPE delivery takes place.
The office of this session.
The project of this session.
Code of the linked action.
Name of the linked action.
Type of the linked action.
Total number of resources enrolled in this session.
Number of enrolled resources that completed the session successfully.
Number of enrolled resources that did not pass.
Number of enrolled resources whose outcome has not been recorded yet.
Start date of the session (from the earliest ActionSessionDate).
End date of the session (from the latest ActionSessionDate).
Session managers (JSON).
Session assignees (JSON).
Session watchers (JSON).
Field to sort by. Prefix with minus for descending order (e.g. “-date_begin”).
Example
{ "filter": { "action_id": "c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f", "action_type": "TRAINING" }, "per-page": 10, "page": 1, "sort": "-date_begin"}Responses
Section titled “ Responses ”List of action sessions
object
Unique identifier of the session.
The action this session belongs to.
Validity unit specific to this session.
Number of validity units specific to this session.
Data fields for TRAINING sessions (course editions).
object
Type of course edition: base = initial course, update = refresher/update course.
Name of the instructor/teacher.
Name of the training provider/supplier.
Location where the course takes place.
Data fields for HEALTH sessions (medical visits).
object
Type of medical visit:
PERIODIC: periodic surveillance visitPREVENTIVE: pre-employment/preventive visitREQUEST: visit requested by the workerJOBCHANGE: visit due to change of job roleEND: end-of-employment visitSICK: visit after sick leave
Name or address of the medical facility.
Data fields for MAINTENANCE sessions (maintenance orders).
object
Name or code of the maintenance order.
Detailed description of the maintenance work (may contain HTML).
Location where the maintenance takes place.
Data fields for CHECK sessions (inspection reports).
object
Location where the check/inspection takes place.
Data fields for PER sessions (PPE deliveries).
object
Location where the PPE delivery takes place.
The office of this session.
The project of this session.
Code of the linked action.
Name of the linked action.
Type of the linked action.
Total number of resources enrolled in this session.
Number of enrolled resources that completed the session successfully.
Number of enrolled resources that did not pass.
Number of enrolled resources whose outcome has not been recorded yet.
Start date of the session (from the earliest ActionSessionDate).
End date of the session (from the latest ActionSessionDate).
Session managers (JSON).
Session assignees (JSON).
Session watchers (JSON).
Example
[ { "action_session_id": "b1c2d3e4-f5a6-7890-bcde-f12345678901", "action_id": "c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f", "validity_unit": "YEAR", "validity": 5, "subtenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "tenant_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01", "action_code": "FST-01", "action_name": "Fire Safety Training Medium Risk", "action_type": "TRAINING", "count_subscribed": 12, "count_done": 10, "count_fail": 1, "count_unknown": 1, "date_begin": "2024-03-15", "date_end": "2024-03-16" }]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/action-session/create
Creates a new session for an action.
Requires action_id, subtenant_id (office_id), and tenant_id (project_id).
The action_session_id is auto-generated if not provided.
Creating a session does not automatically create dates or enrollments. After creation, create ActionSessionDate entries (session dates) and ActionSessionSubscription entries (enrollments) separately.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Action session to create
object
Unique identifier of the session. Auto-generated if not provided on creation.
The action this session belongs to. Pass the action_id obtained from the Action API.
Validity unit specific to this session. If set, overrides the action’s validity for certificates generated from this occurrence.
Number of validity units specific to this session.
Session managers (JSON).
Session assignees (JSON).
Session watchers (JSON).
Data fields for TRAINING sessions (course editions).
object
Type of course edition: base = initial course, update = refresher/update course.
Name of the instructor/teacher.
Name of the training provider/supplier.
Location where the course takes place.
Data fields for HEALTH sessions (medical visits).
object
Type of medical visit:
PERIODIC: periodic surveillance visitPREVENTIVE: pre-employment/preventive visitREQUEST: visit requested by the workerJOBCHANGE: visit due to change of job roleEND: end-of-employment visitSICK: visit after sick leave
Name or address of the medical facility.
Data fields for MAINTENANCE sessions (maintenance orders).
object
Name or code of the maintenance order.
Detailed description of the maintenance work (may contain HTML).
Location where the maintenance takes place.
Data fields for CHECK sessions (inspection reports).
object
Location where the check/inspection takes place.
Data fields for PER sessions (PPE deliveries).
object
Location where the PPE delivery takes place.
The office (work location) of this session. Pass the office_id.
The project (company) of this session. Pass the project_id.
Example
{ "action_id": "c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f", "validity_unit": "YEAR", "validity": 5, "subtenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "tenant_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01"}Responses
Section titled “ Responses ”Action session created successfully
object
Unique identifier of the session. Auto-generated if not provided on creation.
The action this session belongs to. Pass the action_id obtained from the Action API.
Validity unit specific to this session. If set, overrides the action’s validity for certificates generated from this occurrence.
Number of validity units specific to this session.
Session managers (JSON).
Session assignees (JSON).
Session watchers (JSON).
Data fields for TRAINING sessions (course editions).
object
Type of course edition: base = initial course, update = refresher/update course.
Name of the instructor/teacher.
Name of the training provider/supplier.
Location where the course takes place.
Data fields for HEALTH sessions (medical visits).
object
Type of medical visit:
PERIODIC: periodic surveillance visitPREVENTIVE: pre-employment/preventive visitREQUEST: visit requested by the workerJOBCHANGE: visit due to change of job roleEND: end-of-employment visitSICK: visit after sick leave
Name or address of the medical facility.
Data fields for MAINTENANCE sessions (maintenance orders).
object
Name or code of the maintenance order.
Detailed description of the maintenance work (may contain HTML).
Location where the maintenance takes place.
Data fields for CHECK sessions (inspection reports).
object
Location where the check/inspection takes place.
Data fields for PER sessions (PPE deliveries).
object
Location where the PPE delivery takes place.
The office (work location) of this session. Pass the office_id.
The project (company) of this session. Pass the project_id.
Example
{ "action_session_id": "b1c2d3e4-f5a6-7890-bcde-f12345678901", "action_id": "c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f", "validity_unit": "YEAR", "validity": 5, "subtenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "tenant_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01"} GET /v2/action-session/view/{id}
Retrieves a single action session by its ID.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The action_session_id to retrieve.
Responses
Section titled “ Responses ”Action session found
object
Unique identifier of the session.
The action this session belongs to.
Validity unit specific to this session.
Number of validity units specific to this session.
Data fields for TRAINING sessions (course editions).
object
Type of course edition: base = initial course, update = refresher/update course.
Name of the instructor/teacher.
Name of the training provider/supplier.
Location where the course takes place.
Data fields for HEALTH sessions (medical visits).
object
Type of medical visit:
PERIODIC: periodic surveillance visitPREVENTIVE: pre-employment/preventive visitREQUEST: visit requested by the workerJOBCHANGE: visit due to change of job roleEND: end-of-employment visitSICK: visit after sick leave
Name or address of the medical facility.
Data fields for MAINTENANCE sessions (maintenance orders).
object
Name or code of the maintenance order.
Detailed description of the maintenance work (may contain HTML).
Location where the maintenance takes place.
Data fields for CHECK sessions (inspection reports).
object
Location where the check/inspection takes place.
Data fields for PER sessions (PPE deliveries).
object
Location where the PPE delivery takes place.
The office of this session.
The project of this session.
Code of the linked action.
Name of the linked action.
Type of the linked action.
Total number of resources enrolled in this session.
Number of enrolled resources that completed the session successfully.
Number of enrolled resources that did not pass.
Number of enrolled resources whose outcome has not been recorded yet.
Start date of the session (from the earliest ActionSessionDate).
End date of the session (from the latest ActionSessionDate).
Session managers (JSON).
Session assignees (JSON).
Session watchers (JSON).
Action session not found
update
Section titled “update” PUT /v2/action-session/update/{id}
Updates an existing action session.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The action_session_id to update.
Request Body required
Section titled “Request Body required ”Fields to update
object
Unique identifier of the session. Auto-generated if not provided on creation.
The action this session belongs to. Pass the action_id obtained from the Action API.
Validity unit specific to this session. If set, overrides the action’s validity for certificates generated from this occurrence.
Number of validity units specific to this session.
Session managers (JSON).
Session assignees (JSON).
Session watchers (JSON).
Data fields for TRAINING sessions (course editions).
object
Type of course edition: base = initial course, update = refresher/update course.
Name of the instructor/teacher.
Name of the training provider/supplier.
Location where the course takes place.
Data fields for HEALTH sessions (medical visits).
object
Type of medical visit:
PERIODIC: periodic surveillance visitPREVENTIVE: pre-employment/preventive visitREQUEST: visit requested by the workerJOBCHANGE: visit due to change of job roleEND: end-of-employment visitSICK: visit after sick leave
Name or address of the medical facility.
Data fields for MAINTENANCE sessions (maintenance orders).
object
Name or code of the maintenance order.
Detailed description of the maintenance work (may contain HTML).
Location where the maintenance takes place.
Data fields for CHECK sessions (inspection reports).
object
Location where the check/inspection takes place.
Data fields for PER sessions (PPE deliveries).
object
Location where the PPE delivery takes place.
The office (work location) of this session. Pass the office_id.
The project (company) of this session. Pass the project_id.
Example
{ "validity_unit": "YEAR", "validity": 3}Responses
Section titled “ Responses ”Action session updated successfully
object
Unique identifier of the session. Auto-generated if not provided on creation.
The action this session belongs to. Pass the action_id obtained from the Action API.
Validity unit specific to this session. If set, overrides the action’s validity for certificates generated from this occurrence.
Number of validity units specific to this session.
Session managers (JSON).
Session assignees (JSON).
Session watchers (JSON).
Data fields for TRAINING sessions (course editions).
object
Type of course edition: base = initial course, update = refresher/update course.
Name of the instructor/teacher.
Name of the training provider/supplier.
Location where the course takes place.
Data fields for HEALTH sessions (medical visits).
object
Type of medical visit:
PERIODIC: periodic surveillance visitPREVENTIVE: pre-employment/preventive visitREQUEST: visit requested by the workerJOBCHANGE: visit due to change of job roleEND: end-of-employment visitSICK: visit after sick leave
Name or address of the medical facility.
Data fields for MAINTENANCE sessions (maintenance orders).
object
Name or code of the maintenance order.
Detailed description of the maintenance work (may contain HTML).
Location where the maintenance takes place.
Data fields for CHECK sessions (inspection reports).
object
Location where the check/inspection takes place.
Data fields for PER sessions (PPE deliveries).
object
Location where the PPE delivery takes place.
The office (work location) of this session. Pass the office_id.
The project (company) of this session. Pass the project_id.
Action session not found
delete
Section titled “delete” DELETE /v2/action-session/delete/{id}
Deletes an action session.
If force=false (default), the response lists child entities (dates, enrollments).
If force=true, the session and all related entities are deleted.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The action_session_id to delete.
Query Parameters
Section titled “Query Parameters ”If true, deletes the session and all child entities. If false, returns a preview of affected entities.
Responses
Section titled “ Responses ”Action session deleted successfully
Preview of entities that would be deleted (returned when force=false)