---
title: "ActionSessionSubscription"
url: "https://dev.4hse.com/api/actionsessionsubscription"
---

# 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

## Authentication

[Section titled “ Authentication ”](#authentication)

### OAuth2

[Section titled “OAuth2 ”](#oauth2)

**Security scheme type:** oauth2

**Flow type:** password

**Token URL:** [https://auth.4hse.com/realms/4hse/protocol/openid-connect/token](https://auth.4hse.com/realms/4hse/protocol/openid-connect/token)

### AccessToken

[Section titled “AccessToken ”](#accesstoken)

**Security scheme type:** apiKey

**Query parameter name:** access-token

## Operations

[Section titled “Operations”](#operations)

### index

[Section titled “index”](#operation-indexActionSessionSubscription-post)

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

## Authorizations

[Section titled “Authorizations ”](#authorizations)

-   **[OAuth2](/api/actionsessionsubscription/#oauth2)**
-   **[AccessToken](/api/actionsessionsubscription/#accesstoken)**

#### Request Body

[Section titled “Request Body ”](#request-body)

Parameters for searching session enrollments

Select media typeapplication/json

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"}
```

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

List of session enrollments

Select media typeapplication/json

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"  }]
```

#### Headers

[Section titled “Headers ”](#headers)

**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

### create

[Section titled “create”](#operation-createActionSessionSubscription-post)

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 ”](#authorizations)

-   **[OAuth2](/api/actionsessionsubscription/#oauth2)**
-   **[AccessToken](/api/actionsessionsubscription/#accesstoken)**

#### Request Body required

[Section titled “Request Body required ”](#request-body)

Session enrollment to create

Select media typeapplication/json

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"}
```

#### Responses

[Section titled “ Responses ”](#responses)

##### 201

[Section titled “201 ”](#201)

Session enrollment created successfully

Select media typeapplication/json

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"}
```

### view

[Section titled “view”](#operation-viewActionSessionSubscription-get)

GET

/v2/action-session-subscription/view/{id}

-   

Retrieves a single session enrollment by its ID.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

-   **[OAuth2](/api/actionsessionsubscription/#oauth2)**
-   **[AccessToken](/api/actionsessionsubscription/#accesstoken)**

#### Path Parameters

[Section titled “Path Parameters ”](#path-parameters)

**id**

required

string format: uuid

The action\_session\_subscription\_id to retrieve.

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

Session enrollment found

Select media typeapplication/json

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

##### 404

[Section titled “404 ”](#404)

Session enrollment not found

### update

[Section titled “update”](#operation-updateActionSessionSubscription-put)

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 ”](#authorizations)

-   **[OAuth2](/api/actionsessionsubscription/#oauth2)**
-   **[AccessToken](/api/actionsessionsubscription/#accesstoken)**

#### Path Parameters

[Section titled “Path Parameters ”](#path-parameters)

**id**

required

string format: uuid

The action\_session\_subscription\_id to update.

#### Request Body required

[Section titled “Request Body required ”](#request-body)

Fields to update

Select media typeapplication/json

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"}
```

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

Session enrollment updated successfully

Select media typeapplication/json

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

##### 404

[Section titled “404 ”](#404)

Session enrollment not found

### delete

[Section titled “delete”](#operation-deleteActionSessionSubscription-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 ”](#authorizations)

-   **[OAuth2](/api/actionsessionsubscription/#oauth2)**
-   **[AccessToken](/api/actionsessionsubscription/#accesstoken)**

#### Path Parameters

[Section titled “Path Parameters ”](#path-parameters)

**id**

required

string format: uuid

The action\_session\_subscription\_id to delete.

#### Query Parameters

[Section titled “Query Parameters ”](#query-parameters)

**force**

boolean

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

#### Responses

[Section titled “ Responses ”](#responses)

##### 204

[Section titled “204 ”](#204)

Session enrollment deleted successfully

##### 400

[Section titled “400 ”](#400)

Preview of affected entities (returned when force=false)

This site is protected by reCAPTCHA and the Google [Privacy Policy](https://policies.google.com/privacy) and [Terms of Service](https://policies.google.com/terms) apply.