curl --request POST \
--url https://api.maxcare.ai/v1/patients/match \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Organization-Id: <x-organization-id>' \
--data '
{
"matchOn": [
"lastName",
"dateOfBirth"
],
"firstName": "Jane",
"lastName": "Doe",
"dateOfBirth": "1984-02-11",
"phone": "+13135550123",
"email": "jane@example.com",
"postalCode": "48507",
"threshold": 0.75,
"limit": 5,
"instanceIds": [
"3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c"
]
}
'import requests
url = "https://api.maxcare.ai/v1/patients/match"
payload = {
"matchOn": ["lastName", "dateOfBirth"],
"firstName": "Jane",
"lastName": "Doe",
"dateOfBirth": "1984-02-11",
"phone": "+13135550123",
"email": "jane@example.com",
"postalCode": "48507",
"threshold": 0.75,
"limit": 5,
"instanceIds": ["3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c"]
}
headers = {
"X-Organization-Id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Organization-Id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
matchOn: ['lastName', 'dateOfBirth'],
firstName: 'Jane',
lastName: 'Doe',
dateOfBirth: '1984-02-11',
phone: '+13135550123',
email: 'jane@example.com',
postalCode: '48507',
threshold: 0.75,
limit: 5,
instanceIds: ['3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c']
})
};
fetch('https://api.maxcare.ai/v1/patients/match', 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.maxcare.ai/v1/patients/match",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'matchOn' => [
'lastName',
'dateOfBirth'
],
'firstName' => 'Jane',
'lastName' => 'Doe',
'dateOfBirth' => '1984-02-11',
'phone' => '+13135550123',
'email' => 'jane@example.com',
'postalCode' => '48507',
'threshold' => 0.75,
'limit' => 5,
'instanceIds' => [
'3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Organization-Id: <x-organization-id>"
],
]);
$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.maxcare.ai/v1/patients/match"
payload := strings.NewReader("{\n \"matchOn\": [\n \"lastName\",\n \"dateOfBirth\"\n ],\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"1984-02-11\",\n \"phone\": \"+13135550123\",\n \"email\": \"jane@example.com\",\n \"postalCode\": \"48507\",\n \"threshold\": 0.75,\n \"limit\": 5,\n \"instanceIds\": [\n \"3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Organization-Id", "<x-organization-id>")
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.maxcare.ai/v1/patients/match")
.header("X-Organization-Id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"matchOn\": [\n \"lastName\",\n \"dateOfBirth\"\n ],\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"1984-02-11\",\n \"phone\": \"+13135550123\",\n \"email\": \"jane@example.com\",\n \"postalCode\": \"48507\",\n \"threshold\": 0.75,\n \"limit\": 5,\n \"instanceIds\": [\n \"3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maxcare.ai/v1/patients/match")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"matchOn\": [\n \"lastName\",\n \"dateOfBirth\"\n ],\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"1984-02-11\",\n \"phone\": \"+13135550123\",\n \"email\": \"jane@example.com\",\n \"postalCode\": \"48507\",\n \"threshold\": 0.75,\n \"limit\": 5,\n \"instanceIds\": [\n \"3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": "success",
"data": {
"candidates": [
{
"patientId": "pat_c56103bcd39c46d39f3138dd2b5e05f6",
"mrn": "MM0000123456",
"score": 0.97,
"matchedFields": [
"lastName",
"dateOfBirth",
"phone"
],
"unverifiedFields": [
"dateOfBirth"
],
"conflictingFields": [
"postalCode"
],
"instanceId": "3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c",
"ehrType": "modmed"
}
],
"truncated": false
}
}{
"code": "bad_request",
"message": "'id' must be a valid UUID",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "unauthorized",
"message": "Invalid or missing API key",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "forbidden",
"message": "Insufficient scope",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Maximum 1000 requests per 60 seconds.",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}Match a patient by demographics
Scores existing charts against submitted demographics and returns ranked candidates. Use this before creating a chart: GET /patients?search= matches name or MRN only, so matching from a booking form otherwise means paging every candidate surname — which either exhausts the rate budget or truncates, and a truncated match creates a duplicate chart. Candidates are found by dateOfBirth, phone (at least 7 digits) or email — at least one is required, otherwise 400. Names and postal code are scored but never used alone to find candidates. Send matchOn (e.g. ["lastName", "dateOfBirth"]) to require those fields to agree instead of matching any one identifier. truncated: true means the candidate set was capped and MUST NOT be read as ‘no match’.
curl --request POST \
--url https://api.maxcare.ai/v1/patients/match \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Organization-Id: <x-organization-id>' \
--data '
{
"matchOn": [
"lastName",
"dateOfBirth"
],
"firstName": "Jane",
"lastName": "Doe",
"dateOfBirth": "1984-02-11",
"phone": "+13135550123",
"email": "jane@example.com",
"postalCode": "48507",
"threshold": 0.75,
"limit": 5,
"instanceIds": [
"3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c"
]
}
'import requests
url = "https://api.maxcare.ai/v1/patients/match"
payload = {
"matchOn": ["lastName", "dateOfBirth"],
"firstName": "Jane",
"lastName": "Doe",
"dateOfBirth": "1984-02-11",
"phone": "+13135550123",
"email": "jane@example.com",
"postalCode": "48507",
"threshold": 0.75,
"limit": 5,
"instanceIds": ["3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c"]
}
headers = {
"X-Organization-Id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Organization-Id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
matchOn: ['lastName', 'dateOfBirth'],
firstName: 'Jane',
lastName: 'Doe',
dateOfBirth: '1984-02-11',
phone: '+13135550123',
email: 'jane@example.com',
postalCode: '48507',
threshold: 0.75,
limit: 5,
instanceIds: ['3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c']
})
};
fetch('https://api.maxcare.ai/v1/patients/match', 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.maxcare.ai/v1/patients/match",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'matchOn' => [
'lastName',
'dateOfBirth'
],
'firstName' => 'Jane',
'lastName' => 'Doe',
'dateOfBirth' => '1984-02-11',
'phone' => '+13135550123',
'email' => 'jane@example.com',
'postalCode' => '48507',
'threshold' => 0.75,
'limit' => 5,
'instanceIds' => [
'3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Organization-Id: <x-organization-id>"
],
]);
$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.maxcare.ai/v1/patients/match"
payload := strings.NewReader("{\n \"matchOn\": [\n \"lastName\",\n \"dateOfBirth\"\n ],\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"1984-02-11\",\n \"phone\": \"+13135550123\",\n \"email\": \"jane@example.com\",\n \"postalCode\": \"48507\",\n \"threshold\": 0.75,\n \"limit\": 5,\n \"instanceIds\": [\n \"3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Organization-Id", "<x-organization-id>")
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://api.maxcare.ai/v1/patients/match")
.header("X-Organization-Id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"matchOn\": [\n \"lastName\",\n \"dateOfBirth\"\n ],\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"1984-02-11\",\n \"phone\": \"+13135550123\",\n \"email\": \"jane@example.com\",\n \"postalCode\": \"48507\",\n \"threshold\": 0.75,\n \"limit\": 5,\n \"instanceIds\": [\n \"3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maxcare.ai/v1/patients/match")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"matchOn\": [\n \"lastName\",\n \"dateOfBirth\"\n ],\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"1984-02-11\",\n \"phone\": \"+13135550123\",\n \"email\": \"jane@example.com\",\n \"postalCode\": \"48507\",\n \"threshold\": 0.75,\n \"limit\": 5,\n \"instanceIds\": [\n \"3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": "success",
"data": {
"candidates": [
{
"patientId": "pat_c56103bcd39c46d39f3138dd2b5e05f6",
"mrn": "MM0000123456",
"score": 0.97,
"matchedFields": [
"lastName",
"dateOfBirth",
"phone"
],
"unverifiedFields": [
"dateOfBirth"
],
"conflictingFields": [
"postalCode"
],
"instanceId": "3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c",
"ehrType": "modmed"
}
],
"truncated": false
}
}{
"code": "bad_request",
"message": "'id' must be a valid UUID",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "unauthorized",
"message": "Invalid or missing API key",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "forbidden",
"message": "Insufficient scope",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Maximum 1000 requests per 60 seconds.",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}Authorizations
Marketplace API key
Headers
Target clinic organization ID
Body
Fields the candidate query requires to agree (AND), e.g. ["lastName", "dateOfBirth"]. Names and email compare trimmed and case-insensitively, phone on its last 10 digits. A chart with no stored value for a listed field is not a candidate. Every listed field must be present in the body (phone with at least 7 digits), and the list must include at least one of dateOfBirth, phone or email; otherwise 400. Fields sent but not listed are scored only. Omitted: candidates are any chart matching dateOfBirth, phone or email (OR).
lastName, firstName, dateOfBirth, phone, email ["lastName", "dateOfBirth"]
Scored; finds candidates only when listed in matchOn.
"Jane"
Scored; finds candidates only when listed in matchOn, alongside dateOfBirth, phone or email.
"Doe"
YYYY-MM-DD. At least one of dateOfBirth, phone (7+ digits) or email is required, otherwise 400.
"1984-02-11"
Compared on digits only (last 10); must have at least 7 digits to find candidates.
"+13135550123"
Trimmed, case-insensitive exact match.
"jane@example.com"
Scored only; never used to find candidates.
"48507"
Minimum score to return (0–1). Defaults to 0.75.
0.75
Maximum candidates to return (1–25). Defaults to 5.
5
EHR instances to search, as raw UUIDs (ins_… also accepted on v3+). Only charts in these instances are candidates, and the filter is applied before threshold, limit and truncated, so a chart in another instance — such as the legacy twin of a migrated patient — never takes a slot. Ids that are not your organization's match nothing. null, an empty list, or more than 100 ids is a 400. Omitted: every instance in the organization is searched.
100["3a7b9c1d-2e4f-45a6-8b0c-1d2e3f4a5b6c"]
