Skip to content

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 / failed
  • 1: 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

Security scheme type: oauth2

Flow type: password

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

Security scheme type: apiKey

Query parameter name: access-token

POST
/v2/action-session-subscription/index

Returns a paginated list of session enrollments.

Most useful filters:

  • action_session_id: all enrollees in a specific session
  • action_subscription_id: all sessions an enrollment is linked to
  • done: filter by outcome (e.g. done: -1 to find pending outcomes)
  • action_type + subtenant_id: all enrollments for a type of action in an office

Parameters for searching session enrollments

object
filter
object
action_session_subscription_id

Unique identifier of the session enrollment.

string format: uuid
action_session_id

The session this enrollment belongs to.

string format: uuid
action_subscription_id

The linked compliance schedule entry.

string format: uuid
data

Additional structured data.

string format: json
subtenant_id

The office.

string format: uuid
tenant_id

The project.

string format: uuid
done

Session outcome (-1 pending, 0 failed, 1 completed).

integer
default: -1
Allowed values: -1 0 1
warning

Warning flag.

integer
0
Allowed values: 0 1
certificate_id

Certificate generated from this session for this enrollee.

string format: uuid
date_begin

Start date of validity.

string format: date-time
date_expire

Expiration date.

string format: date-time
subscriber_id

The ID of the enrolled resource (from the linked ActionSubscription).

string format: uuid
subscriber_type

The type of enrolled resource.

string
Allowed values: PERSON ROLE WORK_GROUP WORK_ENVIRONMENT SUBSTANCE EQUIPMENT OFFICE PPE UNIT
subscriber_code

Code of the enrolled resource.

string
subscriber_name

Name of the enrolled resource.

string
action_code

Code of the linked action.

string
action_name

Name of the linked action.

string
action_type

Type of the linked action.

string
Allowed values: TRAINING MAINTENANCE HEALTH CHECK PER
action_id

The action this session belongs to.

string format: uuid
validity_unit

Validity unit (from the session or action).

string
Allowed values: YEAR MONTH DAY
validity

Number of validity units (from the session or action).

integer
session_date_begin

Start date of the session.

string format: date
per-page
integer
default: 100 >= 1
page
integer
default: 1 >= 1
sort

Field to sort by. Prefix with minus for descending order (e.g. “-subscriber_name”).

string
Allowed values: subscriber_type subscriber_code subscriber_name action_code action_name action_type done date_begin date_expire
Example
{
"filter": {
"action_session_id": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
"done": -1
},
"per-page": 10,
"page": 1,
"sort": "subscriber_name"
}

List of session enrollments

Array<object>
object
action_session_subscription_id

Unique identifier of the session enrollment.

string format: uuid
action_session_id

The session this enrollment belongs to.

string format: uuid
action_subscription_id

The linked compliance schedule entry.

string format: uuid
data

Additional structured data.

string format: json
subtenant_id

The office.

string format: uuid
tenant_id

The project.

string format: uuid
done

Session outcome (-1 pending, 0 failed, 1 completed).

integer
default: -1
Allowed values: -1 0 1
warning

Warning flag.

integer
0
Allowed values: 0 1
certificate_id

Certificate generated from this session for this enrollee.

string format: uuid
date_begin

Start date of validity.

string format: date-time
date_expire

Expiration date.

string format: date-time
subscriber_id

The ID of the enrolled resource (from the linked ActionSubscription).

string format: uuid
subscriber_type

The type of enrolled resource.

string
Allowed values: PERSON ROLE WORK_GROUP WORK_ENVIRONMENT SUBSTANCE EQUIPMENT OFFICE PPE UNIT
subscriber_code

Code of the enrolled resource.

string
subscriber_name

Name of the enrolled resource.

string
action_code

Code of the linked action.

string
action_name

Name of the linked action.

string
action_type

Type of the linked action.

string
Allowed values: TRAINING MAINTENANCE HEALTH CHECK PER
action_id

The action this session belongs to.

string format: uuid
validity_unit

Validity unit (from the session or action).

string
Allowed values: YEAR MONTH DAY
validity

Number of validity units (from the session or action).

integer
session_date_begin

Start date of the session.

string format: date
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"
}
]
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

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).

Session enrollment to create

object
action_session_subscription_id

Unique identifier of the session enrollment. Auto-generated if not provided on creation.

string format: uuid
action_session_id
required

The session the resource is enrolled in. Pass the action_session_id obtained from the ActionSession API.

string format: uuid
action_subscription_id
required

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.

string format: uuid
data

Additional structured data in JSON format. Content varies by action type.

string format: json
subtenant_id
required

The office (work location). Pass the office_id.

string format: uuid
tenant_id
required

The project (company). Pass the project_id.

string format: uuid
done

Session outcome for this enrollee:

  • -1: outcome not yet recorded (default)
  • 0: not passed / failed
  • 1: passed / completed
integer
default: -1
Allowed values: -1 0 1
warning
  • 0: no warning (default)
  • 1: warning active
integer
0
Allowed values: 0 1
certificate_id

The certificate generated from this session for this enrollee. Optional — linked after creating the certificate via the Certificate API.

string format: uuid
date_begin

Start date of validity for this enrollment.

string format: date-time
date_expire

Expiration date for this enrollment.

string format: date-time
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"
}

Session enrollment created successfully

object
action_session_subscription_id

Unique identifier of the session enrollment. Auto-generated if not provided on creation.

