# List available slots

Operation ID: `appointments.listSlots`

Return bookable slots, optionally restricted to a provider, specialty, or inclusive date range. Use a returned `slot_id` as input to `appointments.book` or `appointments.reschedule`.

## Public method

`listSlots`

Signature: `appointments.listSlots(query)`

Return type: `Promise<ListSlotsResponse>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`GET /slots`

## Path parameters

None.

## Query parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `date_from` | `string` | No |  |  |  | No | ISO date start (e.g. 2025-06-01) |
| `date_to` | `string` | No |  |  |  | No | ISO date end (e.g. 2025-06-30) |
| `provider_id` | `string` | No |  |  |  | No | FHIR Practitioner resource ID |
| `specialty_code` | `string` | No |  |  |  | No | Specialty code (e.g. general-practice, cardiology) |

## Body parameters

None.

Request model: None.

## Request example

None declared in canonical OpenAPI.

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`ListSlotsResponse`](../models/ListSlotsResponse.md) | application/json | Paginated list of available slots |

## Success response examples

### 200

```json
{
  "slots": [
    {
      "athena_appointment_id": "string",
      "end": "2026-01-01T09:00:00Z",
      "location": "string",
      "openloop_appointment_id": "string",
      "provider_id": "string",
      "provider_name": "string",
      "slot_id": "string",
      "specialty_code": "string",
      "start": "2026-01-01T09:00:00Z",
      "status": "free",
      "steadymd_clinician_guid": "string"
    }
  ],
  "total": 0
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`appointments.ErrorResponse`](../models/appointments.ErrorResponse.md) | application/json | The downstream FHIR service rejected one or more filters |
| `401` | [`appointments.ErrorResponse`](../models/appointments.ErrorResponse.md) | application/json | Authorization required — missing or invalid Bearer JWT |
| `500` | [`appointments.ErrorResponse`](../models/appointments.ErrorResponse.md) | application/json | Internal server error |

## Error examples

### 400 — FHIR rejected a slot filter

```json
{
  "error": "Bad Request",
  "outcome": {
    "issue": [
      {
        "diagnostics": "Invalid slot filter",
        "severity": "error"
      }
    ],
    "resourceType": "OperationOutcome"
  }
}
```

### 401 — Missing or invalid access token

```json
{
  "error": "Authorization required"
}
```

### 500 — Unexpected service failure (sanitized example)

```json
{
  "error": "Internal server error"
}
```

## NodeJS / TypeScript implementation

```ts
import { HCSDK } from "@healthcloudai/hc-sdk";
```

```ts
const query = {
  "date_from": "2026-08-01",
  "date_to": "2026-08-31",
  "provider_id": "<PROVIDER_ID>",
  "specialty_code": "<SPECIALTY_CODE>"
};

const result = await appointments.listSlots(query);
```

## cURL

```bash
curl -X GET \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  'https://dev-api-appointments.health.cloud/slots?date_from=2026-08-01&date_to=2026-08-31&provider_id=%3CPROVIDER_ID%3E&specialty_code=%3CSPECIALTY_CODE%3E'
```

## Notes

None.

## Prepared Test Console scenario

No canonical scenario is currently associated.

## Real response

No approved real integration response is currently published. Unapproved candidates are never rendered as examples.
