---
title: "ActionSubscription"
url: "https://dev.4hse.com/api/actionsubscription"
---

# ActionSubscription

An **ActionSubscription** is a compliance schedule entry: it records that a resource (person, equipment, work environment, substance, role, work group, office, PPE, or supplier) is subscribed to a preventive action and must fulfill that requirement.

This is the API to use to enrol a person in a training course, schedule a medical examination for a worker, assign PPE to someone, plan the maintenance of a piece of equipment, or require a check procedure: in 4HSE all of these are preventive actions, and enrolling means creating an ActionSubscription that links the resource to the action.

Use this API to:

-   Check the compliance schedule for an office (filter by `subtenant_id` with the `office_id`)
-   Verify compliance: filter by `status: EXPIRED` or `EXPIRING` to find non-conformities
-   Find all requirements for a person (filter by `subscriber_id` with the `person_id`)
-   Subscribe a person or resource to a preventive action

The `status` is automatically calculated based on linked certificates:

-   `NEW`: no certificate exists for this subscription, or the certificate is in `draft`
-   `VALID`: a valid (not yet expired) certificate exists
-   `EXPIRING`: the certificate is about to expire (within the days defined by `expire_interval` on the action)
-   `EXPIRED`: the certificate has expired
-   `REVOKED`: the linked certificate has been revoked
-   `REJECTED`: the linked certificate has been rejected

The status is automatically updated when a CertificateAction is created or modified that links a certificate to the action of this subscription.

ActionSubscription supports historicization: when a subscription or any of its parent entities (action, office, person) is historicized, the subscription is automatically excluded from normal queries. The `parent_active` field in responses reflects this state. Use the `history: true` parameter in the index to include inactive subscriptions.

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-indexActionSubscription-post)

POST

/v2/action-subscription/index

-   

Returns a paginated list of the compliance schedule.

Most useful filters:

-   `subtenant_id` (office\_id) + `status` (`EXPIRED` or `EXPIRING`): find non-conformities in an office
-   `subscriber_id` (person\_id) + `action_type`: find all requirements for a person by type
-   `action_id`: find all resources subscribed to a specific action
-   `action_type` + `subtenant_id`: compliance schedule for a specific type in an office (e.g. all training at a construction site)

The response includes action details, subscribed resource details, and the most recent certificate, providing a complete compliance view without additional calls.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Request Body

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

Parameters for searching the compliance schedule

Select media typeapplication/json

object

**filter**

object

**action\_subscription\_id**

Unique identifier of the subscription.

string format: uuid

**action\_id**

The preventive action this resource is subscribed to.

string format: uuid

**action\_type**

Type of the linked action.

string

Allowed values: TRAINING MAINTENANCE HEALTH CHECK PER

**action\_code**

Code of the linked action.

string

**action\_name**

Name of the linked action.

string

**subscriber\_id**

The ID of the subscribed resource.

string format: uuid

**subscriber\_type**

The type of subscribed resource.

string

Allowed values: PERSON ROLE WORK\_GROUP WORK\_ENVIRONMENT SUBSTANCE EQUIPMENT OFFICE PPE UNIT

**subscriber\_code**

Code of the subscribed resource.

string

**subscriber\_name**

Name of the subscribed resource.

string

**last\_certificate\_id**

ID of the most recent certificate linked to this subscription.

string format: uuid

**certificate\_date\_release**

Issue date of the most recent certificate. Includes the time (UTC) when `time_precision` is 1.

string format: date

**certificate\_date\_expire**

Expiration date of the most recent certificate. Includes the time (UTC) when `time_precision` is 1.

string format: date

**time\_precision**

1 when the linked certificate uses time precision (the date fields carry a meaningful UTC time); 0 for date-only certificates. Read-only.

integer

Allowed values: 0 1

**last\_action\_session\_subscription\_id**

ID of the most recent session subscription.

string format: uuid

**date\_latest\_session**

Date of the most recent scheduled session.

string format: date

**status**

Compliance status of the subscription (automatically calculated):

-   `NEW`: no certificate exists, or the certificate is in `draft`
-   `VALID`: a valid (not expired) certificate exists
-   `EXPIRING`: the certificate is about to expire (within `expire_interval` days)
-   `EXPIRED`: the certificate has expired
-   `REVOKED`: the linked certificate has been revoked
-   `REJECTED`: the linked certificate has been rejected