string format: uuid
action_session_id
required

The session the resource is enrolled in. Pass the action_session_id obtained from the ActionSession API.

string format: uuid
action_subscription_id
required

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.

string format: uuid
data

Additional structured data in JSON format. Content varies by action type.

string format: json
subtenant_id
required

The office (work location). Pass the office_id.

string format: uuid
tenant_id
required

The project (company). Pass the project_id.

string format: uuid
done

Session outcome for this enrollee:

  • -1: outcome not yet recorded (default)
  • 0: not passed / failed
  • 1: passed / completed
integer
default: -1
Allowed values: -1 0 1
warning
  • 0: no warning (default)
  • 1: warning active
integer
0
Allowed values: 0 1
certificate_id

The certificate generated from this session for this enrollee. Optional — linked after creating the certificate via the Certificate API.

string format: uuid
date_begin

Start date of validity for this enrollment.

string format: date-time
date_expire

Expiration date for this enrollment.

string format: date-time
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.

id
required
string format: uuid

The action_session_subscription_id to retrieve.

Session enrollment found

object
action_session_subscription_id

Unique identifier of the session enrollment.

string format: uuid
action_session_id

The session this enrollment belongs to.

string format: uuid
action_subscription_id

The linked compliance schedule entry.

string format: uuid
data

Additional structured data.

string format: json
subtenant_id

The office.

string format: uuid
tenant_id

The project.

string format: uuid
done

Session outcome (-1 pending, 0 failed, 1 completed).

integer
default: -1
Allowed values: -1 0 1
warning

Warning flag.

integer
0
Allowed values: 0 1
certificate_id

Certificate generated from this session for this enrollee.

string format: uuid
date_begin

Start date of validity.

string format: date-time
date_expire

Expiration date.

string format: date-time
subscriber_id

The ID of the enrolled resource (from the linked ActionSubscription).

string format: uuid
subscriber_type

The type of enrolled resource.

string
Allowed values: PERSON ROLE WORK_GROUP WORK_ENVIRONMENT SUBSTANCE EQUIPMENT OFFICE PPE UNIT
subscriber_code

Code of the enrolled resource.

string
subscriber_name

Name of the enrolled resource.

string
action_code

Code of the linked action.

string
action_name

Name of the linked action.

string
action_type

Type of the linked action.

string
Allowed values: TRAINING MAINTENANCE HEALTH CHECK PER
action_id

The action this session belongs to.

string format: uuid
validity_unit

Validity unit (from the session or action).

string
Allowed values: YEAR MONTH DAY
validity

Number of validity units (from the session or action).

integer
session_date_begin

Start date of the session.

string format: date

Session enrollment not found

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).

id
required
string format: uuid

The action_session_subscription_id to update.

Fields to update

object
action_session_subscription_id

Unique identifier of the session enrollment. Auto-generated if not provided on creation.

string format: uuid
action_session_id
required

The session the resource is enrolled in. Pass the action_session_id obtained from the ActionSession API.

string format: uuid
action_subscription_id
required

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.

string format: uuid
data

Additional structured data in JSON format. Content varies by action type.

string format: json
subtenant_id
required

The office (work location). Pass the office_id.

string format: uuid
tenant_id
required

The project (company). Pass the project_id.

string format: uuid
done

Session outcome for this enrollee:

  • -1: outcome not yet recorded (default)
  • 0: not passed / failed
  • 1: passed / completed
integer
default: -1
Allowed values: -1 0 1
warning
  • 0: no warning (default)
  • 1: warning active
integer
0
Allowed values: 0 1
certificate_id

The certificate generated from this session for this enrollee. Optional — linked after creating the certificate via the Certificate API.

string format: uuid
date_begin

Start date of validity for this enrollment.

string format: date-time
date_expire

Expiration date for this enrollment.

string format: date-time
Example
{
"done": 1,
"certificate_id": "f6a7b8c9-d0e1-2f3a-4b5c-6d7e8f9a0b1c",
"date_begin": "2024-03-15",
"date_expire": "2029-03-15"
}

Session enrollment updated successfully

object
action_session_subscription_id

Unique identifier of the session enrollment. Auto-generated if not provided on creation.

string format: uuid
action_session_id
required

The session the resource is enrolled in. Pass the action_session_id obtained from the ActionSession API.

string format: uuid
action_subscription_id
required

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.

string format: uuid
data

Additional structured data in JSON format. Content varies by action type.

string format: json
subtenant_id
required

The office (work location). Pass the office_id.

string format: uuid
tenant_id
required

The project (company). Pass the project_id.

string format: uuid
done

Session outcome for this enrollee:

  • -1: outcome not yet recorded (default)
  • 0: not passed / failed
  • 1: passed / completed
integer
default: -1
Allowed values: -1 0 1
warning
  • 0: no warning (default)
  • 1: warning active
integer
0
Allowed values: 0 1
certificate_id

The certificate generated from this session for this enrollee. Optional — linked after creating the certificate via the Certificate API.

string format: uuid
date_begin

Start date of validity for this enrollment.

string format: date-time
date_expire

Expiration date for this enrollment.

string format: date-time

Session enrollment not found

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.

id
required
string format: uuid

The action_session_subscription_id to delete.

force
boolean

If true, deletes the enrollment. If false, returns a preview of affected entities.

Session enrollment deleted successfully

Preview of affected entities (returned when force=false)