List Documents
curl --request GET \
--url https://api.sandbox.metriport.com/medical/v1/document \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sandbox.metriport.com/medical/v1/document"
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/document', 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/document",
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/document"
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/document")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.metriport.com/medical/v1/document")
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 { documents } = await metriport.listDocuments(
"018a80c4-292a-7486-a1234-76yuhe23yu14",
{
dateFrom: "2023-08-01",
dateTo: "2023-08-31",
content: "john",
count: 50,
}
);
Document
List Documents
Lists all Documents that can be retrieved for a Patient.
GET
/
medical
/
v1
/
document
List Documents
curl --request GET \
--url https://api.sandbox.metriport.com/medical/v1/document \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sandbox.metriport.com/medical/v1/document"
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/document', 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/document",
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/document"
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/document")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.metriport.com/medical/v1/document")
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 { documents } = await metriport.listDocuments(
"018a80c4-292a-7486-a1234-76yuhe23yu14",
{
dateFrom: "2023-08-01",
dateTo: "2023-08-31",
content: "john",
count: 50,
}
);
This endpoint returns the document references available at Metriport which are associated with the
given Patient and match the provided filters, if any.
To start a new Network Query, see the Start Network Query endpoint.
Query Params
The ID of the Patient for which to list available
Documents.
The start date (inclusive) for which to filter document
references - formatted
YYYY-MM-DD as per ISO 8601. If
not provided, no start date filter will be applied.The end date (inclusive) for which to filter document
references - formatted
YYYY-MM-DD as per ISO 8601. If
not provided, no end date filter will be applied.The maximum number of
DocumentReferences to return after
search filters are applied. If not provided, no limit is
applied.Value to search within the document reference and the actual contents of the document (minimum 3 chars). For more details see the “search syntax” section
below.
Show Search syntax
Show Search syntax
- search terms are separated by spaces;
- star (
*) allows to search using “contains” (pat*will return docs withpatientandpaternity); - double quotes (
") group words into a single term (to add double quotes as part of the content, escape them with \ like so: ” ); - by default, terms are optional and combined with
OR. A document matches if it contains any of them (diabetes hypertensionmatches docs with either term); - the plus sign (
+) is anANDthat joins the term with everything to its left (a b +cmeans(a OR b) AND c). A leading+has nothing to its left, so it has no effect (+foxis the same asfox); - the minus sign (
-) negates a term. On its own it keeps the defaultOR, sofox -brownmeansfox OR (NOT brown) - to require the absence of a term, make the negation part of an
ANDby combining both signs (+-):+diabetes +-bloodmeansdiabetes AND (NOT blood); - to require all terms (pure
AND), prefix every term with+:+diabetes +hypertension.
+diabetes +hypertension +-blooddiabetesmust be presenthypertensionmust be presentbloodmust not be present
Response
An array of the DocumentReference available for the Patient matching the provided filters, if any.See FHIR
DocumentReference.
{
"documents": [
{
"resourceType": "DocumentReference",
"id": "018a875a-3181-74e8-8aa4-40c59ed7e1b2",
"meta": {
"lastUpdated": "2025-04-17T18:09:29.947Z",
"source": "01964571-db3c-7953-9987-fe7b62cc278c/01964571-db3c-7953-9987-fe7cb3d109e4/01964571-db3c-7953-9987-fe7b62cc278c_01964571-db3c-7953-9987-fe7cb3d109e4_018a875a-3181-74e8-8aa4-40c59ed7e1b2.xml"
},
"contained": [
{
"resourceType": "Organization",
"id": "org522",
"name": "Hospital 522"
},
{
"resourceType": "Practitioner",
"id": "auth925",
"name": [
{
"text": "John Snow",
"family": "Snow",
"given": ["John"]
}
]
}
],
"extension": [
{
"url": "https://public.metriport.com/fhir/StructureDefinition/data-source.json",
"valueCoding": {
"system": "https://public.metriport.com/fhir/StructureDefinition/data-source.json",
"code": "METRIPORT"
}
}
],
"masterIdentifier": {
"system": "urn:ietf:rfc:3986",
"value": "018a875a-3181-74e8-8aa4-40c59ed7e1b2"
},
"identifier": [
{
"use": "official",
"system": "urn:ietf:rfc:3986",
"value": "018a875a-3181-74e8-8aa4-40c59ed7e1b2"
}
],
"status": "current",
"type": {
"coding": [
{
"system": "http://loinc.org/",
"code": "34133-9",
"display": "Summarization of episode note"
}
]
},
"subject": {
"reference": "Patient/018a5164-c0ac-79e2-99cc-9cf951c26d94",
"type": "Patient"
},
"date": "2023-08-15T03:05:58.090Z",
"author": [
{
"reference": "#org522",
"type": "Organization"
}
],
"description": "C-CDA R2.1 Patient Record",
"content": [
{
"extension": [
{
"url": "https://public.metriport.com/fhir/StructureDefinition/data-source.json",
"valueCoding": {
"system": "https://public.metriport.com/fhir/StructureDefinition/data-source.json",
"code": "METRIPORT"
}
}
],
"attachment": {
"contentType": "application/pdf",
"url": "http://api.metriport.com/doc-contribution/commonwell/?fileName=965f9957-34ac-442b-9a17-fa09c76c16da/018a5164-c0ac-79e2-99cc-9cf951c26d94/965f9957-34ac-442b-9a17-fa09c76c16da_018a5164-c0ac-79e2-99cc-9cf951c26d94_018a875a-3181-74e8-8aa4-40c59ed7e1b2",
"size": 1080416,
"title": "965f9957-34ac-442b-9a17-fa09c76c16da/018a5164-c0ac-79e2-99cc-9cf951c26d94/965f9957-34ac-442b-9a17-fa09c76c16da_018a5164-c0ac-79e2-99cc-9cf951c26d94_018a875a-3181-74e8-8aa4-40c59ed7e1b2",
"creation": "2023-08-14T22:05:58-05:00"
},
"format": {
"code": "urn:ihe:pcc:xphr:2007"
}
}
],
"context": {
"period": {
"start": "2023-08-15T02:05:58.090Z",
"end": "2023-08-15T03:05:58.090Z"
},
"sourcePatientInfo": {
"reference": "Patient/018a5164-c0ac-79e2-99cc-9cf951c26d94",
"type": "Patient"
}
}
}
]
}
import { MetriportMedicalApi } from "@metriport/api-sdk";
const metriport = new MetriportMedicalApi("YOUR_API_KEY");
const { documents } = await metriport.listDocuments(
"018a80c4-292a-7486-a1234-76yuhe23yu14",
{
dateFrom: "2023-08-01",
dateTo: "2023-08-31",
content: "john",
count: 50,
}
);
⌘I

