Batch create/update patients
curl --request POST \
--url https://api.example.com/v1/patients/batch \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"items": [
{
"first_name": null,
"last_name": null,
"middle_name": null,
"phone_number": null,
"additional_phone_number": null,
"email": null,
"date_of_birth": null,
"gender": null,
"address": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"comments": null,
"workflow_stage_id": null,
"assigned_user_id": null,
"location_id": null,
"organization_id": null,
"tags": null,
"referral": null,
"custom_fields": null,
"created_from": null,
"external_id_type": null,
"external_id": null,
"payors": "<unknown>"
}
]
}
'import requests
url = "https://api.example.com/v1/patients/batch"
payload = { "items": [
{
"first_name": None,
"last_name": None,
"middle_name": None,
"phone_number": None,
"additional_phone_number": None,
"email": None,
"date_of_birth": None,
"gender": None,
"address": None,
"address2": None,
"city": None,
"state": None,
"zip": None,
"comments": None,
"workflow_stage_id": None,
"assigned_user_id": None,
"location_id": None,
"organization_id": None,
"tags": None,
"referral": None,
"custom_fields": None,
"created_from": None,
"external_id_type": None,
"external_id": None,
"payors": "<unknown>"
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
first_name: null,
last_name: null,
middle_name: null,
phone_number: null,
additional_phone_number: null,
email: null,
date_of_birth: null,
gender: null,
address: null,
address2: null,
city: null,
state: null,
zip: null,
comments: null,
workflow_stage_id: null,
assigned_user_id: null,
location_id: null,
organization_id: null,
tags: null,
referral: null,
custom_fields: null,
created_from: null,
external_id_type: null,
external_id: null,
payors: '<unknown>'
}
]
})
};
fetch('https://api.example.com/v1/patients/batch', 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.example.com/v1/patients/batch",
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([
'items' => [
[
'first_name' => null,
'last_name' => null,
'middle_name' => null,
'phone_number' => null,
'additional_phone_number' => null,
'email' => null,
'date_of_birth' => null,
'gender' => null,
'address' => null,
'address2' => null,
'city' => null,
'state' => null,
'zip' => null,
'comments' => null,
'workflow_stage_id' => null,
'assigned_user_id' => null,
'location_id' => null,
'organization_id' => null,
'tags' => null,
'referral' => null,
'custom_fields' => null,
'created_from' => null,
'external_id_type' => null,
'external_id' => null,
'payors' => '<unknown>'
]
]
]),
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.example.com/v1/patients/batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"first_name\": null,\n \"last_name\": null,\n \"middle_name\": null,\n \"phone_number\": null,\n \"additional_phone_number\": null,\n \"email\": null,\n \"date_of_birth\": null,\n \"gender\": null,\n \"address\": null,\n \"address2\": null,\n \"city\": null,\n \"state\": null,\n \"zip\": null,\n \"comments\": null,\n \"workflow_stage_id\": null,\n \"assigned_user_id\": null,\n \"location_id\": null,\n \"organization_id\": null,\n \"tags\": null,\n \"referral\": null,\n \"custom_fields\": null,\n \"created_from\": null,\n \"external_id_type\": null,\n \"external_id\": null,\n \"payors\": \"<unknown>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/v1/patients/batch")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"first_name\": null,\n \"last_name\": null,\n \"middle_name\": null,\n \"phone_number\": null,\n \"additional_phone_number\": null,\n \"email\": null,\n \"date_of_birth\": null,\n \"gender\": null,\n \"address\": null,\n \"address2\": null,\n \"city\": null,\n \"state\": null,\n \"zip\": null,\n \"comments\": null,\n \"workflow_stage_id\": null,\n \"assigned_user_id\": null,\n \"location_id\": null,\n \"organization_id\": null,\n \"tags\": null,\n \"referral\": null,\n \"custom_fields\": null,\n \"created_from\": null,\n \"external_id_type\": null,\n \"external_id\": null,\n \"payors\": \"<unknown>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/patients/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"first_name\": null,\n \"last_name\": null,\n \"middle_name\": null,\n \"phone_number\": null,\n \"additional_phone_number\": null,\n \"email\": null,\n \"date_of_birth\": null,\n \"gender\": null,\n \"address\": null,\n \"address2\": null,\n \"city\": null,\n \"state\": null,\n \"zip\": null,\n \"comments\": null,\n \"workflow_stage_id\": null,\n \"assigned_user_id\": null,\n \"location_id\": null,\n \"organization_id\": null,\n \"tags\": null,\n \"referral\": null,\n \"custom_fields\": null,\n \"created_from\": null,\n \"external_id_type\": null,\n \"external_id\": null,\n \"payors\": \"<unknown>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"created_count": 123,
"patient_ids": [
"<string>"
],
"updated_count": 0,
"failed_count": 0,
"updated_patient_ids": [
"<string>"
],
"results": [
{
"row": 123,
"patient_id": "<string>",
"created": false,
"matched": false,
"match_reason": "external_id",
"dropped_fields": [
"<string>"
],
"insurance_status": "not_provided",
"payor_results": [
{
"outcome": "created",
"payor_responsibility": "primary",
"submitted_insurance_name": "<string>",
"resolved_insurance_id": "<string>",
"resolved_insurance_name": "<string>",
"trading_partner_service_id": "<string>",
"payor_id": "<string>",
"coverage_chain_id": "<string>",
"resolution_method": "canonical_name",
"reason_code": "insurance_name_missing",
"message": "<string>"
}
],
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
}
],
"insurance_created_count": 0,
"insurance_updated_count": 0,
"insurance_unchanged_count": 0,
"insurance_unresolved_count": 0,
"insurance_incomplete_count": 0,
"insurance_failed_count": 0,
"insurance_not_processed_count": 0,
"insurance_not_provided_count": 0
}{
"type": "validation_error",
"code": "invalid_parameter",
"message": "Field validation failed",
"param": "phone_number"
}Patient Batch
Batch create/update patients
Create or update up to 500 patients. Each row uses the same matching and update rules as POST /v1/patients/upsert: typed external ID, exact demographics, phone plus fuzzy name, then email plus fuzzy name. Rows are processed independently and returned in order.
POST
/
v1
/
patients
/
batch
Batch create/update patients
curl --request POST \
--url https://api.example.com/v1/patients/batch \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"items": [
{
"first_name": null,
"last_name": null,
"middle_name": null,
"phone_number": null,
"additional_phone_number": null,
"email": null,
"date_of_birth": null,
"gender": null,
"address": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"comments": null,
"workflow_stage_id": null,
"assigned_user_id": null,
"location_id": null,
"organization_id": null,
"tags": null,
"referral": null,
"custom_fields": null,
"created_from": null,
"external_id_type": null,
"external_id": null,
"payors": "<unknown>"
}
]
}
'import requests
url = "https://api.example.com/v1/patients/batch"
payload = { "items": [
{
"first_name": None,
"last_name": None,
"middle_name": None,
"phone_number": None,
"additional_phone_number": None,
"email": None,
"date_of_birth": None,
"gender": None,
"address": None,
"address2": None,
"city": None,
"state": None,
"zip": None,
"comments": None,
"workflow_stage_id": None,
"assigned_user_id": None,
"location_id": None,
"organization_id": None,
"tags": None,
"referral": None,
"custom_fields": None,
"created_from": None,
"external_id_type": None,
"external_id": None,
"payors": "<unknown>"
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
first_name: null,
last_name: null,
middle_name: null,
phone_number: null,
additional_phone_number: null,
email: null,
date_of_birth: null,
gender: null,
address: null,
address2: null,
city: null,
state: null,
zip: null,
comments: null,
workflow_stage_id: null,
assigned_user_id: null,
location_id: null,
organization_id: null,
tags: null,
referral: null,
custom_fields: null,
created_from: null,
external_id_type: null,
external_id: null,
payors: '<unknown>'
}
]
})
};
fetch('https://api.example.com/v1/patients/batch', 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.example.com/v1/patients/batch",
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([
'items' => [
[
'first_name' => null,
'last_name' => null,
'middle_name' => null,
'phone_number' => null,
'additional_phone_number' => null,
'email' => null,
'date_of_birth' => null,
'gender' => null,
'address' => null,
'address2' => null,
'city' => null,
'state' => null,
'zip' => null,
'comments' => null,
'workflow_stage_id' => null,
'assigned_user_id' => null,
'location_id' => null,
'organization_id' => null,
'tags' => null,
'referral' => null,
'custom_fields' => null,
'created_from' => null,
'external_id_type' => null,
'external_id' => null,
'payors' => '<unknown>'
]
]
]),
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.example.com/v1/patients/batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"first_name\": null,\n \"last_name\": null,\n \"middle_name\": null,\n \"phone_number\": null,\n \"additional_phone_number\": null,\n \"email\": null,\n \"date_of_birth\": null,\n \"gender\": null,\n \"address\": null,\n \"address2\": null,\n \"city\": null,\n \"state\": null,\n \"zip\": null,\n \"comments\": null,\n \"workflow_stage_id\": null,\n \"assigned_user_id\": null,\n \"location_id\": null,\n \"organization_id\": null,\n \"tags\": null,\n \"referral\": null,\n \"custom_fields\": null,\n \"created_from\": null,\n \"external_id_type\": null,\n \"external_id\": null,\n \"payors\": \"<unknown>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/v1/patients/batch")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"first_name\": null,\n \"last_name\": null,\n \"middle_name\": null,\n \"phone_number\": null,\n \"additional_phone_number\": null,\n \"email\": null,\n \"date_of_birth\": null,\n \"gender\": null,\n \"address\": null,\n \"address2\": null,\n \"city\": null,\n \"state\": null,\n \"zip\": null,\n \"comments\": null,\n \"workflow_stage_id\": null,\n \"assigned_user_id\": null,\n \"location_id\": null,\n \"organization_id\": null,\n \"tags\": null,\n \"referral\": null,\n \"custom_fields\": null,\n \"created_from\": null,\n \"external_id_type\": null,\n \"external_id\": null,\n \"payors\": \"<unknown>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/patients/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"first_name\": null,\n \"last_name\": null,\n \"middle_name\": null,\n \"phone_number\": null,\n \"additional_phone_number\": null,\n \"email\": null,\n \"date_of_birth\": null,\n \"gender\": null,\n \"address\": null,\n \"address2\": null,\n \"city\": null,\n \"state\": null,\n \"zip\": null,\n \"comments\": null,\n \"workflow_stage_id\": null,\n \"assigned_user_id\": null,\n \"location_id\": null,\n \"organization_id\": null,\n \"tags\": null,\n \"referral\": null,\n \"custom_fields\": null,\n \"created_from\": null,\n \"external_id_type\": null,\n \"external_id\": null,\n \"payors\": \"<unknown>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"created_count": 123,
"patient_ids": [
"<string>"
],
"updated_count": 0,
"failed_count": 0,
"updated_patient_ids": [
"<string>"
],
"results": [
{
"row": 123,
"patient_id": "<string>",
"created": false,
"matched": false,
"match_reason": "external_id",
"dropped_fields": [
"<string>"
],
"insurance_status": "not_provided",
"payor_results": [
{
"outcome": "created",
"payor_responsibility": "primary",
"submitted_insurance_name": "<string>",
"resolved_insurance_id": "<string>",
"resolved_insurance_name": "<string>",
"trading_partner_service_id": "<string>",
"payor_id": "<string>",
"coverage_chain_id": "<string>",
"resolution_method": "canonical_name",
"reason_code": "insurance_name_missing",
"message": "<string>"
}
],
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>"
}
}
],
"insurance_created_count": 0,
"insurance_updated_count": 0,
"insurance_unchanged_count": 0,
"insurance_unresolved_count": 0,
"insurance_incomplete_count": 0,
"insurance_failed_count": 0,
"insurance_not_processed_count": 0,
"insurance_not_provided_count": 0
}{
"type": "validation_error",
"code": "invalid_parameter",
"message": "Field validation failed",
"param": "phone_number"
}Authorizations
APIKeyHeaderHTTPBearer
Body
application/json
Request body for batch patient creation.
Required array length:
1 - 500 elementsShow child attributes
Show child attributes
Response
Successful Response
Response from batch patient creation/upsert.
Show child attributes
Show child attributes

