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

<ParamField query="treatmentRelationship" type="boolean" required>
  Set to `true` to grant treatment relationship consent, or `false` to revoke it
</ParamField>

## Path Params

<ParamField path="id" type="string" required>
  The ID of the patient whose treatment relationship consent should be updated
</ParamField>

### Response

Returns a JSON object with the following properties:

<ResponseField name="id" type="string">
  The patient's ID
</ResponseField>

<ResponseField name="treatmentRelationship" type="boolean">
  The patient's current treatment relationship consent. `true` indicates consent is granted
</ResponseField>

<ResponseField name="message" type="string">
  A human-readable message confirming the update
</ResponseField>

<ResponseExample>
  ```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);
  ```
</ResponseExample>

## 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](/medical-api/api-reference/cohort/add-patients-to-cohort) or [Add Patient to Cohorts](/medical-api/api-reference/patient/add-patient-to-cohorts)
* Patients without consent will be ineligible for [Network Queries](https://docs.metriport.com/medical-api/api-reference/network/start-network-query) and [Document Queries](https://docs.metriport.com/medical-api/legacy-api-reference/document/start-document-query)
* You can also set `status.treatmentRelationship` when [creating](/medical-api/api-reference/patient/create-patient) or [updating](/medical-api/api-reference/patient/update-patient) a patient
