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

# Worker documents

> Retrieve, upload, and update worker document records

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

### GET /documents-worker

Retrieves all worker documents (metadata only, no file content or download).

**Parameters:**

| Parameter    | Default | Description                                                 |
| ------------ | ------- | ----------------------------------------------------------- |
| `fromDate`   | -       | Documents from date. Format: `YYYY-MM-DD`                   |
| `toDate`     | -       | Documents before date. Format: `YYYY-MM-DD`                 |
| `CarerId`    | -       | Filter by worker's carer ID                                 |
| `categoryId` | -       | Filter by document category ID (from `/category-documents`) |

**Response:**

```json theme={null}
[
  {
    "DocId": 1705,
    "CarerId": 4472,
    "DocumentName": "MyCareConnect_User Guide Mob April 2020.pdf",
    "Note": "",
    "Protected": 0,
    "VisibleCarerMobile": 0,
    "VisibleClientMobile": 0,
    "CreatedBy": "user@example.com"
  }
]
```

**Response fields:**

| Field                 | Type    | Notes             |
| --------------------- | ------- | ----------------- |
| `DocId`               | integer |                   |
| `CarerId`             | integer |                   |
| `DocumentName`        | string  | Original filename |
| `Note`                | string  |                   |
| `Protected`           | integer | 0/1               |
| `VisibleCarerMobile`  | integer | 0/1               |
| `VisibleClientMobile` | integer | 0/1               |
| `CreatedBy`           | string  | Email             |

<Note>
  **Limitations:**

  * No file content or binary is returned, only metadata.
  * No documented endpoint exists to download file content by `DocId`.
  * The response doesn't include `CategoryId`, upload date/time, or file size.
</Note>

***

### POST /worker-doc

Uploads a document to a worker's profile.

**Required fields:** `CarerId`

**Conditionally required:** `CategoryId` (if org settings mandate category on upload)

**Content-Type: This endpoint appears to use `multipart/form-data`** based on the curl example using `-F`. The documentation shows both a curl `-F` flag example and a separate JSON body example, which is ambiguous.

**Curl example (multipart/form-data):**

```shell theme={null}
curl "https://publicapi.visualcare.com.au/worker-doc"
    -H "User: user-uuid"
    -H "Key: key"
    -H "Secret: secret"
    -F "file=@<FILE_PATH>"
```

The multipart field name for the file is `file` (lowercase), based on the curl `-F "file=@..."` example.

**JSON body fields:**

| Field           | Required    | Type    | Description                                              |
| --------------- | ----------- | ------- | -------------------------------------------------------- |
| `CarerId`       | **Yes**     | integer | Worker ID to attach document to                          |
| `CategoryId`    | Conditional | integer | Document category (required if org mandates it)          |
| `VisibleCarer`  | No          | string  | `"TRUE"` / `"FALSE"` - visible to worker on mobile       |
| `VisibleClient` | No          | string  | `"TRUE"` / `"FALSE"` - visible to client on mobile       |
| `Protect`       | No          | string  | `"TRUE"` / `"FALSE"` - mark document as protected        |
| `Filename`      | No          | string  | Local file path (for example `"/C:/path/to/local-file"`) |

**Example JSON body:**

```json theme={null}
{
  "CarerId": 1303,
  "CategoryId": 2,
  "VisibleCarer": "TRUE",
  "VisibleClient": "FALSE",
  "Protect": "TRUE",
  "Filename": "/C:/path/to/local-file"
}
```

<Warning>
  **Critical documentation gaps for POST /worker-doc:**

  1. **No success response example.** The docs don't show what a successful upload returns (status code, body structure, whether it returns the new `DocId`, and so on).
  2. **Ambiguous content type.** The curl uses `-F` (multipart/form-data) but a separate JSON body is also shown. It's unclear whether both are sent together as multipart fields, or if these are alternative approaches.
  3. **The `Filename` field purpose is unclear.** It shows a local Windows path - it may be a display name override or a legacy field. The actual file binary appears to be sent via the `file` multipart field.
  4. **No error response examples.**
  5. **Whether a 200 with null/empty body is expected behaviour is not documented.**
  6. **The curl example URL uses `documents-workers`** (the GET endpoint path), not `worker-doc` (the stated POST endpoint path). This is likely a documentation error - the actual POST URL per the `<Request>` component is `/worker-doc`.
</Warning>

***

### PUT /worker-doc

Updates metadata on an existing worker document.

**Required fields:** `LinkId`

<Note>
  The required field is `LinkId`, not `DocId`. The relationship between `LinkId` and `DocId` is not explicitly documented.
</Note>

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

**Request body:**

```json theme={null}
{
  "LinkId": 11110,
  "VisibleCarer": "TRUE",
  "VisibleClient": "FALSE"
}
```

<Note>
  No success or error response examples are provided.
</Note>
