List Patients in Cohort
curl --request GET \
--url https://api.sandbox.metriport.com/medical/v1/cohort/{id}/patient \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sandbox.metriport.com/medical/v1/cohort/{id}/patient"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sandbox.metriport.com/medical/v1/cohort/{id}/patient', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.metriport.com/medical/v1/cohort/{id}/patient",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.metriport.com/medical/v1/cohort/{id}/patient"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.metriport.com/medical/v1/cohort/{id}/patient")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.metriport.com/medical/v1/cohort/{id}/patient")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyimport { MetriportMedicalApi } from "@metriport/api-sdk";
const metriport = new MetriportMedicalApi("YOUR_API_KEY");
const cohortId = "00000000-0000-0000-0000-000000000000";
const cohortPatients = await metriport.listPatientsInCohort(
cohortId
);
Cohort
List Patients in Cohort
Returns a paginated list of all patients that are members of the specified cohort.
GET
/
medical
/
v1
/
cohort
/
{id}
/
patient
List Patients in Cohort
curl --request GET \
--url https://api.sandbox.metriport.com/medical/v1/cohort/{id}/patient \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sandbox.metriport.com/medical/v1/cohort/{id}/patient"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sandbox.metriport.com/medical/v1/cohort/{id}/patient', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.metriport.com/medical/v1/cohort/{id}/patient",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.metriport.com/medical/v1/cohort/{id}/patient"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.metriport.com/medical/v1/cohort/{id}/patient")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.metriport.com/medical/v1/cohort/{id}/patient")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyimport { MetriportMedicalApi } from "@metriport/api-sdk";
const metriport = new MetriportMedicalApi("YOUR_API_KEY");
const cohortId = "00000000-0000-0000-0000-000000000000";
const cohortPatients = await metriport.listPatientsInCohort(
cohortId
);
For more information, see the guide about Cohorts
Path Params
The ID of the cohort whose patients are to be returned.
Query Params
Optional pagination parameter to start from a specific
item.
Optional pagination parameter to end at a specific item.
Optional number of items per page (max 100).
Optional sort parameter (e.g., “id=asc,createdAt=desc”).
Response
Array of patients that are members of the cohort.
Show Patient properties
Show Patient properties
Pagination metadata for the response.
Show Pagination properties
Show Pagination properties
The number of items on the current page.
The total number of items across all pages (only
available on the first page).
URL to get the next page (only present if there is a
next page).
URL to get the previous page (only present if there is
a previous page).
import { MetriportMedicalApi } from "@metriport/api-sdk";
const metriport = new MetriportMedicalApi("YOUR_API_KEY");
const cohortId = "00000000-0000-0000-0000-000000000000";
const cohortPatients = await metriport.listPatientsInCohort(
cohortId
);
{
"patients": [
{
"id": "11111111-1111-1111-1111-111111111111",
"eTag": "1",
"firstName": "John",
"lastName": "Doe",
"dob": "1990-01-01",
"genderAtBirth": "M",
"address": [
{
"addressLine1": "123 Fake Street",
"city": "Fake City",
"state": "NY",
"zip": "12345",
"country": "USA"
}
],
"personalIdentifiers": [
{
"type": "drivers_license",
"value": "FAKE123456789",
"state": "NY"
}
],
"facilityIds": [
"22222222-2222-2222-2222-222222222222"
]
},
{
"id": "33333333-3333-3333-3333-333333333333",
"eTag": "1",
"firstName": "Jane",
"lastName": "Smith",
"dob": "1985-05-15",
"genderAtBirth": "F",
"address": [
{
"addressLine1": "456 Example Avenue",
"city": "Sample Town",
"state": "CA",
"zip": "54321",
"country": "USA"
}
],
"personalIdentifiers": [
{
"type": "drivers_license",
"value": "FAKE987654321",
"state": "CA"
}
],
"facilityIds": [
"44444444-4444-4444-4444-444444444444"
]
}
],
"meta": {
"itemsOnPage": 2,
"itemsInTotal": 2
}
}
⌘I

