Skip to main content
POST
Add Patients to Cohort
For more information, see the guide about Cohorts

Path Params

id
string
required
The ID of the cohort to assign patients to.

Body

You must provide either patientIds or allPatients, but not both.
patientIds
string[]
Array of patient IDs to assign to the cohort. Mutually exclusive with the allPatients property.
allPatients
boolean
Property to confirm you want to assign all patients in your metriport instance to the cohort. Mutually exclusive with the patientIds array.

Response

message
string
required
Confirmation message indicating the operation was successful.
cohort
Cohort
required
The cohort details.

Notes

  • When assigning specific patientIds to a treatment cohort, patients with treatmentRelationship: false cannot be added. Use the Treatment Relationship endpoint to update consent before assigning those patients to treatment cohorts.
  • When using allPatients: true on a treatment cohort, patients with treatmentRelationship: false are not added. The request still succeeds for all other patients.