string

Allowed values: NEW VALID EXPIRED EXPIRING REVOKED REJECTED

**office\_name**

Name of the office.

string

**project\_name**

Name of the project (company).

string

**project\_type**

Type of the parent project.

string

Allowed values: safety template

**subtenant\_id**

The office (work location) of this subscription.

string format: uuid

**tenant\_id**

The project (company) of this subscription.

string format: uuid

**owned\_active**

Whether this subscription is currently active in its validity period.

boolean

nullable

**parent\_active**

Whether the parent entities (action, office) are currently active.

boolean

nullable

**project\_status**

Status of the parent project.

string

Allowed values: active suspended pending\_delete deleted

**subscription\_status**

Status of the project subscription (billing).

string

Allowed values: active trial refused expiring

**certificate\_action\_approvals\_count**

Number of certificate-action approvals for this subscription.

integer

**manager**

Action managers (JSON).

string format: json

**assignee**

Action assignees (JSON).

string format: json

**watcher**

Action watchers (JSON).

string format: json

**per-page**

integer

default: 100 \>= 1

**page**

integer

default: 1 \>= 1

**sort**

Field to sort by. Prefix with minus for descending order (e.g. “-certificate\_date\_expire”).

string

Allowed values: action\_type action\_code action\_name subscriber\_type subscriber\_code subscriber\_name certificate\_date\_expire date\_latest\_session status office\_name project\_name

**history**

If true, includes historicized (no longer active) entries in the results. By default only current entries are returned.

boolean

##### Example

```
{  "filter": {    "subtenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",    "action_type": "TRAINING",    "status": "EXPIRED"  },  "per-page": 20,  "page": 1,  "sort": "certificate_date_expire"}
```

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

List of compliance schedule entries

Select media typeapplication/json

Array<object>

object

**action\_subscription\_id**

Unique identifier of the subscription.

string format: uuid

**action\_id**

The preventive action this resource is subscribed to.

string format: uuid

**action\_type**

Type of the linked action.

string

Allowed values: TRAINING MAINTENANCE HEALTH CHECK PER

**action\_code**

Code of the linked action.

string

**action\_name**

Name of the linked action.

string

**subscriber\_id**

The ID of the subscribed resource.

string format: uuid

**subscriber\_type**

The type of subscribed resource.

string

Allowed values: PERSON ROLE WORK\_GROUP WORK\_ENVIRONMENT SUBSTANCE EQUIPMENT OFFICE PPE UNIT

**subscriber\_code**

Code of the subscribed resource.

string

**subscriber\_name**

Name of the subscribed resource.

string

**last\_certificate\_id**

ID of the most recent certificate linked to this subscription.

string format: uuid

**certificate\_date\_release**

Issue date of the most recent certificate. Includes the time (UTC) when `time_precision` is 1.

string format: date

**certificate\_date\_expire**

Expiration date of the most recent certificate. Includes the time (UTC) when `time_precision` is 1.

string format: date

**time\_precision**

1 when the linked certificate uses time precision (the date fields carry a meaningful UTC time); 0 for date-only certificates. Read-only.

integer

Allowed values: 0 1

**last\_action\_session\_subscription\_id**

ID of the most recent session subscription.

string format: uuid

**date\_latest\_session**

Date of the most recent scheduled session.

string format: date

**status**

Compliance status of the subscription (automatically calculated):

-   `NEW`: no certificate exists, or the certificate is in `draft`
-   `VALID`: a valid (not expired) certificate exists
-   `EXPIRING`: the certificate is about to expire (within `expire_interval` days)
-   `EXPIRED`: the certificate has expired
-   `REVOKED`: the linked certificate has been revoked
-   `REJECTED`: the linked certificate has been rejected

string

Allowed values: NEW VALID EXPIRED EXPIRING REVOKED REJECTED

**office\_name**

Name of the office.

string

**project\_name**

Name of the project (company).

string

**project\_type**

Type of the parent project.

string

Allowed values: safety template

**subtenant\_id**

The office (work location) of this subscription.

string format: uuid

**tenant\_id**

The project (company) of this subscription.

string format: uuid

**owned\_active**

Whether this subscription is currently active in its validity period.

