> ## 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.

# Shift lookup

> Retrieve the next or previous shift for a worker

## Next shift

### GET /nextshift

Retrieves the next shift for a specified worker from a given date and time.

<Note>
  All three parameters are mandatory.
</Note>

**Example:** `GET /nextshift?carerId=1096&date=2025-01-01&time=12:00`

**Parameters:**

| Parameter | Required | Description                                                      |
| --------- | -------- | ---------------------------------------------------------------- |
| `carerId` | **Yes**  | Integer. Worker ID                                               |
| `date`    | **Yes**  | Format: `YYYY-MM-DD`                                             |
| `time`    | **Yes**  | Format: `HH:MM` (docs say `HH:SS` but this likely means `HH:MM`) |

**Response:**

```json theme={null}
[
  {
    "CarerId": 1096,
    "DateOfService": "2025-01-03",
    "StartTime": "07:00:00",
    "FinishTime": "08:00:00",
    "IsSleepover": "false"
  }
]
```

**Response fields:**

| Field           | Type    | Notes                                      |
| --------------- | ------- | ------------------------------------------ |
| `CarerId`       | integer |                                            |
| `DateOfService` | string  | Date                                       |
| `StartTime`     | string  | Time (HH:MM:SS)                            |
| `FinishTime`    | string  | Time (HH:MM:SS)                            |
| `IsSleepover`   | string  | `"true"` / `"false"` (string, not boolean) |

***

## Previous shift

### GET /prevshift

Retrieves the previous shift for a specified worker from a given date and time.

<Note>
  All three parameters are mandatory.
</Note>

**Example:** `GET /prevshift?carerId=1096&date=2025-01-01&time=12:00`

**Parameters:**

| Parameter | Required | Description                                                      |
| --------- | -------- | ---------------------------------------------------------------- |
| `carerId` | **Yes**  | Integer. Worker ID                                               |
| `date`    | **Yes**  | Format: `YYYY-MM-DD`                                             |
| `time`    | **Yes**  | Format: `HH:MM` (docs say `HH:SS` but this likely means `HH:MM`) |

**Response:**

```json theme={null}
[
  {
    "CarerId": 1096,
    "DateOfService": "2025-01-01",
    "StartTime": "07:00:00",
    "FinishTime": "08:00:00",
    "IsSleepover": "false"
  }
]
```

**Response fields:** Same as [Next shift](#next-shift).
