# List patient appointments

Operation ID: `appointments.listPatientAppointments`

Return appointments for one patient, optionally filtered by FHIR appointment status. Use each returned `appointment_id` with the cancel or reschedule operations.

## Public method

`listPatientAppointments`

Signature: `appointments.listPatientAppointments(patientId, query)`

Return type: `Promise<ListPatientAppointmentsResponse>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`GET /patients/{patient_id}/appointments`

## Path parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `patient_id` | `string` | Yes |  |  |  | No |  |

## Query parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `status` | `string` | No |  | booked, cancelled, fulfilled, noshow |  | No |  |

## Body parameters

None.

Request model: None.

## Request example

None declared in canonical OpenAPI.

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`ListPatientAppointmentsResponse`](../models/ListPatientAppointmentsResponse.md) | application/json | List of patient appointments |

## Success response examples

### 200

```json
{
  "appointments": [
    {
      "appointment_id": "string",
      "athena_appointment_id": "string",
      "created_at": "string",
      "end": "string",
      "openloop_appointment_id": "string",
      "patient_id": "string",
      "provider_id": "string",
      "slot_id": "string",
      "slot_ids": [
        "string"
      ],
      "specialty_code": "string",
      "start": "string",
      "status": "scheduled",
      "steadymd_consult_guid": "string",
      "telehealth_link": "string",
      "updated_at": "string"
    }
  ],
  "patient_id": "string",
  "total": 0
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`appointments.ErrorResponse`](../models/appointments.ErrorResponse.md) | application/json | The status filter is not supported |
| `401` | [`appointments.ErrorResponse`](../models/appointments.ErrorResponse.md) | application/json | Authorization required — missing or invalid Bearer JWT |
| `404` | [`appointments.ErrorResponse`](../models/appointments.ErrorResponse.md) | application/json | The patient was not found |
| `500` | [`appointments.ErrorResponse`](../models/appointments.ErrorResponse.md) | application/json | Internal server error |

## Error examples

### 400 — FHIR rejected the search

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

### 400 — Unsupported appointment status filter

```json
{
  "error": "'not-a-real-status' is not a valid AppointmentStatus"
}
```

### 401 — Missing or invalid access token

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

### 404 — FHIR Patient resource does not exist

```json
{
  "error": "Not Found"
}
```

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

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

## NodeJS / TypeScript implementation

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

```ts
const patientId = "<PATIENT_ID>";

const query = {
  "status": "booked"
};

const result = await appointments.listPatientAppointments(patientId, query);
```

## cURL

```bash
curl -X GET \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  'https://dev-api-appointments.health.cloud/patients/%3CPATIENT_ID%3E/appointments?status=booked'
```

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