# Get a patient photo

Operation ID: `patient.getPhoto`

Return a FHIR Binary photo by `binary_id`, or the patient's current photo when `binary_id` is omitted. Requires a patient Bearer JWT.

## Public method

`getPhoto`

Signature: `patient.getPhoto(query)`

Return type: `Promise<GetPhotoResponse>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`GET /patients/photo`

## Path parameters

None.

## Query parameters

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

## Body parameters

None.

Request model: None.

## Request example

None declared in canonical OpenAPI.

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`patient.GetPhotoResponse`](../models/patient.GetPhotoResponse.md) | application/json | Patient photo |

## Success response examples

### 200

```json
{
  "binary_id": "photo-example-001",
  "content_type": "image/png",
  "data": "c3ludGhldGljLWltYWdl"
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | No binary_id was given and the patient has no photo on file |
| `401` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | Authorization required — missing, invalid, expired, or non-patient Bearer JWT |
| `404` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | The authenticated patient has no FHIR Patient record, or no Binary exists with the resolved binary_id |

## Error examples

### 400 — binary_id query parameter is required

```json
{
  "error": "binary_id query parameter is required"
}
```

### 401 — Missing or invalid access token

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

### 404 — Patient not found

```json
{
  "error": "Patient not found"
}
```

### 404 — The photo does not exist

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

## NodeJS / TypeScript implementation

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

```ts
const query = {
  "binary_id": "<BINARY_ID>"
};

const result = await patient.getPhoto(query);
```

## cURL

```bash
curl -X GET \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  'https://dev-api-patient.health.cloud/patients/photo?binary_id=%3CBINARY_ID%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.
