ActionSessionSubscription
An ActionSessionSubscription represents the enrollment of a resource (person, equipment, work environment, substance, role, work group, office, PPE, or supplier) in a specific session. It links a session (ActionSession) to a compliance schedule entry (ActionSubscription).
Use this API to:
- Enroll a resource in a planned session
- Find all enrollments for a session (filter by
action_session_id) - Record the session outcome for each enrollee (field
done) - Link a certificate generated from the session (field
certificate_id)
The done field tracks the outcome:
-1: outcome not yet recorded (default)0: not passed / failed1: passed / completed
When the outcome is recorded as completed (done: 1), a certificate is typically generated
and linked via the certificate_id field.
- 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-subscription/index
Returns a paginated list of session enrollments.
Most useful filters:
action_session_id: all enrollees in a specific sessionaction_subscription_id: all sessions an enrollment is linked todone: filter by outcome (e.g.done: -1to find pending outcomes)action_type+subtenant_id: all enrollments for a type of action in an office
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”Parameters for searching session enrollments
object
object
Unique identifier of the session enrollment.
The session this enrollment belongs to.
The linked compliance schedule entry.
Additional structured data.
The office.
The project.
Session outcome (-1 pending, 0 failed, 1 completed).
Warning flag.
Certificate generated from this session for this enrollee.
Start date of validity.
Expiration date.
The ID of the enrolled resource (from the linked ActionSubscription).
The type of enrolled resource.
Code of the enrolled resource.
Name of the enrolled resource.
Code of the linked action.
Name of the linked action.
Type of the linked action.
The action this session belongs to.
Validity unit (from the session or action).
Number of validity units (from the session or action).
Start date of the session.
Field to sort by. Prefix with minus for descending order (e.g. “-subscriber_name”).
Example
{ "filter": { "action_session_id": "b1c2d3e4-f5a6-7890-bcde-f12345678901", "done": -1 }, "per-page": 10, "page": 1, "sort": "subscriber_name"}Responses
Section titled “ Responses ”List of session enrollments
object
Unique identifier of the session enrollment.
The session this enrollment belongs to.
The linked compliance schedule entry.
Additional structured data.
The office.
The project.
Session outcome (-1 pending, 0 failed, 1 completed).
Warning flag.
Certificate generated from this session for this enrollee.
Start date of validity.
Expiration date.
The ID of the enrolled resource (from the linked ActionSubscription).
The type of enrolled resource.
Code of the enrolled resource.
Name of the enrolled resource.
Code of the linked action.
Name of the linked action.
Type of the linked action.
The action this session belongs to.
Validity unit (from the session or action).
Number of validity units (from the session or action).
Start date of the session.
Example
[ { "action_session_subscription_id": "d3e4f5a6-b7c8-9012-defg-h12345678901", "action_session_id": "b1c2d3e4-f5a6-7890-bcde-f12345678901", "action_subscription_id": "d5e6f7a8-b9c0-1d2e-3f4a-5b6c7d8e9f0a", "done": 1, "warning": 0, "date_begin": "2024-03-15", "date_expire": "2029-03-15", "certificate_id": "f6a7b8c9-d0e1-2f3a-4b5c-6d7e8f9a0b1c", "subtenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "tenant_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01", "subscriber_id": "e3a1f5d2-8c4b-4e7a-9f6d-2b1c3d4e5f6a", "subscriber_type": "PERSON", "subscriber_code": "JS001", "subscriber_name": "Smith John", "action_id": "c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f", "action_code": "FST-01", "action_name": "Fire Safety Training Medium Risk", "action_type": "TRAINING", "validity_unit": "YEAR", "validity": 5, "session_date_begin": "2024-03-15" }]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-subscription/create
Creates a new session enrollment.
Requires action_session_id, action_subscription_id, subtenant_id (office_id), and tenant_id (project_id).
The action_session_subscription_id is auto-generated if not provided.
The ActionSubscription must already exist (the resource must be enrolled in the action on the compliance schedule).
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Session enrollment to create
object
Unique identifier of the session enrollment. Auto-generated if not provided on creation.
The session the resource is enrolled in. Pass the action_session_id obtained from the ActionSession API.
The compliance schedule entry this enrollment is linked to. Pass the action_subscription_id obtained from the ActionSubscription API. This connects the session to the resource and the action on the compliance schedule.
Additional structured data in JSON format. Content varies by action type.
The office (work location). Pass the office_id.
The project (company). Pass the project_id.
Session outcome for this enrollee:
-1: outcome not yet recorded (default)0: not passed / failed1: passed / completed
0: no warning (default)1: warning active
The certificate generated from this session for this enrollee. Optional — linked after creating the certificate via the Certificate API.
Start date of validity for this enrollment.
Expiration date for this enrollment.
Example
{ "action_session_id": "b1c2d3e4-f5a6-7890-bcde-f12345678901", "action_subscription_id": "d5e6f7a8-b9c0-1d2e-3f4a-5b6c7d8e9f0a", "subtenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "tenant_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01"}Responses
Section titled “ Responses ”Session enrollment created successfully
object
Unique identifier of the session enrollment. Auto-generated if not provided on creation.
The session the resource is enrolled in. Pass the action_session_id obtained from the ActionSession API.
The compliance schedule entry this enrollment is linked to. Pass the action_subscription_id obtained from the ActionSubscription API. This connects the session to the resource and the action on the compliance schedule.
Additional structured data in JSON format. Content varies by action type.
The office (work location). Pass the office_id.
The project (company). Pass the project_id.
Session outcome for this enrollee:
-1: outcome not yet recorded (default)0: not passed / failed1: passed / completed
0: no warning (default)1: warning active
The certificate generated from this session for this enrollee. Optional — linked after creating the certificate via the Certificate API.
Start date of validity for this enrollment.
Expiration date for this enrollment.
Example
{ "action_session_subscription_id": "d3e4f5a6-b7c8-9012-defg-h12345678901", "action_session_id": "b1c2d3e4-f5a6-7890-bcde-f12345678901", "action_subscription_id": "d5e6f7a8-b9c0-1d2e-3f4a-5b6c7d8e9f0a", "done": -1, "warning": 0, "subtenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "tenant_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01"} GET /v2/action-session-subscription/view/{id}
Retrieves a single session enrollment by its ID.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The action_session_subscription_id to retrieve.
Responses
Section titled “ Responses ”Session enrollment found
object
Unique identifier of the session enrollment.
The session this enrollment belongs to.
The linked compliance schedule entry.
Additional structured data.
The office.
The project.
Session outcome (-1 pending, 0 failed, 1 completed).
Warning flag.
Certificate generated from this session for this enrollee.
Start date of validity.
Expiration date.
The ID of the enrolled resource (from the linked ActionSubscription).
The type of enrolled resource.
Code of the enrolled resource.
Name of the enrolled resource.
Code of the linked action.
Name of the linked action.
Type of the linked action.
The action this session belongs to.
Validity unit (from the session or action).
Number of validity units (from the session or action).
Start date of the session.
Session enrollment not found
update
Section titled “update” PUT /v2/action-session-subscription/update/{id}
Updates an existing session enrollment.
Typical use case: recording the outcome (done: 1 or done: 0) and linking
the generated certificate (certificate_id).
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The action_session_subscription_id to update.
Request Body required
Section titled “Request Body required ”Fields to update
object
Unique identifier of the session enrollment. Auto-generated if not provided on creation.
The session the resource is enrolled in. Pass the action_session_id obtained from the ActionSession API.
The compliance schedule entry this enrollment is linked to. Pass the action_subscription_id obtained from the ActionSubscription API. This connects the session to the resource and the action on the compliance schedule.
Additional structured data in JSON format. Content varies by action type.
The office (work location). Pass the office_id.
The project (company). Pass the project_id.
Session outcome for this enrollee:
-1: outcome not yet recorded (default)0: not passed / failed1: passed / completed
0: no warning (default)1: warning active
The certificate generated from this session for this enrollee. Optional — linked after creating the certificate via the Certificate API.
Start date of validity for this enrollment.
Expiration date for this enrollment.
Example
{ "done": 1, "certificate_id": "f6a7b8c9-d0e1-2f3a-4b5c-6d7e8f9a0b1c", "date_begin": "2024-03-15", "date_expire": "2029-03-15"}Responses
Section titled “ Responses ”Session enrollment updated successfully
object
Unique identifier of the session enrollment. Auto-generated if not provided on creation.
The session the resource is enrolled in. Pass the action_session_id obtained from the ActionSession API.
The compliance schedule entry this enrollment is linked to. Pass the action_subscription_id obtained from the ActionSubscription API. This connects the session to the resource and the action on the compliance schedule.
Additional structured data in JSON format. Content varies by action type.
The office (work location). Pass the office_id.
The project (company). Pass the project_id.
Session outcome for this enrollee:
-1: outcome not yet recorded (default)0: not passed / failed1: passed / completed
0: no warning (default)1: warning active
The certificate generated from this session for this enrollee. Optional — linked after creating the certificate via the Certificate API.
Start date of validity for this enrollment.
Expiration date for this enrollment.
Session enrollment not found
delete
Section titled “delete” DELETE /v2/action-session-subscription/delete/{id}
Deletes a session enrollment.
If force=false (default), the response lists related entities.
If force=true, the enrollment is deleted.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The action_session_subscription_id to delete.
Query Parameters
Section titled “Query Parameters ”If true, deletes the enrollment. If false, returns a preview of affected entities.
Responses
Section titled “ Responses ”Session enrollment deleted successfully
Preview of affected entities (returned when force=false)