List Messages
curl --request GET \
--url https://api.sandbox.metriport.com/medical/v1/message \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sandbox.metriport.com/medical/v1/message"
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/message', 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/message",
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/message"
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/message")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.metriport.com/medical/v1/message")
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 { meta, messages } = await metriport.listMessages({
direction: "outbound",
patientId: "00000000-0000-0000-0000-000000000000",
});
Message
List Messages
List all inbound and outbound messages.
GET
/
medical
/
v1
/
message
List Messages
curl --request GET \
--url https://api.sandbox.metriport.com/medical/v1/message \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sandbox.metriport.com/medical/v1/message"
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/message', 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/message",
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/message"
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/message")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.metriport.com/medical/v1/message")
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 { meta, messages } = await metriport.listMessages({
direction: "outbound",
patientId: "00000000-0000-0000-0000-000000000000",
});
This endpoint is currently under construction. Please
reach out to support if you'd like to use it.
Note that some inbound messages might not be tied to any
specific patient.
For real-time inbound notifications, use the
message.received
webhook
rather than polling this endpoint.Query Params
string
Filter messages by direction. One of
outbound or
inbound. If not provided, both directions are returned.string
Filter messages to those related to a specific Patient.
string
Filter messages by exact destination.
string
Filter messages by status. One of
processing, completed, or failed.Response
object
required
Pagination metadata. See
pagination.
Message[]
required
Show Message properties
Show Message properties
string
required
The ID of the message.
string
required
The ID of the Patient the message relates to.
string
required
One of
outbound or inbound.string
required
The delivery status. One of
processing, completed, or failed.string
required
How the message is transported. One of
xdr or direct.string
The network used for XDR delivery. One of
EHEX, CAREQUALITY, or
COMMONWELL. Required when transportMethod is xdr.string
required
Where the message is delivered. An OID or a Direct email address.
string
required
The subject of the message.
string
Plain-text content of the message, when present.
string[]
Document IDs attached to the message, when present.
string[]
Intended recipient NPIs, when present.
string
required
ISO 8601 timestamp of when the message was created / accepted for send.
string
required
ISO 8601 timestamp of the latest status update.
string
Failure reason. Only present when
status is failed.{
"meta": {
"nextPage": "https://api.metriport.com/medical/v1/message?fromItem=33333333-3333-3333-3333-333333333333&count=50&direction=outbound",
"itemsOnPage": 2,
"itemsInTotal": 14
},
"messages": [
{
"id": "00000000-0000-0000-0000-000000000000",
"patientId": "11111111-1111-1111-1111-111111111111",
"direction": "outbound",
"status": "completed",
"transportMethod": "xdr",
"network": "EHEX",
"destination": "2.16.840.1.113883.3.666.123.4.101",
"subject": "Referral - cardiology",
"body": "Please review the attached referral for cardiology consultation.",
"attachments": ["00000000-0000-0000-0000-000000000000"],
"intendedRecipientNpi": ["1234567890"],
"sentAt": "2026-06-16T18:40:00.000Z",
"updatedAt": "2026-06-16T18:42:11.000Z"
},
{
"id": "11111111-1111-1111-1111-111111111111",
"patientId": "11111111-1111-1111-1111-111111111111",
"direction": "inbound",
"status": "completed",
"transportMethod": "direct",
"destination": "your-org@direct.example.org",
"subject": "Follow-up notes",
"body": "Please see attached follow-up notes.",
"attachments": ["22222222-2222-2222-2222-222222222222"],
"sentAt": "2026-06-16T19:10:00.000Z",
"updatedAt": "2026-06-16T19:10:00.000Z"
}
]
}
import { MetriportMedicalApi } from "@metriport/api-sdk";
const metriport = new MetriportMedicalApi("YOUR_API_KEY");
const { meta, messages } = await metriport.listMessages({
direction: "outbound",
patientId: "00000000-0000-0000-0000-000000000000",
});
Rate Limits
See limits and throttling⌘I

