> ## Documentation Index
> Fetch the complete documentation index at: https://support.visualcare.com.au/llms.txt
> Use this file to discover all available pages before exploring further.

# Worker compliance

> Retrieve, create, and update worker compliance items

<Warning>
  Any API POST/PUT request won't trigger a workflow.
</Warning>

### GET /compliance

Retrieves all worker compliance items.

**Parameters:** None

**Response:**

```json theme={null}
[
  {
    "FirstName": "Josh",
    "LastName": "Foster",
    "CarerId": "1512",
    "Area": "SA",
    "Area2": "",
    "Phone1": "0400000000",
    "Phone2": "",
    "Email1": "worker@example.com",
    "LinkId": 23,
    "ComplianceId": 2,
    "Required": 0,
    "StartDate": "2020-07-10",
    "AlertDate": "2021-06-10",
    "ExpiryDate": "2021-07-10",
    "Note": "non-mandatory",
    "FormId": -1,
    "Competent": 1,
    "Completed": 1,
    "Historic": 0,
    "Status": "",
    "_CreateUser": "jack@visualcare.com.au",
    "_CreateTime": "2020-06-12",
    "Description": "CPR",
    "ExpiryDays": 365,
    "WarningDays": 335,
    "Mandatory": 0,
    "NoStartDate": 0,
    "NoExpiryDate": 0,
    "vis_sw_mob": 1,
    "ExternalId": "",
    "AltId": "",
    "Role": "Support Worker"
  }
]
```

**Response fields:**

| Field          | Type    | Notes                                 |
| -------------- | ------- | ------------------------------------- |
| `FirstName`    | string  |                                       |
| `LastName`     | string  |                                       |
| `CarerId`      | string  | Note: string in response, not integer |
| `Area`         | string  |                                       |
| `Area2`        | string  |                                       |
| `Phone1`       | string  |                                       |
| `Phone2`       | string  |                                       |
| `Email1`       | string  |                                       |
| `LinkId`       | integer |                                       |
| `ComplianceId` | integer |                                       |
| `Required`     | integer | 0/1                                   |
| `StartDate`    | string  | Date                                  |
| `AlertDate`    | string  | Date                                  |
| `ExpiryDate`   | string  | Date                                  |
| `Note`         | string  |                                       |
| `FormId`       | integer | -1 if none                            |
| `Competent`    | integer | 0/1                                   |
| `Completed`    | integer | 0/1                                   |
| `Historic`     | integer | 0/1                                   |
| `Status`       | string  |                                       |
| `_CreateUser`  | string  | Email                                 |
| `_CreateTime`  | string  | Date                                  |
| `Description`  | string  |                                       |
| `ExpiryDays`   | integer |                                       |
| `WarningDays`  | integer |                                       |
| `Mandatory`    | integer | 0/1                                   |
| `NoStartDate`  | integer | 0/1                                   |
| `NoExpiryDate` | integer | 0/1                                   |
| `vis_sw_mob`   | integer | 0/1                                   |
| `ExternalId`   | string  |                                       |
| `AltId`        | string  |                                       |
| `Role`         | string  |                                       |

***

### POST /worker-compliance

Adds compliance items to a worker.

**Required fields:** `CarerId`, `ComplianceId`

**Auto-generated:** `LinkId`

**Content-Type:** `application/json`

**Request body:**

```json theme={null}
{
  "CarerId": 1303,
  "ComplianceId": 82,
  "Required": "TRUE",
  "StartDate": "1991-06-12",
  "AlertDate": "0000-00-00",
  "ExpiryDate": "1998-06-14",
  "Note": "This is mandatory",
  "Competent": "TRUE",
  "Completed": "TRUE",
  "Historic": "FALSE"
}
```

| Field          | Required | Type    | Description                                          |
| -------------- | -------- | ------- | ---------------------------------------------------- |
| `CarerId`      | **Yes**  | integer | Worker ID                                            |
| `ComplianceId` | **Yes**  | integer | Compliance item template ID                          |
| `Required`     | No       | string  | `"TRUE"` / `"FALSE"`                                 |
| `StartDate`    | No       | string  | Format: `YYYY-MM-DD`. Use `"0000-00-00"` for no date |
| `AlertDate`    | No       | string  | Format: `YYYY-MM-DD`. Use `"0000-00-00"` for no date |
| `ExpiryDate`   | No       | string  | Format: `YYYY-MM-DD`                                 |
| `Note`         | No       | string  |                                                      |
| `Competent`    | No       | string  | `"TRUE"` / `"FALSE"`                                 |
| `Completed`    | No       | string  | `"TRUE"` / `"FALSE"`                                 |
| `Historic`     | No       | string  | `"TRUE"` / `"FALSE"`                                 |

***

### PUT /worker-compliance

Updates a worker's compliance item.

**Required fields:** `LinkId`

**Content-Type:** `application/json`

**Request body:**

```json theme={null}
{
  "LinkId": 28004,
  "Note": "Mid-range game"
}
```
