Skip to content

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_id with the work_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

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/demand/index

Returns a paginated list of demands.

Most useful filters:

  • resource_id (work_group_id): all requirements for a specific work group
  • action_id: all work groups that require a specific action
  • action_type: filter by action type

Parameters for searching demands

object
filter
object
demand_id
string format: uuid
action_id
string format: uuid
action_type
string
Allowed values: TRAINING MAINTENANCE HEALTH CHECK PER
resource_id
string format: uuid
resource_type
string
data
object
action_code

Code of the required action.

string
action_name

Name of the required action.

string
resource_code

Code of the work group.

string
resource_name

Name of the work group.

string
office_id
string format: uuid
project_id
string format: uuid
owned_active

Whether this demand is currently active.

boolean
nullable
parent_active

Whether the parent entities are currently active.

boolean
nullable
per-page
integer
default: 100 >= 1
page
integer
default: 1 >= 1
sort
string
Allowed values: action_code action_name action_type resource_code resource_name resource_type
history

If true, includes historicized entries.

boolean
Example
{
"filter": {
"resource_id": "3a4b5c6d-7e8f-9012-abcd-ef3456789012",
"action_type": "TRAINING"
},
"per-page": 20,
"page": 1,
"sort": "action_name"
}

List of demands

Array<object>
object
demand_id
string format: uuid
action_id
string format: uuid
action_type
string
Allowed values: TRAINING MAINTENANCE HEALTH CHECK PER
resource_id
string format: uuid
resource_type
string
data
object
action_code

Code of the required action.

string
action_name

Name of the required action.

string
resource_code

Code of the work group.

string
resource_name

Name of the work group.

string
office_id
string format: uuid
project_id
string format: uuid
owned_active

Whether this demand is currently active.

boolean
nullable
parent_active

Whether the parent entities are currently active.

boolean
nullable
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/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.

Demand to create

object
demand_id

Unique identifier. Auto-generated if not provided.

string format: uuid
action_id
required

The required action. Pass the action_id from the Action API.

string format: uuid
action_type
required

Type of the required action.

string
Allowed values: TRAINING MAINTENANCE HEALTH CHECK PER
resource_id
required

The work group that requires this action. Pass the work_group_id from the WorkGroup API.

string format: uuid
resource_type
required

Type of resource. Use WORK_GROUP.

string
Allowed values: WORK_GROUP
data

Additional structured data in JSON format.

object

Demand created successfully

object
demand_id

Unique identifier. Auto-generated if not provided.

string format: uuid
action_id
required

The required action. Pass the action_id from the Action API.

string format: uuid
action_type
required

Type of the required action.

string
Allowed values: TRAINING MAINTENANCE HEALTH CHECK PER
resource_id
required

The work group that requires this action. Pass the work_group_id from the WorkGroup API.

string format: uuid
resource_type
required

Type of resource. Use WORK_GROUP.

string
Allowed values: WORK_GROUP
data

Additional structured data in JSON format.

object
GET
/v2/demand/view/{id}

Retrieves a single demand by its ID.

id
required
string format: uuid

The demand_id to retrieve.

Demand found

object
demand_id
string format: uuid
action_id
string format: uuid
action_type
string
Allowed values: TRAINING MAINTENANCE HEALTH CHECK PER
resource_id
string format: uuid
resource_type
string
data
object
action_code

Code of the required action.

string
action_name

Name of the required action.

string
resource_code

Code of the work group.

string
resource_name

Name of the work group.

string
office_id
string format: uuid
project_id
string format: uuid
owned_active

Whether this demand is currently active.

boolean
nullable
parent_active

Whether the parent entities are currently active.

boolean
nullable

Demand not found

PUT
/v2/demand/update/{id}

Updates an existing demand.

id
required
string format: uuid

The demand_id to update.

Fields to update

object
demand_id

Unique identifier. Auto-generated if not provided.

string format: uuid
action_id
required

The required action. Pass the action_id from the Action API.

string format: uuid
action_type
required

Type of the required action.

string
Allowed values: TRAINING MAINTENANCE HEALTH CHECK PER
resource_id
required

The work group that requires this action. Pass the work_group_id from the WorkGroup API.

string format: uuid
resource_type
required

Type of resource. Use WORK_GROUP.

string
Allowed values: WORK_GROUP
data

Additional structured data in JSON format.

object

Demand updated successfully

object
demand_id

Unique identifier. Auto-generated if not provided.

string format: uuid
action_id
required

The required action. Pass the action_id from the Action API.

string format: uuid
action_type
required

Type of the required action.

string
Allowed values: TRAINING MAINTENANCE HEALTH CHECK PER
resource_id
required

The work group that requires this action. Pass the work_group_id from the WorkGroup API.

string format: uuid
resource_type
required

Type of resource. Use WORK_GROUP.

string
Allowed values: WORK_GROUP
data

Additional structured data in JSON format.

object

Demand not found

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.

id
required
string format: uuid

The demand_id to delete.

force
boolean

If true, deletes the demand and all child entities.

Demand deleted successfully

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