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.
Use this API to:
- Check the compliance schedule for an office (filter by
subtenant_idwith theoffice_id) - Verify compliance: filter by
status: EXPIREDorEXPIRINGto find non-conformities - Find all requirements for a person (filter by
subscriber_idwith theperson_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 subscriptionVALID: a valid (not yet expired) certificate existsEXPIRING: the certificate is about to expire (within the days defined byexpire_intervalon the action)EXPIRED: the certificate has expired
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 ”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-subscription/index
Returns a paginated list of the compliance schedule.
Most useful filters:
subtenant_id(office_id) +status(EXPIREDorEXPIRING): find non-conformities in an officesubscriber_id(person_id) +action_type: find all requirements for a person by typeaction_id: find all resources subscribed to a specific actionaction_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 ”Request Body
Section titled “Request Body ”Parameters for searching the compliance schedule
object
object
Unique identifier of the subscription.
The preventive action this resource is subscribed to.
Type of the linked action.
Code of the linked action.
Name of the linked action.
The ID of the subscribed resource.
The type of subscribed resource.
Code of the subscribed resource.
Name of the subscribed resource.
ID of the most recent certificate linked to this subscription.
Issue date of the most recent certificate.
Expiration date of the most recent certificate.
ID of the most recent session subscription.
Date of the most recent scheduled session.
Compliance status of the subscription (automatically calculated):
NEW: no certificate existsVALID: a valid (not expired) certificate existsEXPIRING: the certificate is about to expire (withinexpire_intervaldays)EXPIRED: the certificate has expired
Name of the office.
Name of the project (company).
Type of the parent project.
The office (work location) of this subscription.
The project (company) of this subscription.
Whether this subscription is currently active in its validity period.
Whether the parent entities (action, office) are currently active.
Status of the parent project.
Status of the project subscription (billing).
Number of certificate-action approvals for this subscription.
Action managers (JSON).
Action assignees (JSON).
Action watchers (JSON).
Field to sort by. Prefix with minus for descending order (e.g. “-certificate_date_expire”).
If true, includes historicized (no longer active) entries in the results. By default only current entries are returned.
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 ”List of compliance schedule entries
object
Unique identifier of the subscription.
The preventive action this resource is subscribed to.
Type of the linked action.
Code of the linked action.
Name of the linked action.
The ID of the subscribed resource.
The type of subscribed resource.
Code of the subscribed resource.
Name of the subscribed resource.
ID of the most recent certificate linked to this subscription.
Issue date of the most recent certificate.
Expiration date of the most recent certificate.
ID of the most recent session subscription.
Date of the most recent scheduled session.
Compliance status of the subscription (automatically calculated):
NEW: no certificate existsVALID: a valid (not expired) certificate existsEXPIRING: the certificate is about to expire (withinexpire_intervaldays)EXPIRED: the certificate has expired
Name of the office.
Name of the project (company).
Type of the parent project.
The office (work location) of this subscription.
The project (company) of this subscription.
Whether this subscription is currently active in its validity period.
Whether the parent entities (action, office) are currently active.
Status of the parent project.
Status of the project subscription (billing).
Number of certificate-action approvals for this subscription.
Action managers (JSON).
Action assignees (JSON).
Action watchers (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 ”Current page
Total number of pages
Number of items per page
Total number of items
create
Section titled “create” 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,PERactions: subscriber_type must bePERSON - For
MAINTENANCEactions: subscriber_type can beEQUIPMENT,WORK_ENVIRONMENT,PPE,OFFICE - For
CHECKactions: 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 ”Request Body required
Section titled “Request Body required ”Compliance schedule entry to create
object
Unique identifier of the subscription. Auto-generated if not provided on creation.
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.
The ID of the subscribed resource. What to pass depends on subscriber_type:
PERSON: pass theperson_idEQUIPMENT: pass theoffice_equipment_idWORK_ENVIRONMENT: pass theoffice_work_environment_idSUBSTANCE: pass theoffice_substance_idROLE: pass theoffice_role_idWORK_GROUP: pass thework_group_idOFFICE: pass theoffice_idPPE: pass thematerial_item_idUNIT: pass theunit_id(supplier)
The type of subscribed resource. Must be compatible with the action’s action_type:
- For
TRAINING,HEALTH,PERactions: must bePERSON - For
MAINTENANCEactions: can beEQUIPMENT,WORK_ENVIRONMENT,PPE,OFFICE - For
CHECKactions: any type is allowed
Additional structured data in JSON format.
object
The office (work location) of this subscription. Pass the office_id.
The project (company) of this subscription. Pass the project_id.
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 ”Compliance schedule entry created successfully
object
Unique identifier of the subscription. Auto-generated if not provided on creation.
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.
The ID of the subscribed resource. What to pass depends on subscriber_type:
PERSON: pass theperson_idEQUIPMENT: pass theoffice_equipment_idWORK_ENVIRONMENT: pass theoffice_work_environment_idSUBSTANCE: pass theoffice_substance_idROLE: pass theoffice_role_idWORK_GROUP: pass thework_group_idOFFICE: pass theoffice_idPPE: pass thematerial_item_idUNIT: pass theunit_id(supplier)
The type of subscribed resource. Must be compatible with the action’s action_type:
- For
TRAINING,HEALTH,PERactions: must bePERSON - For
MAINTENANCEactions: can beEQUIPMENT,WORK_ENVIRONMENT,PPE,OFFICE - For
CHECKactions: any type is allowed
Additional structured data in JSON format.
object
The office (work location) of this subscription. Pass the office_id.
The project (company) of this subscription. Pass the project_id.
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"} GET /v2/action-subscription/view/{id}
Retrieves a single compliance schedule entry by its ID.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The action_subscription_id to retrieve.
Responses
Section titled “ Responses ”Compliance schedule entry found
object
Unique identifier of the subscription.
The preventive action this resource is subscribed to.
Type of the linked action.
Code of the linked action.
Name of the linked action.
The ID of the subscribed resource.
The type of subscribed resource.
Code of the subscribed resource.
Name of the subscribed resource.
ID of the most recent certificate linked to this subscription.
Issue date of the most recent certificate.
Expiration date of the most recent certificate.
ID of the most recent session subscription.
Date of the most recent scheduled session.
Compliance status of the subscription (automatically calculated):
NEW: no certificate existsVALID: a valid (not expired) certificate existsEXPIRING: the certificate is about to expire (withinexpire_intervaldays)EXPIRED: the certificate has expired
Name of the office.
Name of the project (company).
Type of the parent project.
The office (work location) of this subscription.
The project (company) of this subscription.
Whether this subscription is currently active in its validity period.
Whether the parent entities (action, office) are currently active.
Status of the parent project.
Status of the project subscription (billing).
Number of certificate-action approvals for this subscription.
Action managers (JSON).
Action assignees (JSON).
Action watchers (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}Compliance schedule entry not found
update
Section titled “update” PUT /v2/action-subscription/update/{id}
Updates an existing compliance schedule entry.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The action_subscription_id to update.
Request Body required
Section titled “Request Body required ”Fields to update
object
Unique identifier of the subscription. Auto-generated if not provided on creation.
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.
The ID of the subscribed resource. What to pass depends on subscriber_type:
PERSON: pass theperson_idEQUIPMENT: pass theoffice_equipment_idWORK_ENVIRONMENT: pass theoffice_work_environment_idSUBSTANCE: pass theoffice_substance_idROLE: pass theoffice_role_idWORK_GROUP: pass thework_group_idOFFICE: pass theoffice_idPPE: pass thematerial_item_idUNIT: pass theunit_id(supplier)
The type of subscribed resource. Must be compatible with the action’s action_type:
- For
TRAINING,HEALTH,PERactions: must bePERSON - For
MAINTENANCEactions: can beEQUIPMENT,WORK_ENVIRONMENT,PPE,OFFICE - For
CHECKactions: any type is allowed
Additional structured data in JSON format.
object
The office (work location) of this subscription. Pass the office_id.
The project (company) of this subscription. Pass the project_id.
Example
{ "data": { "note": "Needs urgent renewal" }}Responses
Section titled “ Responses ”Compliance schedule entry updated successfully
object
Unique identifier of the subscription. Auto-generated if not provided on creation.
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.
The ID of the subscribed resource. What to pass depends on subscriber_type:
PERSON: pass theperson_idEQUIPMENT: pass theoffice_equipment_idWORK_ENVIRONMENT: pass theoffice_work_environment_idSUBSTANCE: pass theoffice_substance_idROLE: pass theoffice_role_idWORK_GROUP: pass thework_group_idOFFICE: pass theoffice_idPPE: pass thematerial_item_idUNIT: pass theunit_id(supplier)
The type of subscribed resource. Must be compatible with the action’s action_type:
- For
TRAINING,HEALTH,PERactions: must bePERSON - For
MAINTENANCEactions: can beEQUIPMENT,WORK_ENVIRONMENT,PPE,OFFICE - For
CHECKactions: any type is allowed
Additional structured data in JSON format.
object
The office (work location) of this subscription. Pass the office_id.
The project (company) of this subscription. Pass the project_id.
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"}Compliance schedule entry not found
delete
Section titled “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 ”Path Parameters
Section titled “Path Parameters ”The action_subscription_id to delete.
Query Parameters
Section titled “Query Parameters ”If true, deletes the entry and all child entities. If false, returns a preview of affected entities.
Responses
Section titled “ Responses ”Compliance schedule entry deleted successfully
Preview of entities that would be deleted (returned when force=false)
Webhooks
Section titled “Webhooks”ACTION_SUBSCRIPTION::CREATE
Section titled “ACTION_SUBSCRIPTION::CREATE”Triggered when a new compliance schedule entry is created.
Request Body
Section titled “Request Body ”The newly created subscription
object
Unique identifier of the subscription. Auto-generated if not provided on creation.
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.
The ID of the subscribed resource. What to pass depends on subscriber_type:
PERSON: pass theperson_idEQUIPMENT: pass theoffice_equipment_idWORK_ENVIRONMENT: pass theoffice_work_environment_idSUBSTANCE: pass theoffice_substance_idROLE: pass theoffice_role_idWORK_GROUP: pass thework_group_idOFFICE: pass theoffice_idPPE: pass thematerial_item_idUNIT: pass theunit_id(supplier)
The type of subscribed resource. Must be compatible with the action’s action_type:
- For
TRAINING,HEALTH,PERactions: must bePERSON - For
MAINTENANCEactions: can beEQUIPMENT,WORK_ENVIRONMENT,PPE,OFFICE - For
CHECKactions: any type is allowed
Additional structured data in JSON format.
object
The office (work location) of this subscription. Pass the office_id.
The project (company) of this subscription. Pass the project_id.
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 ”Acknowledgment of the webhook event
ACTION_SUBSCRIPTION::DELETE
Section titled “ACTION_SUBSCRIPTION::DELETE”Triggered when a compliance schedule entry is deleted.
Request Body
Section titled “Request Body ”The deleted subscription
object
Unique identifier of the subscription. Auto-generated if not provided on creation.
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.
The ID of the subscribed resource. What to pass depends on subscriber_type:
PERSON: pass theperson_idEQUIPMENT: pass theoffice_equipment_idWORK_ENVIRONMENT: pass theoffice_work_environment_idSUBSTANCE: pass theoffice_substance_idROLE: pass theoffice_role_idWORK_GROUP: pass thework_group_idOFFICE: pass theoffice_idPPE: pass thematerial_item_idUNIT: pass theunit_id(supplier)
The type of subscribed resource. Must be compatible with the action’s action_type:
- For
TRAINING,HEALTH,PERactions: must bePERSON - For
MAINTENANCEactions: can beEQUIPMENT,WORK_ENVIRONMENT,PPE,OFFICE - For
CHECKactions: any type is allowed
Additional structured data in JSON format.
object
The office (work location) of this subscription. Pass the office_id.
The project (company) of this subscription. Pass the project_id.
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 ”Acknowledgment of the webhook event