Update Patient
curl --request PUT \
--url https://api.sandbox.metriport.com/medical/v1/patient/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"firstName": "<string>",
"lastName": "<string>",
"dob": "<string>",
"genderAtBirth": "<string>",
"personalIdentifiers": [
{
"type": "<string>",
"state": "<string>",
"value": "<string>"
}
],
"address": [
{
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
}
],
"contact": [
{
"phone": "<string>",
"email": "<string>"
}
],
"externalId": "<string>",
"status": {
"hieOptOut": true,
"treatmentRelationship": true
},
"cohorts": [
"<string>"
]
}
'import requests
url = "https://api.sandbox.metriport.com/medical/v1/patient/{id}"
payload = {
"firstName": "<string>",
"lastName": "<string>",
"dob": "<string>",
"genderAtBirth": "<string>",
"personalIdentifiers": [
{
"type": "<string>",
"state": "<string>",
"value": "<string>"
}
],
"address": [
{
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
}
],
"contact": [
{
"phone": "<string>",
"email": "<string>"
}
],
"externalId": "<string>",
"status": {
"hieOptOut": True,
"treatmentRelationship": True
},
"cohorts": ["<string>"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: '<string>',
lastName: '<string>',
dob: '<string>',
genderAtBirth: '<string>',
personalIdentifiers: [{type: '<string>', state: '<string>', value: '<string>'}],
address: [
{
addressLine1: '<string>',
addressLine2: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>'
}
],
contact: [{phone: '<string>', email: '<string>'}],
externalId: '<string>',
status: {hieOptOut: true, treatmentRelationship: true},
cohorts: ['<string>']
})
};
fetch('https://api.sandbox.metriport.com/medical/v1/patient/{id}', 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/patient/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'firstName' => '<string>',
'lastName' => '<string>',
'dob' => '<string>',
'genderAtBirth' => '<string>',
'personalIdentifiers' => [
[
'type' => '<string>',
'state' => '<string>',
'value' => '<string>'
]
],
'address' => [
[
'addressLine1' => '<string>',
'addressLine2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>'
]
],
'contact' => [
[
'phone' => '<string>',
'email' => '<string>'
]
],
'externalId' => '<string>',
'status' => [
'hieOptOut' => true,
'treatmentRelationship' => true
],
'cohorts' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.metriport.com/medical/v1/patient/{id}"
payload := strings.NewReader("{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"dob\": \"<string>\",\n \"genderAtBirth\": \"<string>\",\n \"personalIdentifiers\": [\n {\n \"type\": \"<string>\",\n \"state\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"address\": [\n {\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n }\n ],\n \"contact\": [\n {\n \"phone\": \"<string>\",\n \"email\": \"<string>\"\n }\n ],\n \"externalId\": \"<string>\",\n \"status\": {\n \"hieOptOut\": true,\n \"treatmentRelationship\": true\n },\n \"cohorts\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.sandbox.metriport.com/medical/v1/patient/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"dob\": \"<string>\",\n \"genderAtBirth\": \"<string>\",\n \"personalIdentifiers\": [\n {\n \"type\": \"<string>\",\n \"state\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"address\": [\n {\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n }\n ],\n \"contact\": [\n {\n \"phone\": \"<string>\",\n \"email\": \"<string>\"\n }\n ],\n \"externalId\": \"<string>\",\n \"status\": {\n \"hieOptOut\": true,\n \"treatmentRelationship\": true\n },\n \"cohorts\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.metriport.com/medical/v1/patient/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"dob\": \"<string>\",\n \"genderAtBirth\": \"<string>\",\n \"personalIdentifiers\": [\n {\n \"type\": \"<string>\",\n \"state\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"address\": [\n {\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n }\n ],\n \"contact\": [\n {\n \"phone\": \"<string>\",\n \"email\": \"<string>\"\n }\n ],\n \"externalId\": \"<string>\",\n \"status\": {\n \"hieOptOut\": true,\n \"treatmentRelationship\": true\n },\n \"cohorts\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyimport { MetriportMedicalApi, USState } from "@metriport/api-sdk";
const metriport = new MetriportMedicalApi("YOUR_API_KEY");
const facilityId = "018a80c4-292a-7486-a1234-9uiu76yhe234";
const patient = await metriport.updatePatient(
{
id: "018a80c4-292a-7486-a1234-76yuhe23yu14",
firstName: "Jose",
lastName: "Juarez",
dob: "1951-05-05",
genderAtBirth: "M",
personalIdentifiers: [
{
type: "driversLicense",
state: USState.CA,
value: "51227265",
},
],
address: [
{
zip: "12345",
city: "San Diego",
state: USState.CA,
country: "USA",
addressLine1: "Guadalajara Street"
},
],
contact: [
{
phone: "1234567899",
email: "jose@domain.com",
},
],
externalId: "123456789",
status: {
hieOptOut: false,
treatmentRelationship: true
}
},
facilityId
);
Patient
Update Patient
Updates the specified Patient.
PUT
/
medical
/
v1
/
patient
/
{id}
Update Patient
curl --request PUT \
--url https://api.sandbox.metriport.com/medical/v1/patient/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"firstName": "<string>",
"lastName": "<string>",
"dob": "<string>",
"genderAtBirth": "<string>",
"personalIdentifiers": [
{
"type": "<string>",
"state": "<string>",
"value": "<string>"
}
],
"address": [
{
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
}
],
"contact": [
{
"phone": "<string>",
"email": "<string>"
}
],
"externalId": "<string>",
"status": {
"hieOptOut": true,
"treatmentRelationship": true
},
"cohorts": [
"<string>"
]
}
'import requests
url = "https://api.sandbox.metriport.com/medical/v1/patient/{id}"
payload = {
"firstName": "<string>",
"lastName": "<string>",
"dob": "<string>",
"genderAtBirth": "<string>",
"personalIdentifiers": [
{
"type": "<string>",
"state": "<string>",
"value": "<string>"
}
],
"address": [
{
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>"
}
],
"contact": [
{
"phone": "<string>",
"email": "<string>"
}
],
"externalId": "<string>",
"status": {
"hieOptOut": True,
"treatmentRelationship": True
},
"cohorts": ["<string>"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: '<string>',
lastName: '<string>',
dob: '<string>',
genderAtBirth: '<string>',
personalIdentifiers: [{type: '<string>', state: '<string>', value: '<string>'}],
address: [
{
addressLine1: '<string>',
addressLine2: '<string>',
city: '<string>',
state: '<string>',
zip: '<string>',
country: '<string>'
}
],
contact: [{phone: '<string>', email: '<string>'}],
externalId: '<string>',
status: {hieOptOut: true, treatmentRelationship: true},
cohorts: ['<string>']
})
};
fetch('https://api.sandbox.metriport.com/medical/v1/patient/{id}', 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/patient/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'firstName' => '<string>',
'lastName' => '<string>',
'dob' => '<string>',
'genderAtBirth' => '<string>',
'personalIdentifiers' => [
[
'type' => '<string>',
'state' => '<string>',
'value' => '<string>'
]
],
'address' => [
[
'addressLine1' => '<string>',
'addressLine2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'zip' => '<string>',
'country' => '<string>'
]
],
'contact' => [
[
'phone' => '<string>',
'email' => '<string>'
]
],
'externalId' => '<string>',
'status' => [
'hieOptOut' => true,
'treatmentRelationship' => true
],
'cohorts' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.metriport.com/medical/v1/patient/{id}"
payload := strings.NewReader("{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"dob\": \"<string>\",\n \"genderAtBirth\": \"<string>\",\n \"personalIdentifiers\": [\n {\n \"type\": \"<string>\",\n \"state\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"address\": [\n {\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n }\n ],\n \"contact\": [\n {\n \"phone\": \"<string>\",\n \"email\": \"<string>\"\n }\n ],\n \"externalId\": \"<string>\",\n \"status\": {\n \"hieOptOut\": true,\n \"treatmentRelationship\": true\n },\n \"cohorts\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.sandbox.metriport.com/medical/v1/patient/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"dob\": \"<string>\",\n \"genderAtBirth\": \"<string>\",\n \"personalIdentifiers\": [\n {\n \"type\": \"<string>\",\n \"state\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"address\": [\n {\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n }\n ],\n \"contact\": [\n {\n \"phone\": \"<string>\",\n \"email\": \"<string>\"\n }\n ],\n \"externalId\": \"<string>\",\n \"status\": {\n \"hieOptOut\": true,\n \"treatmentRelationship\": true\n },\n \"cohorts\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.metriport.com/medical/v1/patient/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"dob\": \"<string>\",\n \"genderAtBirth\": \"<string>\",\n \"personalIdentifiers\": [\n {\n \"type\": \"<string>\",\n \"state\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"address\": [\n {\n \"addressLine1\": \"<string>\",\n \"addressLine2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"zip\": \"<string>\",\n \"country\": \"<string>\"\n }\n ],\n \"contact\": [\n {\n \"phone\": \"<string>\",\n \"email\": \"<string>\"\n }\n ],\n \"externalId\": \"<string>\",\n \"status\": {\n \"hieOptOut\": true,\n \"treatmentRelationship\": true\n },\n \"cohorts\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyimport { MetriportMedicalApi, USState } from "@metriport/api-sdk";
const metriport = new MetriportMedicalApi("YOUR_API_KEY");
const facilityId = "018a80c4-292a-7486-a1234-9uiu76yhe234";
const patient = await metriport.updatePatient(
{
id: "018a80c4-292a-7486-a1234-76yuhe23yu14",
firstName: "Jose",
lastName: "Juarez",
dob: "1951-05-05",
genderAtBirth: "M",
personalIdentifiers: [
{
type: "driversLicense",
state: USState.CA,
value: "51227265",
},
],
address: [
{
zip: "12345",
city: "San Diego",
state: USState.CA,
country: "USA",
addressLine1: "Guadalajara Street"
},
],
contact: [
{
phone: "1234567899",
email: "jose@domain.com",
},
],
externalId: "123456789",
status: {
hieOptOut: false,
treatmentRelationship: true
}
},
facilityId
);
Query Params
The ID of the Facility where the patient is receiving care.
Path Params
The ID of the Patient to update.
Body
The more demographic information you can provide about a Patient, the higher chances Metriport will be
able to find a match. For example: nicknames, old addresses, multiple phone numbers, a pre-marital
last name, etc.
You may provide a comma/space delimited string to specify
multiple first and last names. For example, the following
inputs would be equivalent:
"John,Jonathan" & "John Jonathan" - these would translate to ["John", "Jonathan"].The Patient's first name(s).
The Patient's last name(s).
The Patient's gender at birth, can be one of
M or F or
O or U. Use O (other) when the patient's gender is
known but it is not M or F, i.e intersex or
hermaphroditic. Use U (unknown) when the patient's gender
is not known.An array of the Patient's personal IDs, such as a driver's license or SSN. May be empty.
Show PersonalIdentifier properties
Show PersonalIdentifier properties
An array of
Address objects, representing the Patient's current and/or previous addresses.Show Address properties
Show Address properties
The address.
The address details, for example:
#4451.The city.
The 2 letter state acronym, for example:
CA.5 digit zip code.
If specified, must be "USA"; otherwise will default to "USA".
The first address in the array determines the primary address for the patient.
The primary address is used for patient monitoring, specifically for ADT events.
You can change which address is the primary address by simply re-ordering the address array using the PUT patient endpoint.
Learn more about patient monitoring
and cohorts.
An array of
Contact objects, representing the Patient's current and/or previous contact information. May be empty.Show Contact properties
Show Contact properties
The Patient's 10 digit phone number, formatted
1234567899.The Patient's email address. Supports a wide range of valid email formats including special characters.Valid email examples:
user@example.comtest!user@example.comuser+tag@example.comuser_name@example.comuser-name@example.comuser.name@example.com
invalid-email(missing @ and domain)user@(missing domain)@example.com(missing local part)+1234567890@example.com(phone number format)mailto:user@example.com(mailto: prefix not allowed)
An external Patient ID to associate to a Patient in Metriport.
If
externalId is provided, it will be returned in webhook payloads and responses
involving the Patient.Patient status flags for HIE opt-out and treatment relationship consent.
Show status properties
Show status properties
Patients with consent (
false) cannot be assigned to treatment cohorts. Setting this to
false automatically removes the patient from treatment cohorts. See the
Treatment Relationship API reference
to update consent programmatically.The list of cohort IDs this patient should be assigned to.
See Working With Cohorts to learn more about how to use this field.
Response
The ID assigned to this Patient. This ID will be used to uniquely identify this Patient in medical
documents.
The ID of the Patient on your internal system to associate to a Patient in Metriport.
A map containing additional external identifiers. If the patient is created or mapped in Metriport through one of
our EHR apps - this property will be populated with the ID from the EHR, and included
within the webhook payloads.
Show AdditionalIdentifiers properties
Show AdditionalIdentifiers properties
Athena patient ID. If more than one patient in Athena maps to a Metriport patient, they
will all be included.
Canvas patient ID. If more than one patient in Canvas maps to a Metriport patient, they
will all be included.
Elation Patient ID. If more than one patient in Elation maps to a Metriport patient, they
will all be included.
The Patient's first name(s).
The Patient's last name(s).
The Patient's date of birth (DOB), formatted
YYYY-MM-DD as per ISO 8601.The Patient's gender at birth, can be one of
M or F or O or U. Use O (other) when the patient's gender is known but it is not M or F, i.e intersex or hermaphroditic.
Use U (unknown) when the patient's gender is not known.An array of the Patient's personal IDs, such as a driver's license. May be empty.
Array of the IDs of the Facilities where the Patient is receiving care.
import { MetriportMedicalApi, USState } from "@metriport/api-sdk";
const metriport = new MetriportMedicalApi("YOUR_API_KEY");
const facilityId = "018a80c4-292a-7486-a1234-9uiu76yhe234";
const patient = await metriport.updatePatient(
{
id: "018a80c4-292a-7486-a1234-76yuhe23yu14",
firstName: "Jose",
lastName: "Juarez",
dob: "1951-05-05",
genderAtBirth: "M",
personalIdentifiers: [
{
type: "driversLicense",
state: USState.CA,
value: "51227265",
},
],
address: [
{
zip: "12345",
city: "San Diego",
state: USState.CA,
country: "USA",
addressLine1: "Guadalajara Street"
},
],
contact: [
{
phone: "1234567899",
email: "jose@domain.com",
},
],
externalId: "123456789",
status: {
hieOptOut: false,
treatmentRelationship: true
}
},
facilityId
);
{
"id": "018a80c4-292a-7486-a1234-76yuhe23yu14",
"externalId": "1234567890",
"status": {
"hieOptOut": false,
"treatmentRelationship": true
},
"additionalIds": {
"athenahealth": ["43210"],
"canvas": ["1234567890"],
"elation": ["0987654321"]
},
"facilityIds": ["018a80c4-292a-7486-a1234-9uiu76yhe234"],
"firstName": "Jose",
"lastName": "Juarez",
"dob": "1951-05-05",
"genderAtBirth": "M",
"personalIdentifiers": [
{
"type": "driversLicense",
"state": "CA",
"value": "51227265"
}
],
"address": [
{
"zip": "12345",
"city": "San Diego",
"state": "CA",
"country": "USA",
"addressLine1": "Guadalajara St"
}
],
"contact": [
{
"phone": "1234567899",
"email": "jose@domain.com"
}
],
}
Rate Limits
See limits and throttling⌘I

