Demand
A Demand represents a compliance requirement: the link between a preventive action and a work group that requires that action. It indicates that a specific work group (job role, work phase, or homogeneous group) needs a specific action (training, maintenance, check, etc.).
For example: a Demand linking the action “Fire Safety Training” to the work group “Welders” means that welders need that training course.
Demands can be linked to risks via RiskDemand, establishing that an action mitigates a specific risk.
Use this API to:
- Define which actions are required by which work groups
- Find all requirements for a work group (filter by
resource_idwith thework_group_id) - Find all work groups that require an action (filter by
action_id)
The combination of action_id + resource_id must be unique.
Supports historicization.
- 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/demand/index
Returns a paginated list of demands.
Most useful filters:
resource_id(work_group_id): all requirements for a specific work groupaction_id: all work groups that require a specific actionaction_type: filter by action type
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”Parameters for searching demands
object
object
object
Code of the required action.
Name of the required action.
Code of the work group.
Name of the work group.
Whether this demand is currently active.
Whether the parent entities are currently active.
If true, includes historicized entries.
Example
{ "filter": { "resource_id": "3a4b5c6d-7e8f-9012-abcd-ef3456789012", "action_type": "TRAINING" }, "per-page": 20, "page": 1, "sort": "action_name"}Responses
Section titled “ Responses ”List of demands
object
object
Code of the required action.
Name of the required action.
Code of the work group.
Name of the work group.
Whether this demand is currently active.
Whether the parent entities are currently active.
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/demand/create
Creates a new demand.
Requires action_id, action_type, resource_id, and resource_type.
The demand_id is auto-generated if not provided.
The action and work group must belong to the same office.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Demand to create
object
Unique identifier. Auto-generated if not provided.
The required action. Pass the action_id from the Action API.
Type of the required action.
The work group that requires this action. Pass the work_group_id from the WorkGroup API.
Type of resource. Use WORK_GROUP.
Additional structured data in JSON format.
object
Responses
Section titled “ Responses ”Demand created successfully
object
Unique identifier. Auto-generated if not provided.
The required action. Pass the action_id from the Action API.
Type of the required action.
The work group that requires this action. Pass the work_group_id from the WorkGroup API.
Type of resource. Use WORK_GROUP.
Additional structured data in JSON format.
object
GET /v2/demand/view/{id}
Retrieves a single demand by its ID.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The demand_id to retrieve.
Responses
Section titled “ Responses ”Demand found
object
object
Code of the required action.
Name of the required action.
Code of the work group.
Name of the work group.
Whether this demand is currently active.
Whether the parent entities are currently active.
Demand not found
update
Section titled “update” PUT /v2/demand/update/{id}
Updates an existing demand.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The demand_id to update.
Request Body required
Section titled “Request Body required ”Fields to update
object
Unique identifier. Auto-generated if not provided.
The required action. Pass the action_id from the Action API.
Type of the required action.
The work group that requires this action. Pass the work_group_id from the WorkGroup API.
Type of resource. Use WORK_GROUP.
Additional structured data in JSON format.
object
Responses
Section titled “ Responses ”Demand updated successfully
object
Unique identifier. Auto-generated if not provided.
The required action. Pass the action_id from the Action API.
Type of the required action.
The work group that requires this action. Pass the work_group_id from the WorkGroup API.
Type of resource. Use WORK_GROUP.
Additional structured data in JSON format.
object
Demand not found
delete
Section titled “delete” DELETE /v2/demand/delete/{id}
Deletes a demand.
If force=false (default), the response lists child entities (RiskDemand links).
If force=true, the demand and all related entities are deleted.
Authorizations
Section titled “Authorizations ”Path Parameters
Section titled “Path Parameters ”The demand_id to delete.
Query Parameters
Section titled “Query Parameters ”If true, deletes the demand and all child entities.
Responses
Section titled “ Responses ”Demand deleted successfully
Preview of entities that would be deleted (returned when force=false)