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

# HIE Opt-Out

> Update a patient's HIE (Health Information Exchange) opt-out status

The HIE opt-out endpoint allows you to control whether a patient participates in data sharing and pulling through health information exchanges. When a patient is opted out, they will not participate in data exchange through [the networks](https://www.metriport.com/blog/what-is-a-health-information-exchange).

## Query Params

**hieOptOut** `boolean` *required*

Set to `true` to opt the patient out of HIE data sharing, or `false` to opt them in

## Path Params

**id** `string` *required*

The ID of the patient whose HIE opt-out status should be updated

### Response

Returns a JSON object with the following properties:

**id** `string`

The patient's ID

**hieOptOut** `boolean`

The patient's current opt-out status. `true` indicates the patient is opted out of HIE data
sharing

**message** `string`

A human-readable message confirming the update

```javascript Metriport SDK theme={null}
import { MetriportMedicalApi } from "@metriport/api-sdk";

const metriport = new MetriportMedicalApi("YOUR_API_KEY");

const patientId = "018a80c4-292a-7486-a1234-9uiu76yhe234";
const hieOptOut = true;
const { hieOptOut, message } = await metriport.updatePatientHieOptOut(patientId, hieOptOut);
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.