boolean

nullable

**parent\_active**

Whether the parent entities (action, office) are currently active.

boolean

nullable

**project\_status**

Status of the parent project.

string

Allowed values: active suspended pending\_delete deleted

**subscription\_status**

Status of the project subscription (billing).

string

Allowed values: active trial refused expiring

**certificate\_action\_approvals\_count**

Number of certificate-action approvals for this subscription.

integer

**manager**

Action managers (JSON).

string format: json

**assignee**

Action assignees (JSON).

string format: json

**watcher**

Action watchers (JSON).

string format: json

##### Example

```
[  {    "action_subscription_id": "d5e6f7a8-b9c0-1d2e-3f4a-5b6c7d8e9f0a",    "action_id": "c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f",    "action_type": "TRAINING",    "action_code": "FST-01",    "action_name": "Fire Safety Training Medium Risk",    "subscriber_id": "e3a1f5d2-8c4b-4e7a-9f6d-2b1c3d4e5f6a",    "subscriber_type": "PERSON",    "subscriber_code": "JS001",    "subscriber_name": "Smith John",    "status": "EXPIRED",    "last_certificate_id": "f6a7b8c9-d0e1-2f3a-4b5c-6d7e8f9a0b1c",    "certificate_date_release": "2020-01-15",    "certificate_date_expire": "2025-01-15",    "subtenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",    "tenant_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01",    "office_name": "Rome North Site",    "project_name": "Acme Construction Ltd",    "project_type": "safety",    "owned_active": true,    "parent_active": true  }]
```

#### 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-createActionSubscription-post)

POST

/v2/action-subscription/create

-   

Creates a new compliance schedule entry.

Requires `action_id`, `subscriber_id`, `subscriber_type`, `subtenant_id` (office\_id), and `tenant_id` (project\_id). The `action_subscription_id` is auto-generated if not provided.

The `subscriber_type` must be compatible with the action’s `action_type`:

-   For `TRAINING`, `HEALTH`, `PER` actions: subscriber\_type must be `PERSON`
-   For `MAINTENANCE` actions: subscriber\_type can be `EQUIPMENT`, `WORK_ENVIRONMENT`, `PPE`, `OFFICE`
-   For `CHECK` actions: any subscriber\_type is allowed

A new subscription starts with status `NEW`. The status will change to `VALID` only when a CertificateAction is created that links a certificate to the action of this subscription for the same resource.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Request Body required

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

Compliance schedule entry to create

Select media typeapplication/json

object

**action\_subscription\_id**

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

string format: uuid

**action\_id**

required

The preventive action this resource is subscribed to. Pass the `action_id` obtained from the Action API. If unknown, search via the Action index filtering by `subtenant_id` and `name` or `action_type`.

string format: uuid

**subscriber\_id**

required

The ID of the subscribed resource. What to pass depends on `subscriber_type`:

-   `PERSON`: pass the `person_id`
-   `EQUIPMENT`: pass the `office_equipment_id`
-   `WORK_ENVIRONMENT`: pass the `office_work_environment_id`
-   `SUBSTANCE`: pass the `office_substance_id`
-   `ROLE`: pass the `office_role_id`
-   `WORK_GROUP`: pass the `work_group_id`
-   `OFFICE`: pass the `office_id`
-   `PPE`: pass the `material_item_id`
-   `UNIT`: pass the `unit_id` (supplier)

string format: uuid

**subscriber\_type**

required

The type of subscribed resource. Must be compatible with the action’s `action_type`:

-   For `TRAINING`, `HEALTH`, `PER` actions: must be `PERSON`
-   For `MAINTENANCE` actions: can be `EQUIPMENT`, `WORK_ENVIRONMENT`, `PPE`, `OFFICE`
-   For `CHECK` actions: any type is allowed

string

Allowed values: PERSON ROLE WORK\_GROUP WORK\_ENVIRONMENT SUBSTANCE EQUIPMENT OFFICE PPE UNIT

**data**

Additional structured data in JSON format.

object

**subtenant\_id**

required

The office (work location) of this subscription. Pass the `office_id`.

string format: uuid

**tenant\_id**

required

The project (company) of this subscription. Pass the `project_id`.

string format: uuid

##### Example

