Safety Requirements

PUT /safety-requirements/{id}

Update a safety requirement. Requires safety-requirements.update permission. Updating a confirmed requirement automatically creates a new version.

Path parameters

Name Type Required Description
id string yes The unique identifier of the record

Query parameters

Name Type Required Description
fields[] string[] no Select which fields to include in the response. When omitted, all fields are returned. When provided, only the specified fields are included. (e.g., ?fields[]=id&fields[]=name) One of: active, canonicalId, createdAt, description, id, isCurrent, name, onSite, order, status, updatedAt, validFrom, validTo, version.
with[] string[] no Include related resources in the response. Pass multiple values as separate query parameters (e.g., ?with[]=createdBy&with[]=updatedBy). One of: createdBy, educationalContents, educationalContentsCount, updatedBy, workSteps, workStepsCount.

Request body

Required.

application/json

  • active boolean
  • description string
  • name string · required
  • onSite boolean — Must be completed on-site (true) or can be completed pre-visit (false)
  • order integer
  • status string — Ignored on creation (always draft). Set to "confirmed" on update to make immutable.
  • validFrom string (date)
  • validTo string (date)
  • educationalContentIds string (uuid)[] — Educational content IDs to attach
  • workStepIds string (uuid)[] — Work step IDs to attach
{
    "active": true,
    "description": "Safety requirements for working with electrical equipment",
    "name": "PPE Requirements for Electrical Work",
    "onSite": true,
    "order": 1,
    "status": "draft",
    "validFrom": "2024-01-01",
    "validTo": "2024-12-31",
    "educationalContentIds": [
        "string"
    ],
    "workStepIds": [
        "string"
    ]
}

Responses

Status Description
200 A json object describing the updated safety requirement
400 The request was rejected (e.g., trying to edit confirmed requirement)
403 The requesting user lacks appropriate permissions
422 Validation errors

Response 200 body

  • data object · required
  • meta object · required
{
    "data": {
        "id": "019222d4-1d93-7d47-a3c4-b547e009a0f7",
        "active": true,
        "canonicalId": "019222d4-1d93-7d47-a3c4-b547e009a0f7",
        "createdAt": "2024-06-30T19:00:00Z",
        "createdBy": {
            "id": "019222d9-d87d-7724-bba6-ba91503ea311",
            "firstName": "John",
            "lastName": "Doe"
        },
        "description": "Safety requirements for working with electrical equipment",
        "educationalContents": [
            {
                "id": "string",
                "title": "string",
                "order": 0
            }
        ],
        "educationalContentsCount": 3,
        "isCurrent": true,
        "name": "PPE Requirements for Electrical Work",
        "onSite": true,
        "order": 1,
        "status": "draft",
        "updatedAt": "2024-06-30T19:00:00Z",
        "updatedBy": {
            "id": "019222d9-d87d-7724-bba6-ba91503ea311",
            "firstName": "John",
            "lastName": "Doe"
        },
        "validFrom": "2024-01-01",
        "validTo": "2024-12-31",
        "version": 1,
        "workSteps": [
            {
                "id": "string",
                "name": "string",
                "riskLevel": "string"
            }
        ],
        "workStepsCount": 5
    },
    "meta": {
        "requestId": "019a3a60-6328-7075-8a41-76ff545ca5d3",
        "userId": "019a3a60-929c-7820-9b35-bf79a8bf83a6",
        "organizationId": "019a3a60-8175-7a68-88da-ecb4a7040b86"
    }
}