curl --request PATCH \
--url https://api.maxcare.ai/v3/patients/{patientId}/insurance-policies/{policyId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Organization-Id: <x-organization-id>' \
--data '
{
"policyType": "MEDICARE"
}
'import requests
url = "https://api.maxcare.ai/v3/patients/{patientId}/insurance-policies/{policyId}"
payload = { "policyType": "MEDICARE" }
headers = {
"X-Organization-Id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-Organization-Id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({policyType: 'MEDICARE'})
};
fetch('https://api.maxcare.ai/v3/patients/{patientId}/insurance-policies/{policyId}', 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/v3/patients/{patientId}/insurance-policies/{policyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'policyType' => 'MEDICARE'
]),
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/v3/patients/{patientId}/insurance-policies/{policyId}"
payload := strings.NewReader("{\n \"policyType\": \"MEDICARE\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.maxcare.ai/v3/patients/{patientId}/insurance-policies/{policyId}")
.header("X-Organization-Id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"policyType\": \"MEDICARE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maxcare.ai/v3/patients/{patientId}/insurance-policies/{policyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"policyType\": \"MEDICARE\"\n}"
response = http.request(request)
puts response.read_body{
"code": "success",
"data": {
"policyId": "pol_3f2c9a1e7b6d4c5e8f9a0b1c2d3e4f5a",
"policyType": "MEDICARE"
}
}{
"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": "not_found",
"message": "Resource not found",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "conflict",
"message": "Cannot edit a signed note",
"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"
}{
"code": "unexpected_integration_error",
"message": "EHR sync failed",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "server_unresponsive",
"message": "EHR integration is not available for this note",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}Change an insurance policy's type
Sets the policy type of a policy already on the chart, and changes nothing else about it. The body is policyType only; any other field is refused with 400. The policy (GET /insurance-policies) must belong to this patient in the patient’s own EHR instance; otherwise 404. EHRs without a policy type answer 400 capability_unsupported (see GET /payers/capabilities, insurance.policyType). The current type is read from the EHR first: when it already matches, nothing is written and the request returns 200, so a retry is always safe. The response is the EHR’s own read-back after the change. 409 policy_update_refused means the EHR did not take the change: it refused the save (for example, ModMed locks a policy that has claims), or still shows the previous type after it. Retrying will not help; check the policy in the EHR. 404 insurance_not_found means the EHR has no active policy with this id on the chart (archived policies cannot be changed here). GET /insurance-policies shows the new type after the next EHR sync; this response is the EHR’s own copy. A policy just added with POST /patients/{id}/insurance:exact is not listed there, and so cannot be changed here, until that sync.
curl --request PATCH \
--url https://api.maxcare.ai/v3/patients/{patientId}/insurance-policies/{policyId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Organization-Id: <x-organization-id>' \
--data '
{
"policyType": "MEDICARE"
}
'import requests
url = "https://api.maxcare.ai/v3/patients/{patientId}/insurance-policies/{policyId}"
payload = { "policyType": "MEDICARE" }
headers = {
"X-Organization-Id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-Organization-Id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({policyType: 'MEDICARE'})
};
fetch('https://api.maxcare.ai/v3/patients/{patientId}/insurance-policies/{policyId}', 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/v3/patients/{patientId}/insurance-policies/{policyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'policyType' => 'MEDICARE'
]),
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/v3/patients/{patientId}/insurance-policies/{policyId}"
payload := strings.NewReader("{\n \"policyType\": \"MEDICARE\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.maxcare.ai/v3/patients/{patientId}/insurance-policies/{policyId}")
.header("X-Organization-Id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"policyType\": \"MEDICARE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maxcare.ai/v3/patients/{patientId}/insurance-policies/{policyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"policyType\": \"MEDICARE\"\n}"
response = http.request(request)
puts response.read_body{
"code": "success",
"data": {
"policyId": "pol_3f2c9a1e7b6d4c5e8f9a0b1c2d3e4f5a",
"policyType": "MEDICARE"
}
}{
"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": "not_found",
"message": "Resource not found",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "conflict",
"message": "Cannot edit a signed note",
"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"
}{
"code": "unexpected_integration_error",
"message": "EHR sync failed",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "server_unresponsive",
"message": "EHR integration is not available for this note",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}Authorizations
Marketplace API key
Headers
Target clinic organization ID
Path Parameters
Patient ID
Insurance policy ID from GET /insurance-policies
Body
The policy type to set, using ModMed's own names. The only field this route accepts; any other field is refused with 400.
MEDICARE, MEDICARE_ADVANTAGE, MEDICAID, CHIP, TRICARE, CHAMPVA, GOVERNMENT_OTHER, COMMERCIAL_OTHER, HMO, PPO, EPO, POS, GHP, IPA, ACA_EXCHANGE "MEDICARE"