```
{  "action_id": "c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f",  "subscriber_id": "e3a1f5d2-8c4b-4e7a-9f6d-2b1c3d4e5f6a",  "subscriber_type": "PERSON",  "subtenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",  "tenant_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01"}
```

#### Responses

[Section titled “ Responses ”](#responses)

##### 201

[Section titled “201 ”](#201)

Compliance schedule entry created successfully

Select media typeapplication/json

object

**action\_subscription\_id**

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

string format: uuid

**action\_id**

required

The preventive action this resource is subscribed to. Pass the `action_id` obtained from the Action API. If unknown, search via the Action index filtering by `subtenant_id` and `name` or `action_type`.

string format: uuid

**subscriber\_id**

required

The ID of the subscribed resource. What to pass depends on `subscriber_type`:

-   `PERSON`: pass the `person_id`
-   `EQUIPMENT`: pass the `office_equipment_id`
-   `WORK_ENVIRONMENT`: pass the `office_work_environment_id`
-   `SUBSTANCE`: pass the `office_substance_id`
-   `ROLE`: pass the `office_role_id`
-   `WORK_GROUP`: pass the `work_group_id`
-   `OFFICE`: pass the `office_id`
-   `PPE`: pass the `material_item_id`
-   `UNIT`: pass the `unit_id` (supplier)

string format: uuid

**subscriber\_type**

required

The type of subscribed resource. Must be compatible with the action’s `action_type`:

-   For `TRAINING`, `HEALTH`, `PER` actions: must be `PERSON`
-   For `MAINTENANCE` actions: can be `EQUIPMENT`, `WORK_ENVIRONMENT`, `PPE`, `OFFICE`
-   For `CHECK` actions: any type is allowed

string

Allowed values: PERSON ROLE WORK\_GROUP WORK\_ENVIRONMENT SUBSTANCE EQUIPMENT OFFICE PPE UNIT

**data**

Additional structured data in JSON format.

object

**subtenant\_id**

required

The office (work location) of this subscription. Pass the `office_id`.

string format: uuid

**tenant\_id**

required

The project (company) of this subscription. Pass the `project_id`.

string format: uuid

##### Example

```
{  "action_subscription_id": "d5e6f7a8-b9c0-1d2e-3f4a-5b6c7d8e9f0a",  "action_id": "c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f",  "subscriber_id": "e3a1f5d2-8c4b-4e7a-9f6d-2b1c3d4e5f6a",  "subscriber_type": "PERSON",  "subtenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",  "tenant_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01"}
```

### view

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

GET

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

-   

Retrieves a single compliance schedule entry by its ID.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Path Parameters

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

**id**

required

string format: uuid

The action\_subscription\_id to retrieve.

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

Compliance schedule entry found

Select media typeapplication/json

object

**action\_subscription\_id**

Unique identifier of the subscription.

string format: uuid

**action\_id**

The preventive action this resource is subscribed to.

string format: uuid

**action\_type**

Type of the linked action.

string

Allowed values: TRAINING MAINTENANCE HEALTH CHECK PER

**action\_code**

Code of the linked action.

string

**action\_name**

Name of the linked action.

string

**subscriber\_id**

The ID of the subscribed resource.

string format: uuid

**subscriber\_type**

The type of subscribed resource.

string

Allowed values: PERSON ROLE WORK\_GROUP WORK\_ENVIRONMENT SUBSTANCE EQUIPMENT OFFICE PPE UNIT

**subscriber\_code**

Code of the subscribed resource.

string

**subscriber\_name**

Name of the subscribed resource.

string

**last\_certificate\_id**

ID of the most recent certificate linked to this subscription.

string format: uuid

**certificate\_date\_release**

Issue date of the most recent certificate. Includes the time (UTC) when `time_precision` is 1.

string format: date

**certificate\_date\_expire**

Expiration date of the most recent certificate. Includes the time (UTC) when `time_precision` is 1.

string format: date

**time\_precision**

1 when the linked certificate uses time precision (the date fields carry a meaningful UTC time); 0 for date-only certificates. Read-only.

integer

Allowed values: 0 1

**last\_action\_session\_subscription\_id**

ID of the most recent session subscription.

string format: uuid

**date\_latest\_session**

Date of the most recent scheduled session.

string format: date

**status**

Compliance status of the subscription (automatically calculated):

-   `NEW`: no certificate exists, or the certificate is in `draft`
-   `VALID`: a valid (not expired) certificate exists
-   `EXPIRING`: the certificate is about to expire (within `expire_interval` days)
-   `EXPIRED`: the certificate has expired
-   `REVOKED`: the linked certificate has been revoked
-   `REJECTED`: the linked certificate has been rejected

string

Allowed values: NEW VALID EXPIRED EXPIRING REVOKED REJECTED

**office\_name**

Name of the office.

string

**project\_name**

Name of the project (company).

string

**project\_type**

Type of the parent project.

string

Allowed values: safety template

**subtenant\_id**

The office (work location) of this subscription.

string format: uuid

**tenant\_id**

The project (company) of this subscription.

string format: uuid

**owned\_active**

Whether this subscription is currently active in its validity period.

boolean

nullable

**parent\_active**

Whether the parent entities (action, office) are currently active.

boolean

nullable

**project\_status**

Status of the parent project.

string

Allowed values: active suspended pending\_delete deleted

**subscription\_status**

Status of the project subscription (billing).

string

Allowed values: active trial refused expiring

**certificate\_action\_approvals\_count**

Number of certificate-action approvals for this subscription.

integer

**manager**

Action managers (JSON).

string format: json

**assignee**

Action assignees (JSON).

string format: json

**watcher**

Action watchers (JSON).

string format: json

##### Example

```
{  "action_subscription_id": "d5e6f7a8-b9c0-1d2e-3f4a-5b6c7d8e9f0a",  "action_id": "c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f",  "action_type": "TRAINING",  "action_code": "FST-01",  "action_name": "Fire Safety Training Medium Risk",  "subscriber_id": "e3a1f5d2-8c4b-4e7a-9f6d-2b1c3d4e5f6a",  "subscriber_type": "PERSON",  "subscriber_code": "JS001",  "subscriber_name": "Smith John",  "status": "EXPIRED",  "last_certificate_id": "f6a7b8c9-d0e1-2f3a-4b5c-6d7e8f9a0b1c",  "certificate_date_release": "2020-01-15",  "certificate_date_expire": "2025-01-15",  "subtenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",  "tenant_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01",  "office_name": "Rome North Site",  "project_name": "Acme Construction Ltd",  "owned_active": true,  "parent_active": true}
```

##### 404

[Section titled “404 ”](#404)

Compliance schedule entry not found

### update

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

PUT

/v2/action-subscription/update/{id}

-   

Updates an existing compliance schedule entry.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Path Parameters

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

**id**

required

string format: uuid

The action\_subscription\_id to update.

#### Request Body required

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

Fields to update

Select media typeapplication/json

object

**action\_subscription\_id**

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

string format: uuid

**action\_id**

required

The preventive action this resource is subscribed to. Pass the `action_id` obtained from the Action API. If unknown, search via the Action index filtering by `subtenant_id` and `name` or `action_type`.

string format: uuid

**subscriber\_id**

required

The ID of the subscribed resource. What to pass depends on `subscriber_type`:

-   `PERSON`: pass the `person_id`
-   `EQUIPMENT`: pass the `office_equipment_id`
-   `WORK_ENVIRONMENT`: pass the `office_work_environment_id`
-   `SUBSTANCE`: pass the `office_substance_id`
-   `ROLE`: pass the `office_role_id`
-   `WORK_GROUP`: pass the `work_group_id`
-   `OFFICE`: pass the `office_id`
-   `PPE`: pass the `material_item_id`
-   `UNIT`: pass the `unit_id` (supplier)

string format: uuid

**subscriber\_type**

required

The type of subscribed resource. Must be compatible with the action’s `action_type`:

-   For `TRAINING`, `HEALTH`, `PER` actions: must be `PERSON`
-   For `MAINTENANCE` actions: can be `EQUIPMENT`, `WORK_ENVIRONMENT`, `PPE`, `OFFICE`
-   For `CHECK` actions: any type is allowed

string

Allowed values: PERSON ROLE WORK\_GROUP WORK\_ENVIRONMENT SUBSTANCE EQUIPMENT OFFICE PPE UNIT

**data**

Additional structured data in JSON format.

object

**subtenant\_id**

required

The office (work location) of this subscription. Pass the `office_id`.

string format: uuid

**tenant\_id**

required

The project (company) of this subscription. Pass the `project_id`.

string format: uuid

##### Example

```
{  "data": {    "note": "Needs urgent renewal"  }}
```

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

Compliance schedule entry updated successfully

Select media typeapplication/json

object

**action\_subscription\_id**

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

string format: uuid

**action\_id**

required

The preventive action this resource is subscribed to. Pass the `action_id` obtained from the Action API. If unknown, search via the Action index filtering by `subtenant_id` and `name` or `action_type`.

string format: uuid

**subscriber\_id**

required

The ID of the subscribed resource. What to pass depends on `subscriber_type`:

-   `PERSON`: pass the `person_id`
-   `EQUIPMENT`: pass the `office_equipment_id`
-   `WORK_ENVIRONMENT`: pass the `office_work_environment_id`
-   `SUBSTANCE`: pass the `office_substance_id`
-   `ROLE`: pass the `office_role_id`
-   `WORK_GROUP`: pass the `work_group_id`
-   `OFFICE`: pass the `office_id`
-   `PPE`: pass the `material_item_id`
-   `UNIT`: pass the `unit_id` (supplier)

string format: uuid

**subscriber\_type**

required

The type of subscribed resource. Must be compatible with the action’s `action_type`:

-   For `TRAINING`, `HEALTH`, `PER` actions: must be `PERSON`
-   For `MAINTENANCE` actions: can be `EQUIPMENT`, `WORK_ENVIRONMENT`, `PPE`, `OFFICE`
-   For `CHECK` actions: any type is allowed

string

Allowed values: PERSON ROLE WORK\_GROUP WORK\_ENVIRONMENT SUBSTANCE EQUIPMENT OFFICE PPE UNIT

**data**

Additional structured data in JSON format.

object

**subtenant\_id**

required

The office (work location) of this subscription. Pass the `office_id`.

string format: uuid

**tenant\_id**

required

The project (company) of this subscription. Pass the `project_id`.

string format: uuid

##### Example

```
{  "action_subscription_id": "d5e6f7a8-b9c0-1d2e-3f4a-5b6c7d8e9f0a",  "action_id": "c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f",  "subscriber_id": "e3a1f5d2-8c4b-4e7a-9f6d-2b1c3d4e5f6a",  "subscriber_type": "PERSON"}
```

##### 404

[Section titled “404 ”](#404)

Compliance schedule entry not found

### delete

[Section titled “delete”](#operation-deleteActionSubscription-delete)

DELETE

/v2/action-subscription/delete/{id}

-   

Deletes a compliance schedule entry.

If `force=false` (default), the response lists child entities. If `force=true`, the entry and all related entities are deleted.

## Authorizations

[Section titled “Authorizations ”](#authorizations)

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

#### Path Parameters

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

**id**

required

string format: uuid

The action\_subscription\_id to delete.

#### Query Parameters

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

**force**

boolean

If true, deletes the entry and all child entities. If false, returns a preview of affected entities.

#### Responses

[Section titled “ Responses ”](#responses)

##### 204

[Section titled “204 ”](#204)

Compliance schedule entry deleted successfully

##### 400

[Section titled “400 ”](#400)

Preview of entities that would be deleted (returned when force=false)

## Webhooks

[Section titled “Webhooks”](#webhooks)

#### ACTION\_SUBSCRIPTION::CREATE

[Section titled “ACTION\_SUBSCRIPTION::CREATE”](#webhook-ACTION_SUBSCRIPTION::CREATE)

POST

Triggered when a new compliance schedule entry is created.

#### Request Body

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

The newly created subscription

Select media typeapplication/json

object

**action\_subscription\_id**

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

string format: uuid

**action\_id**

required

The preventive action this resource is subscribed to. Pass the `action_id` obtained from the Action API. If unknown, search via the Action index filtering by `subtenant_id` and `name` or `action_type`.

string format: uuid

**subscriber\_id**

required

The ID of the subscribed resource. What to pass depends on `subscriber_type`:

-   `PERSON`: pass the `person_id`
-   `EQUIPMENT`: pass the `office_equipment_id`
-   `WORK_ENVIRONMENT`: pass the `office_work_environment_id`
-   `SUBSTANCE`: pass the `office_substance_id`
-   `ROLE`: pass the `office_role_id`
-   `WORK_GROUP`: pass the `work_group_id`
-   `OFFICE`: pass the `office_id`
-   `PPE`: pass the `material_item_id`
-   `UNIT`: pass the `unit_id` (supplier)

string format: uuid

**subscriber\_type**

required

The type of subscribed resource. Must be compatible with the action’s `action_type`:

-   For `TRAINING`, `HEALTH`, `PER` actions: must be `PERSON`
-   For `MAINTENANCE` actions: can be `EQUIPMENT`, `WORK_ENVIRONMENT`, `PPE`, `OFFICE`
-   For `CHECK` actions: any type is allowed

string

Allowed values: PERSON ROLE WORK\_GROUP WORK\_ENVIRONMENT SUBSTANCE EQUIPMENT OFFICE PPE UNIT

**data**

Additional structured data in JSON format.

object

**subtenant\_id**

required

The office (work location) of this subscription. Pass the `office_id`.

string format: uuid

**tenant\_id**

required

The project (company) of this subscription. Pass the `project_id`.

string format: uuid

##### Example

```
{  "action_subscription_id": "d5e6f7a8-b9c0-1d2e-3f4a-5b6c7d8e9f0a",  "action_id": "c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f",  "subscriber_id": "e3a1f5d2-8c4b-4e7a-9f6d-2b1c3d4e5f6a",  "subscriber_type": "PERSON",  "subtenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",  "tenant_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01"}
```

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

Acknowledgment of the webhook event

#### ACTION\_SUBSCRIPTION::DELETE

[Section titled “ACTION\_SUBSCRIPTION::DELETE”](#webhook-ACTION_SUBSCRIPTION::DELETE)

POST

Triggered when a compliance schedule entry is deleted.

#### Request Body

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

The deleted subscription

Select media typeapplication/json

object

**action\_subscription\_id**

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

string format: uuid

**action\_id**

required

The preventive action this resource is subscribed to. Pass the `action_id` obtained from the Action API. If unknown, search via the Action index filtering by `subtenant_id` and `name` or `action_type`.

string format: uuid

**subscriber\_id**

required

The ID of the subscribed resource. What to pass depends on `subscriber_type`:

-   `PERSON`: pass the `person_id`
-   `EQUIPMENT`: pass the `office_equipment_id`
-   `WORK_ENVIRONMENT`: pass the `office_work_environment_id`
-   `SUBSTANCE`: pass the `office_substance_id`
-   `ROLE`: pass the `office_role_id`
-   `WORK_GROUP`: pass the `work_group_id`
-   `OFFICE`: pass the `office_id`
-   `PPE`: pass the `material_item_id`
-   `UNIT`: pass the `unit_id` (supplier)

string format: uuid

**subscriber\_type**

required

The type of subscribed resource. Must be compatible with the action’s `action_type`:

-   For `TRAINING`, `HEALTH`, `PER` actions: must be `PERSON`
-   For `MAINTENANCE` actions: can be `EQUIPMENT`, `WORK_ENVIRONMENT`, `PPE`, `OFFICE`
-   For `CHECK` actions: any type is allowed

string

Allowed values: PERSON ROLE WORK\_GROUP WORK\_ENVIRONMENT SUBSTANCE EQUIPMENT OFFICE PPE UNIT

**data**

Additional structured data in JSON format.

object

**subtenant\_id**

required

The office (work location) of this subscription. Pass the `office_id`.

string format: uuid

**tenant\_id**

required

The project (company) of this subscription. Pass the `project_id`.

string format: uuid

##### Example

```
{  "action_subscription_id": "d5e6f7a8-b9c0-1d2e-3f4a-5b6c7d8e9f0a",  "action_id": "c4d5e6f7-a8b9-0c1d-2e3f-4a5b6c7d8e9f",  "subscriber_id": "e3a1f5d2-8c4b-4e7a-9f6d-2b1c3d4e5f6a",  "subscriber_type": "PERSON",  "subtenant_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",  "tenant_id": "b5a7d602-3fc9-4e2a-9d1a-6e5b4c8f7a01"}
```

#### Responses

[Section titled “ Responses ”](#responses)

##### 200

[Section titled “200 ”](#200)

Acknowledgment of the webhook event

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.