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

# Treatment Relationship

> Update a patient's treatment relationship consent status

The treatment relationship endpoint allows you to control whether a patient has treatment relationship consent. Patients without consent cannot be assigned to treatment cohorts. Revoking consent automatically removes the patient from all treatment cohorts. Operations cohorts are unaffected.

## Query Params

**treatmentRelationship** `boolean` *required*

Set to `true` to grant treatment relationship consent, or `false` to revoke it

## Path Params

**id** `string` *required*

The ID of the patient whose treatment relationship consent should be updated

### Response

Returns a JSON object with the following properties:

**id** `string`

The patient's ID

**treatmentRelationship** `boolean`

The patient's current treatment relationship consent. `true` indicates consent is granted

**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 treatmentRelationship = false;
const { treatmentRelationship: updatedConsent, message } =
  await metriport.updatePatientTreatmentRelationship(patientId, treatmentRelationship);
```

## Notes

* Revoking consent (`treatmentRelationship: false`) automatically removes the patient from all treatment cohorts
* Patients without consent cannot be added to treatment cohorts via [Add Patients to Cohort](https://docs.metriport.com/medical-api/api-reference/cohort/add-patients-to-cohort.md) or [Add Patient to Cohorts](https://docs.metriport.com/medical-api/api-reference/patient/add-patient-to-cohorts.md)
* Patients without consent will be ineligible for [Network Queries](https://docs.metriport.com/medical-api/api-reference/network/start-network-query.md) and [Document Queries](https://docs.metriport.com/medical-api/legacy-api-reference/document/start-document-query.md)
* You can also set `status.treatmentRelationship` when [creating](https://docs.metriport.com/medical-api/api-reference/patient/create-patient.md) or [updating](https://docs.metriport.com/medical-api/api-reference/patient/update-patient.md) a patient


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