curl --request POST \
--url https://api.usecobalt.com/v1/patients \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"first_name": "Jane",
"last_name": "Doe",
"dob": "1980-01-15",
"sex": "female",
"ssn": "123456789",
"phone": "555-123-4567",
"email": "jane.doe@example.com",
"referring_provider_first_name": "Jane",
"referring_provider_last_name": "Doe",
"referring_provider_id": "<string>",
"referring_provider_npi": "1234567890",
"pcp_first_name": "Jane",
"pcp_last_name": "Doe",
"pcp_id": "<string>",
"insurance_name": "Blue Cross Anthem",
"insurance_provider_id": "insurance-provider-123",
"insurance_subscriber_number": "INS123456789",
"insurance_sequence": "primary",
"insurance_policy_type": "PPO",
"plan_code": "PLAN-001",
"group_number": "GRP98999",
"secondary_insurance_name": "Blue Cross Anthem",
"secondary_insurance_subscriber_number": "INS123456789",
"emergency_contact_first_name": "Jane",
"emergency_contact_last_name": "Doe",
"emergency_contact_relation": "spouse",
"emergency_contact_phone": "555-123-4567",
"pharmacy_id": "PHARM-123",
"cell_phone": "555-987-6543",
"middle_name": "Anne",
"mrn": "12345",
"document_url": "https://example.com/patient-doc.pdf",
"referral_reason": "Specialist consultation",
"referral_type": "Internal",
"referred_to_provider_id": "provider-123",
"referred_to_location_id": "location-1",
"facility_id": "FAC-123",
"facility_name": "Main Hospital",
"address_street": "123 Main Street",
"address_line2": "Apt 4B",
"address_city": "Los Angeles",
"address_county": "Los Angeles County",
"address_state": "CA",
"address_zip": "90001",
"responsible_party": "self",
"responsible_party_first_name": "Jane",
"responsible_party_last_name": "Doe",
"responsible_party_sex": "female",
"responsible_party_dob": "1980-01-15",
"responsible_party_phone": "555-123-4567",
"responsible_party_email": "jane.doe@example.com",
"responsible_party_address_line1": "123 Main Street",
"responsible_party_address_line2": "Apt 4B",
"responsible_party_address_city": "Los Angeles",
"responsible_party_address_state": "CA",
"responsible_party_address_zip": "90001",
"location": "location-1",
"nationality": "American",
"marital_status": "Married",
"billing_group": "Group A",
"no_email_reason": "Patient declined",
"no_ssn_reason": "Patient declined",
"language": "English",
"race": "White",
"ethnicity": "Not Hispanic or Latino",
"default_facility_id": "FAC-123",
"callback_urls": [
"https://example.com/webhooks/cobalt"
]
}
'import requests
url = "https://api.usecobalt.com/v1/patients"
payload = {
"first_name": "Jane",
"last_name": "Doe",
"dob": "1980-01-15",
"sex": "female",
"ssn": "123456789",
"phone": "555-123-4567",
"email": "jane.doe@example.com",
"referring_provider_first_name": "Jane",
"referring_provider_last_name": "Doe",
"referring_provider_id": "<string>",
"referring_provider_npi": "1234567890",
"pcp_first_name": "Jane",
"pcp_last_name": "Doe",
"pcp_id": "<string>",
"insurance_name": "Blue Cross Anthem",
"insurance_provider_id": "insurance-provider-123",
"insurance_subscriber_number": "INS123456789",
"insurance_sequence": "primary",
"insurance_policy_type": "PPO",
"plan_code": "PLAN-001",
"group_number": "GRP98999",
"secondary_insurance_name": "Blue Cross Anthem",
"secondary_insurance_subscriber_number": "INS123456789",
"emergency_contact_first_name": "Jane",
"emergency_contact_last_name": "Doe",
"emergency_contact_relation": "spouse",
"emergency_contact_phone": "555-123-4567",
"pharmacy_id": "PHARM-123",
"cell_phone": "555-987-6543",
"middle_name": "Anne",
"mrn": "12345",
"document_url": "https://example.com/patient-doc.pdf",
"referral_reason": "Specialist consultation",
"referral_type": "Internal",
"referred_to_provider_id": "provider-123",
"referred_to_location_id": "location-1",
"facility_id": "FAC-123",
"facility_name": "Main Hospital",
"address_street": "123 Main Street",
"address_line2": "Apt 4B",
"address_city": "Los Angeles",
"address_county": "Los Angeles County",
"address_state": "CA",
"address_zip": "90001",
"responsible_party": "self",
"responsible_party_first_name": "Jane",
"responsible_party_last_name": "Doe",
"responsible_party_sex": "female",
"responsible_party_dob": "1980-01-15",
"responsible_party_phone": "555-123-4567",
"responsible_party_email": "jane.doe@example.com",
"responsible_party_address_line1": "123 Main Street",
"responsible_party_address_line2": "Apt 4B",
"responsible_party_address_city": "Los Angeles",
"responsible_party_address_state": "CA",
"responsible_party_address_zip": "90001",
"location": "location-1",
"nationality": "American",
"marital_status": "Married",
"billing_group": "Group A",
"no_email_reason": "Patient declined",
"no_ssn_reason": "Patient declined",
"language": "English",
"race": "White",
"ethnicity": "Not Hispanic or Latino",
"default_facility_id": "FAC-123",
"callback_urls": ["https://example.com/webhooks/cobalt"]
}
headers = {
"client_id": "<api-key>",
"client_secret": "<api-key>",
"access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
client_id: '<api-key>',
client_secret: '<api-key>',
access_token: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
first_name: 'Jane',
last_name: 'Doe',
dob: '1980-01-15',
sex: 'female',
ssn: '123456789',
phone: '555-123-4567',
email: 'jane.doe@example.com',
referring_provider_first_name: 'Jane',
referring_provider_last_name: 'Doe',
referring_provider_id: '<string>',
referring_provider_npi: '1234567890',
pcp_first_name: 'Jane',
pcp_last_name: 'Doe',
pcp_id: '<string>',
insurance_name: 'Blue Cross Anthem',
insurance_provider_id: 'insurance-provider-123',
insurance_subscriber_number: 'INS123456789',
insurance_sequence: 'primary',
insurance_policy_type: 'PPO',
plan_code: 'PLAN-001',
group_number: 'GRP98999',
secondary_insurance_name: 'Blue Cross Anthem',
secondary_insurance_subscriber_number: 'INS123456789',
emergency_contact_first_name: 'Jane',
emergency_contact_last_name: 'Doe',
emergency_contact_relation: 'spouse',
emergency_contact_phone: '555-123-4567',
pharmacy_id: 'PHARM-123',
cell_phone: '555-987-6543',
middle_name: 'Anne',
mrn: '12345',
document_url: 'https://example.com/patient-doc.pdf',
referral_reason: 'Specialist consultation',
referral_type: 'Internal',
referred_to_provider_id: 'provider-123',
referred_to_location_id: 'location-1',
facility_id: 'FAC-123',
facility_name: 'Main Hospital',
address_street: '123 Main Street',
address_line2: 'Apt 4B',
address_city: 'Los Angeles',
address_county: 'Los Angeles County',
address_state: 'CA',
address_zip: '90001',
responsible_party: 'self',
responsible_party_first_name: 'Jane',
responsible_party_last_name: 'Doe',
responsible_party_sex: 'female',
responsible_party_dob: '1980-01-15',
responsible_party_phone: '555-123-4567',
responsible_party_email: 'jane.doe@example.com',
responsible_party_address_line1: '123 Main Street',
responsible_party_address_line2: 'Apt 4B',
responsible_party_address_city: 'Los Angeles',
responsible_party_address_state: 'CA',
responsible_party_address_zip: '90001',
location: 'location-1',
nationality: 'American',
marital_status: 'Married',
billing_group: 'Group A',
no_email_reason: 'Patient declined',
no_ssn_reason: 'Patient declined',
language: 'English',
race: 'White',
ethnicity: 'Not Hispanic or Latino',
default_facility_id: 'FAC-123',
callback_urls: ['https://example.com/webhooks/cobalt']
})
};
fetch('https://api.usecobalt.com/v1/patients', 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.usecobalt.com/v1/patients",
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([
'first_name' => 'Jane',
'last_name' => 'Doe',
'dob' => '1980-01-15',
'sex' => 'female',
'ssn' => '123456789',
'phone' => '555-123-4567',
'email' => 'jane.doe@example.com',
'referring_provider_first_name' => 'Jane',
'referring_provider_last_name' => 'Doe',
'referring_provider_id' => '<string>',
'referring_provider_npi' => '1234567890',
'pcp_first_name' => 'Jane',
'pcp_last_name' => 'Doe',
'pcp_id' => '<string>',
'insurance_name' => 'Blue Cross Anthem',
'insurance_provider_id' => 'insurance-provider-123',
'insurance_subscriber_number' => 'INS123456789',
'insurance_sequence' => 'primary',
'insurance_policy_type' => 'PPO',
'plan_code' => 'PLAN-001',
'group_number' => 'GRP98999',
'secondary_insurance_name' => 'Blue Cross Anthem',
'secondary_insurance_subscriber_number' => 'INS123456789',
'emergency_contact_first_name' => 'Jane',
'emergency_contact_last_name' => 'Doe',
'emergency_contact_relation' => 'spouse',
'emergency_contact_phone' => '555-123-4567',
'pharmacy_id' => 'PHARM-123',
'cell_phone' => '555-987-6543',
'middle_name' => 'Anne',
'mrn' => '12345',
'document_url' => 'https://example.com/patient-doc.pdf',
'referral_reason' => 'Specialist consultation',
'referral_type' => 'Internal',
'referred_to_provider_id' => 'provider-123',
'referred_to_location_id' => 'location-1',
'facility_id' => 'FAC-123',
'facility_name' => 'Main Hospital',
'address_street' => '123 Main Street',
'address_line2' => 'Apt 4B',
'address_city' => 'Los Angeles',
'address_county' => 'Los Angeles County',
'address_state' => 'CA',
'address_zip' => '90001',
'responsible_party' => 'self',
'responsible_party_first_name' => 'Jane',
'responsible_party_last_name' => 'Doe',
'responsible_party_sex' => 'female',
'responsible_party_dob' => '1980-01-15',
'responsible_party_phone' => '555-123-4567',
'responsible_party_email' => 'jane.doe@example.com',
'responsible_party_address_line1' => '123 Main Street',
'responsible_party_address_line2' => 'Apt 4B',
'responsible_party_address_city' => 'Los Angeles',
'responsible_party_address_state' => 'CA',
'responsible_party_address_zip' => '90001',
'location' => 'location-1',
'nationality' => 'American',
'marital_status' => 'Married',
'billing_group' => 'Group A',
'no_email_reason' => 'Patient declined',
'no_ssn_reason' => 'Patient declined',
'language' => 'English',
'race' => 'White',
'ethnicity' => 'Not Hispanic or Latino',
'default_facility_id' => 'FAC-123',
'callback_urls' => [
'https://example.com/webhooks/cobalt'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"access_token: <api-key>",
"client_id: <api-key>",
"client_secret: <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.usecobalt.com/v1/patients"
payload := strings.NewReader("{\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"dob\": \"1980-01-15\",\n \"sex\": \"female\",\n \"ssn\": \"123456789\",\n \"phone\": \"555-123-4567\",\n \"email\": \"jane.doe@example.com\",\n \"referring_provider_first_name\": \"Jane\",\n \"referring_provider_last_name\": \"Doe\",\n \"referring_provider_id\": \"<string>\",\n \"referring_provider_npi\": \"1234567890\",\n \"pcp_first_name\": \"Jane\",\n \"pcp_last_name\": \"Doe\",\n \"pcp_id\": \"<string>\",\n \"insurance_name\": \"Blue Cross Anthem\",\n \"insurance_provider_id\": \"insurance-provider-123\",\n \"insurance_subscriber_number\": \"INS123456789\",\n \"insurance_sequence\": \"primary\",\n \"insurance_policy_type\": \"PPO\",\n \"plan_code\": \"PLAN-001\",\n \"group_number\": \"GRP98999\",\n \"secondary_insurance_name\": \"Blue Cross Anthem\",\n \"secondary_insurance_subscriber_number\": \"INS123456789\",\n \"emergency_contact_first_name\": \"Jane\",\n \"emergency_contact_last_name\": \"Doe\",\n \"emergency_contact_relation\": \"spouse\",\n \"emergency_contact_phone\": \"555-123-4567\",\n \"pharmacy_id\": \"PHARM-123\",\n \"cell_phone\": \"555-987-6543\",\n \"middle_name\": \"Anne\",\n \"mrn\": \"12345\",\n \"document_url\": \"https://example.com/patient-doc.pdf\",\n \"referral_reason\": \"Specialist consultation\",\n \"referral_type\": \"Internal\",\n \"referred_to_provider_id\": \"provider-123\",\n \"referred_to_location_id\": \"location-1\",\n \"facility_id\": \"FAC-123\",\n \"facility_name\": \"Main Hospital\",\n \"address_street\": \"123 Main Street\",\n \"address_line2\": \"Apt 4B\",\n \"address_city\": \"Los Angeles\",\n \"address_county\": \"Los Angeles County\",\n \"address_state\": \"CA\",\n \"address_zip\": \"90001\",\n \"responsible_party\": \"self\",\n \"responsible_party_first_name\": \"Jane\",\n \"responsible_party_last_name\": \"Doe\",\n \"responsible_party_sex\": \"female\",\n \"responsible_party_dob\": \"1980-01-15\",\n \"responsible_party_phone\": \"555-123-4567\",\n \"responsible_party_email\": \"jane.doe@example.com\",\n \"responsible_party_address_line1\": \"123 Main Street\",\n \"responsible_party_address_line2\": \"Apt 4B\",\n \"responsible_party_address_city\": \"Los Angeles\",\n \"responsible_party_address_state\": \"CA\",\n \"responsible_party_address_zip\": \"90001\",\n \"location\": \"location-1\",\n \"nationality\": \"American\",\n \"marital_status\": \"Married\",\n \"billing_group\": \"Group A\",\n \"no_email_reason\": \"Patient declined\",\n \"no_ssn_reason\": \"Patient declined\",\n \"language\": \"English\",\n \"race\": \"White\",\n \"ethnicity\": \"Not Hispanic or Latino\",\n \"default_facility_id\": \"FAC-123\",\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("client_id", "<api-key>")
req.Header.Add("client_secret", "<api-key>")
req.Header.Add("access_token", "<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.usecobalt.com/v1/patients")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"dob\": \"1980-01-15\",\n \"sex\": \"female\",\n \"ssn\": \"123456789\",\n \"phone\": \"555-123-4567\",\n \"email\": \"jane.doe@example.com\",\n \"referring_provider_first_name\": \"Jane\",\n \"referring_provider_last_name\": \"Doe\",\n \"referring_provider_id\": \"<string>\",\n \"referring_provider_npi\": \"1234567890\",\n \"pcp_first_name\": \"Jane\",\n \"pcp_last_name\": \"Doe\",\n \"pcp_id\": \"<string>\",\n \"insurance_name\": \"Blue Cross Anthem\",\n \"insurance_provider_id\": \"insurance-provider-123\",\n \"insurance_subscriber_number\": \"INS123456789\",\n \"insurance_sequence\": \"primary\",\n \"insurance_policy_type\": \"PPO\",\n \"plan_code\": \"PLAN-001\",\n \"group_number\": \"GRP98999\",\n \"secondary_insurance_name\": \"Blue Cross Anthem\",\n \"secondary_insurance_subscriber_number\": \"INS123456789\",\n \"emergency_contact_first_name\": \"Jane\",\n \"emergency_contact_last_name\": \"Doe\",\n \"emergency_contact_relation\": \"spouse\",\n \"emergency_contact_phone\": \"555-123-4567\",\n \"pharmacy_id\": \"PHARM-123\",\n \"cell_phone\": \"555-987-6543\",\n \"middle_name\": \"Anne\",\n \"mrn\": \"12345\",\n \"document_url\": \"https://example.com/patient-doc.pdf\",\n \"referral_reason\": \"Specialist consultation\",\n \"referral_type\": \"Internal\",\n \"referred_to_provider_id\": \"provider-123\",\n \"referred_to_location_id\": \"location-1\",\n \"facility_id\": \"FAC-123\",\n \"facility_name\": \"Main Hospital\",\n \"address_street\": \"123 Main Street\",\n \"address_line2\": \"Apt 4B\",\n \"address_city\": \"Los Angeles\",\n \"address_county\": \"Los Angeles County\",\n \"address_state\": \"CA\",\n \"address_zip\": \"90001\",\n \"responsible_party\": \"self\",\n \"responsible_party_first_name\": \"Jane\",\n \"responsible_party_last_name\": \"Doe\",\n \"responsible_party_sex\": \"female\",\n \"responsible_party_dob\": \"1980-01-15\",\n \"responsible_party_phone\": \"555-123-4567\",\n \"responsible_party_email\": \"jane.doe@example.com\",\n \"responsible_party_address_line1\": \"123 Main Street\",\n \"responsible_party_address_line2\": \"Apt 4B\",\n \"responsible_party_address_city\": \"Los Angeles\",\n \"responsible_party_address_state\": \"CA\",\n \"responsible_party_address_zip\": \"90001\",\n \"location\": \"location-1\",\n \"nationality\": \"American\",\n \"marital_status\": \"Married\",\n \"billing_group\": \"Group A\",\n \"no_email_reason\": \"Patient declined\",\n \"no_ssn_reason\": \"Patient declined\",\n \"language\": \"English\",\n \"race\": \"White\",\n \"ethnicity\": \"Not Hispanic or Latino\",\n \"default_facility_id\": \"FAC-123\",\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usecobalt.com/v1/patients")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["client_id"] = '<api-key>'
request["client_secret"] = '<api-key>'
request["access_token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"dob\": \"1980-01-15\",\n \"sex\": \"female\",\n \"ssn\": \"123456789\",\n \"phone\": \"555-123-4567\",\n \"email\": \"jane.doe@example.com\",\n \"referring_provider_first_name\": \"Jane\",\n \"referring_provider_last_name\": \"Doe\",\n \"referring_provider_id\": \"<string>\",\n \"referring_provider_npi\": \"1234567890\",\n \"pcp_first_name\": \"Jane\",\n \"pcp_last_name\": \"Doe\",\n \"pcp_id\": \"<string>\",\n \"insurance_name\": \"Blue Cross Anthem\",\n \"insurance_provider_id\": \"insurance-provider-123\",\n \"insurance_subscriber_number\": \"INS123456789\",\n \"insurance_sequence\": \"primary\",\n \"insurance_policy_type\": \"PPO\",\n \"plan_code\": \"PLAN-001\",\n \"group_number\": \"GRP98999\",\n \"secondary_insurance_name\": \"Blue Cross Anthem\",\n \"secondary_insurance_subscriber_number\": \"INS123456789\",\n \"emergency_contact_first_name\": \"Jane\",\n \"emergency_contact_last_name\": \"Doe\",\n \"emergency_contact_relation\": \"spouse\",\n \"emergency_contact_phone\": \"555-123-4567\",\n \"pharmacy_id\": \"PHARM-123\",\n \"cell_phone\": \"555-987-6543\",\n \"middle_name\": \"Anne\",\n \"mrn\": \"12345\",\n \"document_url\": \"https://example.com/patient-doc.pdf\",\n \"referral_reason\": \"Specialist consultation\",\n \"referral_type\": \"Internal\",\n \"referred_to_provider_id\": \"provider-123\",\n \"referred_to_location_id\": \"location-1\",\n \"facility_id\": \"FAC-123\",\n \"facility_name\": \"Main Hospital\",\n \"address_street\": \"123 Main Street\",\n \"address_line2\": \"Apt 4B\",\n \"address_city\": \"Los Angeles\",\n \"address_county\": \"Los Angeles County\",\n \"address_state\": \"CA\",\n \"address_zip\": \"90001\",\n \"responsible_party\": \"self\",\n \"responsible_party_first_name\": \"Jane\",\n \"responsible_party_last_name\": \"Doe\",\n \"responsible_party_sex\": \"female\",\n \"responsible_party_dob\": \"1980-01-15\",\n \"responsible_party_phone\": \"555-123-4567\",\n \"responsible_party_email\": \"jane.doe@example.com\",\n \"responsible_party_address_line1\": \"123 Main Street\",\n \"responsible_party_address_line2\": \"Apt 4B\",\n \"responsible_party_address_city\": \"Los Angeles\",\n \"responsible_party_address_state\": \"CA\",\n \"responsible_party_address_zip\": \"90001\",\n \"location\": \"location-1\",\n \"nationality\": \"American\",\n \"marital_status\": \"Married\",\n \"billing_group\": \"Group A\",\n \"no_email_reason\": \"Patient declined\",\n \"no_ssn_reason\": \"Patient declined\",\n \"language\": \"English\",\n \"race\": \"White\",\n \"ethnicity\": \"Not Hispanic or Latino\",\n \"default_facility_id\": \"FAC-123\",\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"patient_id": "<string>",
"job_id": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}Create Patient
Creates a new patient record.
curl --request POST \
--url https://api.usecobalt.com/v1/patients \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"first_name": "Jane",
"last_name": "Doe",
"dob": "1980-01-15",
"sex": "female",
"ssn": "123456789",
"phone": "555-123-4567",
"email": "jane.doe@example.com",
"referring_provider_first_name": "Jane",
"referring_provider_last_name": "Doe",
"referring_provider_id": "<string>",
"referring_provider_npi": "1234567890",
"pcp_first_name": "Jane",
"pcp_last_name": "Doe",
"pcp_id": "<string>",
"insurance_name": "Blue Cross Anthem",
"insurance_provider_id": "insurance-provider-123",
"insurance_subscriber_number": "INS123456789",
"insurance_sequence": "primary",
"insurance_policy_type": "PPO",
"plan_code": "PLAN-001",
"group_number": "GRP98999",
"secondary_insurance_name": "Blue Cross Anthem",
"secondary_insurance_subscriber_number": "INS123456789",
"emergency_contact_first_name": "Jane",
"emergency_contact_last_name": "Doe",
"emergency_contact_relation": "spouse",
"emergency_contact_phone": "555-123-4567",
"pharmacy_id": "PHARM-123",
"cell_phone": "555-987-6543",
"middle_name": "Anne",
"mrn": "12345",
"document_url": "https://example.com/patient-doc.pdf",
"referral_reason": "Specialist consultation",
"referral_type": "Internal",
"referred_to_provider_id": "provider-123",
"referred_to_location_id": "location-1",
"facility_id": "FAC-123",
"facility_name": "Main Hospital",
"address_street": "123 Main Street",
"address_line2": "Apt 4B",
"address_city": "Los Angeles",
"address_county": "Los Angeles County",
"address_state": "CA",
"address_zip": "90001",
"responsible_party": "self",
"responsible_party_first_name": "Jane",
"responsible_party_last_name": "Doe",
"responsible_party_sex": "female",
"responsible_party_dob": "1980-01-15",
"responsible_party_phone": "555-123-4567",
"responsible_party_email": "jane.doe@example.com",
"responsible_party_address_line1": "123 Main Street",
"responsible_party_address_line2": "Apt 4B",
"responsible_party_address_city": "Los Angeles",
"responsible_party_address_state": "CA",
"responsible_party_address_zip": "90001",
"location": "location-1",
"nationality": "American",
"marital_status": "Married",
"billing_group": "Group A",
"no_email_reason": "Patient declined",
"no_ssn_reason": "Patient declined",
"language": "English",
"race": "White",
"ethnicity": "Not Hispanic or Latino",
"default_facility_id": "FAC-123",
"callback_urls": [
"https://example.com/webhooks/cobalt"
]
}
'import requests
url = "https://api.usecobalt.com/v1/patients"
payload = {
"first_name": "Jane",
"last_name": "Doe",
"dob": "1980-01-15",
"sex": "female",
"ssn": "123456789",
"phone": "555-123-4567",
"email": "jane.doe@example.com",
"referring_provider_first_name": "Jane",
"referring_provider_last_name": "Doe",
"referring_provider_id": "<string>",
"referring_provider_npi": "1234567890",
"pcp_first_name": "Jane",
"pcp_last_name": "Doe",
"pcp_id": "<string>",
"insurance_name": "Blue Cross Anthem",
"insurance_provider_id": "insurance-provider-123",
"insurance_subscriber_number": "INS123456789",
"insurance_sequence": "primary",
"insurance_policy_type": "PPO",
"plan_code": "PLAN-001",
"group_number": "GRP98999",
"secondary_insurance_name": "Blue Cross Anthem",
"secondary_insurance_subscriber_number": "INS123456789",
"emergency_contact_first_name": "Jane",
"emergency_contact_last_name": "Doe",
"emergency_contact_relation": "spouse",
"emergency_contact_phone": "555-123-4567",
"pharmacy_id": "PHARM-123",
"cell_phone": "555-987-6543",
"middle_name": "Anne",
"mrn": "12345",
"document_url": "https://example.com/patient-doc.pdf",
"referral_reason": "Specialist consultation",
"referral_type": "Internal",
"referred_to_provider_id": "provider-123",
"referred_to_location_id": "location-1",
"facility_id": "FAC-123",
"facility_name": "Main Hospital",
"address_street": "123 Main Street",
"address_line2": "Apt 4B",
"address_city": "Los Angeles",
"address_county": "Los Angeles County",
"address_state": "CA",
"address_zip": "90001",
"responsible_party": "self",
"responsible_party_first_name": "Jane",
"responsible_party_last_name": "Doe",
"responsible_party_sex": "female",
"responsible_party_dob": "1980-01-15",
"responsible_party_phone": "555-123-4567",
"responsible_party_email": "jane.doe@example.com",
"responsible_party_address_line1": "123 Main Street",
"responsible_party_address_line2": "Apt 4B",
"responsible_party_address_city": "Los Angeles",
"responsible_party_address_state": "CA",
"responsible_party_address_zip": "90001",
"location": "location-1",
"nationality": "American",
"marital_status": "Married",
"billing_group": "Group A",
"no_email_reason": "Patient declined",
"no_ssn_reason": "Patient declined",
"language": "English",
"race": "White",
"ethnicity": "Not Hispanic or Latino",
"default_facility_id": "FAC-123",
"callback_urls": ["https://example.com/webhooks/cobalt"]
}
headers = {
"client_id": "<api-key>",
"client_secret": "<api-key>",
"access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
client_id: '<api-key>',
client_secret: '<api-key>',
access_token: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
first_name: 'Jane',
last_name: 'Doe',
dob: '1980-01-15',
sex: 'female',
ssn: '123456789',
phone: '555-123-4567',
email: 'jane.doe@example.com',
referring_provider_first_name: 'Jane',
referring_provider_last_name: 'Doe',
referring_provider_id: '<string>',
referring_provider_npi: '1234567890',
pcp_first_name: 'Jane',
pcp_last_name: 'Doe',
pcp_id: '<string>',
insurance_name: 'Blue Cross Anthem',
insurance_provider_id: 'insurance-provider-123',
insurance_subscriber_number: 'INS123456789',
insurance_sequence: 'primary',
insurance_policy_type: 'PPO',
plan_code: 'PLAN-001',
group_number: 'GRP98999',
secondary_insurance_name: 'Blue Cross Anthem',
secondary_insurance_subscriber_number: 'INS123456789',
emergency_contact_first_name: 'Jane',
emergency_contact_last_name: 'Doe',
emergency_contact_relation: 'spouse',
emergency_contact_phone: '555-123-4567',
pharmacy_id: 'PHARM-123',
cell_phone: '555-987-6543',
middle_name: 'Anne',
mrn: '12345',
document_url: 'https://example.com/patient-doc.pdf',
referral_reason: 'Specialist consultation',
referral_type: 'Internal',
referred_to_provider_id: 'provider-123',
referred_to_location_id: 'location-1',
facility_id: 'FAC-123',
facility_name: 'Main Hospital',
address_street: '123 Main Street',
address_line2: 'Apt 4B',
address_city: 'Los Angeles',
address_county: 'Los Angeles County',
address_state: 'CA',
address_zip: '90001',
responsible_party: 'self',
responsible_party_first_name: 'Jane',
responsible_party_last_name: 'Doe',
responsible_party_sex: 'female',
responsible_party_dob: '1980-01-15',
responsible_party_phone: '555-123-4567',
responsible_party_email: 'jane.doe@example.com',
responsible_party_address_line1: '123 Main Street',
responsible_party_address_line2: 'Apt 4B',
responsible_party_address_city: 'Los Angeles',
responsible_party_address_state: 'CA',
responsible_party_address_zip: '90001',
location: 'location-1',
nationality: 'American',
marital_status: 'Married',
billing_group: 'Group A',
no_email_reason: 'Patient declined',
no_ssn_reason: 'Patient declined',
language: 'English',
race: 'White',
ethnicity: 'Not Hispanic or Latino',
default_facility_id: 'FAC-123',
callback_urls: ['https://example.com/webhooks/cobalt']
})
};
fetch('https://api.usecobalt.com/v1/patients', 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.usecobalt.com/v1/patients",
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([
'first_name' => 'Jane',
'last_name' => 'Doe',
'dob' => '1980-01-15',
'sex' => 'female',
'ssn' => '123456789',
'phone' => '555-123-4567',
'email' => 'jane.doe@example.com',
'referring_provider_first_name' => 'Jane',
'referring_provider_last_name' => 'Doe',
'referring_provider_id' => '<string>',
'referring_provider_npi' => '1234567890',
'pcp_first_name' => 'Jane',
'pcp_last_name' => 'Doe',
'pcp_id' => '<string>',
'insurance_name' => 'Blue Cross Anthem',
'insurance_provider_id' => 'insurance-provider-123',
'insurance_subscriber_number' => 'INS123456789',
'insurance_sequence' => 'primary',
'insurance_policy_type' => 'PPO',
'plan_code' => 'PLAN-001',
'group_number' => 'GRP98999',
'secondary_insurance_name' => 'Blue Cross Anthem',
'secondary_insurance_subscriber_number' => 'INS123456789',
'emergency_contact_first_name' => 'Jane',
'emergency_contact_last_name' => 'Doe',
'emergency_contact_relation' => 'spouse',
'emergency_contact_phone' => '555-123-4567',
'pharmacy_id' => 'PHARM-123',
'cell_phone' => '555-987-6543',
'middle_name' => 'Anne',
'mrn' => '12345',
'document_url' => 'https://example.com/patient-doc.pdf',
'referral_reason' => 'Specialist consultation',
'referral_type' => 'Internal',
'referred_to_provider_id' => 'provider-123',
'referred_to_location_id' => 'location-1',
'facility_id' => 'FAC-123',
'facility_name' => 'Main Hospital',
'address_street' => '123 Main Street',
'address_line2' => 'Apt 4B',
'address_city' => 'Los Angeles',
'address_county' => 'Los Angeles County',
'address_state' => 'CA',
'address_zip' => '90001',
'responsible_party' => 'self',
'responsible_party_first_name' => 'Jane',
'responsible_party_last_name' => 'Doe',
'responsible_party_sex' => 'female',
'responsible_party_dob' => '1980-01-15',
'responsible_party_phone' => '555-123-4567',
'responsible_party_email' => 'jane.doe@example.com',
'responsible_party_address_line1' => '123 Main Street',
'responsible_party_address_line2' => 'Apt 4B',
'responsible_party_address_city' => 'Los Angeles',
'responsible_party_address_state' => 'CA',
'responsible_party_address_zip' => '90001',
'location' => 'location-1',
'nationality' => 'American',
'marital_status' => 'Married',
'billing_group' => 'Group A',
'no_email_reason' => 'Patient declined',
'no_ssn_reason' => 'Patient declined',
'language' => 'English',
'race' => 'White',
'ethnicity' => 'Not Hispanic or Latino',
'default_facility_id' => 'FAC-123',
'callback_urls' => [
'https://example.com/webhooks/cobalt'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"access_token: <api-key>",
"client_id: <api-key>",
"client_secret: <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.usecobalt.com/v1/patients"
payload := strings.NewReader("{\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"dob\": \"1980-01-15\",\n \"sex\": \"female\",\n \"ssn\": \"123456789\",\n \"phone\": \"555-123-4567\",\n \"email\": \"jane.doe@example.com\",\n \"referring_provider_first_name\": \"Jane\",\n \"referring_provider_last_name\": \"Doe\",\n \"referring_provider_id\": \"<string>\",\n \"referring_provider_npi\": \"1234567890\",\n \"pcp_first_name\": \"Jane\",\n \"pcp_last_name\": \"Doe\",\n \"pcp_id\": \"<string>\",\n \"insurance_name\": \"Blue Cross Anthem\",\n \"insurance_provider_id\": \"insurance-provider-123\",\n \"insurance_subscriber_number\": \"INS123456789\",\n \"insurance_sequence\": \"primary\",\n \"insurance_policy_type\": \"PPO\",\n \"plan_code\": \"PLAN-001\",\n \"group_number\": \"GRP98999\",\n \"secondary_insurance_name\": \"Blue Cross Anthem\",\n \"secondary_insurance_subscriber_number\": \"INS123456789\",\n \"emergency_contact_first_name\": \"Jane\",\n \"emergency_contact_last_name\": \"Doe\",\n \"emergency_contact_relation\": \"spouse\",\n \"emergency_contact_phone\": \"555-123-4567\",\n \"pharmacy_id\": \"PHARM-123\",\n \"cell_phone\": \"555-987-6543\",\n \"middle_name\": \"Anne\",\n \"mrn\": \"12345\",\n \"document_url\": \"https://example.com/patient-doc.pdf\",\n \"referral_reason\": \"Specialist consultation\",\n \"referral_type\": \"Internal\",\n \"referred_to_provider_id\": \"provider-123\",\n \"referred_to_location_id\": \"location-1\",\n \"facility_id\": \"FAC-123\",\n \"facility_name\": \"Main Hospital\",\n \"address_street\": \"123 Main Street\",\n \"address_line2\": \"Apt 4B\",\n \"address_city\": \"Los Angeles\",\n \"address_county\": \"Los Angeles County\",\n \"address_state\": \"CA\",\n \"address_zip\": \"90001\",\n \"responsible_party\": \"self\",\n \"responsible_party_first_name\": \"Jane\",\n \"responsible_party_last_name\": \"Doe\",\n \"responsible_party_sex\": \"female\",\n \"responsible_party_dob\": \"1980-01-15\",\n \"responsible_party_phone\": \"555-123-4567\",\n \"responsible_party_email\": \"jane.doe@example.com\",\n \"responsible_party_address_line1\": \"123 Main Street\",\n \"responsible_party_address_line2\": \"Apt 4B\",\n \"responsible_party_address_city\": \"Los Angeles\",\n \"responsible_party_address_state\": \"CA\",\n \"responsible_party_address_zip\": \"90001\",\n \"location\": \"location-1\",\n \"nationality\": \"American\",\n \"marital_status\": \"Married\",\n \"billing_group\": \"Group A\",\n \"no_email_reason\": \"Patient declined\",\n \"no_ssn_reason\": \"Patient declined\",\n \"language\": \"English\",\n \"race\": \"White\",\n \"ethnicity\": \"Not Hispanic or Latino\",\n \"default_facility_id\": \"FAC-123\",\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("client_id", "<api-key>")
req.Header.Add("client_secret", "<api-key>")
req.Header.Add("access_token", "<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.usecobalt.com/v1/patients")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"dob\": \"1980-01-15\",\n \"sex\": \"female\",\n \"ssn\": \"123456789\",\n \"phone\": \"555-123-4567\",\n \"email\": \"jane.doe@example.com\",\n \"referring_provider_first_name\": \"Jane\",\n \"referring_provider_last_name\": \"Doe\",\n \"referring_provider_id\": \"<string>\",\n \"referring_provider_npi\": \"1234567890\",\n \"pcp_first_name\": \"Jane\",\n \"pcp_last_name\": \"Doe\",\n \"pcp_id\": \"<string>\",\n \"insurance_name\": \"Blue Cross Anthem\",\n \"insurance_provider_id\": \"insurance-provider-123\",\n \"insurance_subscriber_number\": \"INS123456789\",\n \"insurance_sequence\": \"primary\",\n \"insurance_policy_type\": \"PPO\",\n \"plan_code\": \"PLAN-001\",\n \"group_number\": \"GRP98999\",\n \"secondary_insurance_name\": \"Blue Cross Anthem\",\n \"secondary_insurance_subscriber_number\": \"INS123456789\",\n \"emergency_contact_first_name\": \"Jane\",\n \"emergency_contact_last_name\": \"Doe\",\n \"emergency_contact_relation\": \"spouse\",\n \"emergency_contact_phone\": \"555-123-4567\",\n \"pharmacy_id\": \"PHARM-123\",\n \"cell_phone\": \"555-987-6543\",\n \"middle_name\": \"Anne\",\n \"mrn\": \"12345\",\n \"document_url\": \"https://example.com/patient-doc.pdf\",\n \"referral_reason\": \"Specialist consultation\",\n \"referral_type\": \"Internal\",\n \"referred_to_provider_id\": \"provider-123\",\n \"referred_to_location_id\": \"location-1\",\n \"facility_id\": \"FAC-123\",\n \"facility_name\": \"Main Hospital\",\n \"address_street\": \"123 Main Street\",\n \"address_line2\": \"Apt 4B\",\n \"address_city\": \"Los Angeles\",\n \"address_county\": \"Los Angeles County\",\n \"address_state\": \"CA\",\n \"address_zip\": \"90001\",\n \"responsible_party\": \"self\",\n \"responsible_party_first_name\": \"Jane\",\n \"responsible_party_last_name\": \"Doe\",\n \"responsible_party_sex\": \"female\",\n \"responsible_party_dob\": \"1980-01-15\",\n \"responsible_party_phone\": \"555-123-4567\",\n \"responsible_party_email\": \"jane.doe@example.com\",\n \"responsible_party_address_line1\": \"123 Main Street\",\n \"responsible_party_address_line2\": \"Apt 4B\",\n \"responsible_party_address_city\": \"Los Angeles\",\n \"responsible_party_address_state\": \"CA\",\n \"responsible_party_address_zip\": \"90001\",\n \"location\": \"location-1\",\n \"nationality\": \"American\",\n \"marital_status\": \"Married\",\n \"billing_group\": \"Group A\",\n \"no_email_reason\": \"Patient declined\",\n \"no_ssn_reason\": \"Patient declined\",\n \"language\": \"English\",\n \"race\": \"White\",\n \"ethnicity\": \"Not Hispanic or Latino\",\n \"default_facility_id\": \"FAC-123\",\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usecobalt.com/v1/patients")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["client_id"] = '<api-key>'
request["client_secret"] = '<api-key>'
request["access_token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"dob\": \"1980-01-15\",\n \"sex\": \"female\",\n \"ssn\": \"123456789\",\n \"phone\": \"555-123-4567\",\n \"email\": \"jane.doe@example.com\",\n \"referring_provider_first_name\": \"Jane\",\n \"referring_provider_last_name\": \"Doe\",\n \"referring_provider_id\": \"<string>\",\n \"referring_provider_npi\": \"1234567890\",\n \"pcp_first_name\": \"Jane\",\n \"pcp_last_name\": \"Doe\",\n \"pcp_id\": \"<string>\",\n \"insurance_name\": \"Blue Cross Anthem\",\n \"insurance_provider_id\": \"insurance-provider-123\",\n \"insurance_subscriber_number\": \"INS123456789\",\n \"insurance_sequence\": \"primary\",\n \"insurance_policy_type\": \"PPO\",\n \"plan_code\": \"PLAN-001\",\n \"group_number\": \"GRP98999\",\n \"secondary_insurance_name\": \"Blue Cross Anthem\",\n \"secondary_insurance_subscriber_number\": \"INS123456789\",\n \"emergency_contact_first_name\": \"Jane\",\n \"emergency_contact_last_name\": \"Doe\",\n \"emergency_contact_relation\": \"spouse\",\n \"emergency_contact_phone\": \"555-123-4567\",\n \"pharmacy_id\": \"PHARM-123\",\n \"cell_phone\": \"555-987-6543\",\n \"middle_name\": \"Anne\",\n \"mrn\": \"12345\",\n \"document_url\": \"https://example.com/patient-doc.pdf\",\n \"referral_reason\": \"Specialist consultation\",\n \"referral_type\": \"Internal\",\n \"referred_to_provider_id\": \"provider-123\",\n \"referred_to_location_id\": \"location-1\",\n \"facility_id\": \"FAC-123\",\n \"facility_name\": \"Main Hospital\",\n \"address_street\": \"123 Main Street\",\n \"address_line2\": \"Apt 4B\",\n \"address_city\": \"Los Angeles\",\n \"address_county\": \"Los Angeles County\",\n \"address_state\": \"CA\",\n \"address_zip\": \"90001\",\n \"responsible_party\": \"self\",\n \"responsible_party_first_name\": \"Jane\",\n \"responsible_party_last_name\": \"Doe\",\n \"responsible_party_sex\": \"female\",\n \"responsible_party_dob\": \"1980-01-15\",\n \"responsible_party_phone\": \"555-123-4567\",\n \"responsible_party_email\": \"jane.doe@example.com\",\n \"responsible_party_address_line1\": \"123 Main Street\",\n \"responsible_party_address_line2\": \"Apt 4B\",\n \"responsible_party_address_city\": \"Los Angeles\",\n \"responsible_party_address_state\": \"CA\",\n \"responsible_party_address_zip\": \"90001\",\n \"location\": \"location-1\",\n \"nationality\": \"American\",\n \"marital_status\": \"Married\",\n \"billing_group\": \"Group A\",\n \"no_email_reason\": \"Patient declined\",\n \"no_ssn_reason\": \"Patient declined\",\n \"language\": \"English\",\n \"race\": \"White\",\n \"ethnicity\": \"Not Hispanic or Latino\",\n \"default_facility_id\": \"FAC-123\",\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"patient_id": "<string>",
"job_id": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}Provider IDs for Referrals
When creating patients with referral information, use theehr_id value from providers:
referred_to_provider_id(optional): Use theehr_idfromGET /v1/providers(not theid)
id here. The id field from GET responses is Cobalt’s internal UUID, used only for updating provider settings via PATCH endpoints.Referring Provider and PCP Options
When creating a patient, you can specify the referring provider and PCP (Primary Care Provider) using either names or provider IDs:Option 1: Provider Names (All EMRs)
Provide the provider’s first and last name:{
"referring_provider_first_name": "John",
"referring_provider_last_name": "Smith",
"pcp_first_name": "Jane",
"pcp_last_name": "Doe"
}
Option 2: Provider IDs
Provide a Cobaltid (UUID, with or without dashes). This option:
- Automatically looks up the provider’s name, phone, and fax
- Provides more accurate matching by validating contact information in the EMR
- Falls back to using provided names if the ID is not found
referring_provider_id: theidfromGET /v1/referring-providers.pcp_id: theidfrom eitherGET /v1/referring-providersorGET /v1/providers. Pass a/v1/providersidwhen the patient’s PCP is one of the practice’s own physicians rather than an external referring provider. Cobalt resolves the UUID against both sets of providers, so you can use whichever endpoint the provider appears in.
{
"referring_provider_id": "e35e82b85df58f08a9b38e06a91e9f1a",
"pcp_id": "223ecd1b29e546ca9db6b391eb49b213"
}
pcp_id, use the id field (the Cobalt UUID), not the ehr_id. This differs from referred_to_provider_id, which expects the ehr_id from GET /v1/providers.Responsible Party
By default, the patient is their own responsible party (responsible_party: "self"). For minors or patients whose billing is managed by another person, set responsible_party to one of the values below and include the guarantor’s demographic fields.
When a non-self responsible party is provided alongside insurance, Cobalt will:
- Create a guarantor record in the EMR with the provided demographics
- Link that guarantor to the insurance record
- Set the responsible party on the patient
{
"responsible_party": "parent",
"responsible_party_first_name": "Jane",
"responsible_party_last_name": "Smith",
"responsible_party_sex": "female",
"responsible_party_dob": "1975-06-15",
"responsible_party_phone": "555-555-1234",
"responsible_party_email": "jane.smith@example.com",
"responsible_party_address_line1": "123 Main St",
"responsible_party_address_line2": "Apt 4B",
"responsible_party_address_city": "Springfield",
"responsible_party_address_state": "IL",
"responsible_party_address_zip": "62701",
"insurance_name": "Aetna",
"insurance_subscriber_number": "ABC123"
}
| Value | EMR Code | Description |
|---|---|---|
self | 1 | Patient is the insured |
spouse | 2 | Patient is the spouse of the insured |
child | 3 | Natural Child — insured has financial responsibility |
adopted_child | 4 | Natural Child — insured does not have financial responsibility (includes legally adopted) |
step_child | 5 | Step Child |
foster_child | 6 | Foster Child |
ward_of_court | 7 | Ward of the Court |
employee | 8 | Employee |
unknown | 9 | Unknown / Other relationship |
handicapped_dependent | 10 | Handicapped Dependent |
organ_donor | 11 | Organ Donor |
cadaver_donor | 12 | Cadaver Donor |
grandchild | 13 | Grandchild |
niece_nephew | 14 | Niece/Nephew |
injured_plaintiff | 15 | Injured Plaintiff |
sponsored_dependent | 16 | Sponsored Dependent |
minor_dependent | 17 | Minor Dependent of a Minor Dependent |
parent | 18 | Parent |
grandparent | 19 | Grandparent |
life_partner | 53 | Life Partner |
other | 99 | Other |
| Field | Type | Description |
|---|---|---|
responsible_party_sex | string | male or female |
responsible_party_dob | string | Date of birth in YYYY-MM-DD format |
responsible_party_phone | string | Phone number in 222-333-4444 format |
responsible_party_email | string | Email address |
responsible_party_address_line1 | string | Street address line 1 |
responsible_party_address_line2 | string | Street address line 2 |
responsible_party_address_city | string | City |
responsible_party_address_state | string | Two-letter U.S. state abbreviation |
responsible_party_address_zip | string | 5-digit ZIP code |
responsible_party_first_name and responsible_party_last_name are required when using a non-self responsible party. The guarantor is created as a separate record in the EMR — if a guarantor with those demographics already exists in your instance, a duplicate will be created.Registration Fields
Additional demographic and consent fields can be set at patient creation:| Field | Type | Description |
|---|---|---|
language | string | Preferred language. Must match a valid language name in your EMR instance. |
race | string | Race. Must match a valid race name in your EMR instance. |
ethnicity | string | Ethnicity. Must match a valid ethnicity code or display name in your EMR instance. |
release_of_info | string | Consent for release of information. Accepts true/false (true maps to Y, false to N) or an EMR code: Y, M, N, I. Defaults to Y. |
rx_history_consent | string | Consent for pharmacy history sharing. Accepts true/false (true maps to Y, false to N) or an EMR code: Y, N, U. Defaults to Y. |
self_pay | boolean | Explicitly marks the patient as self-pay, overriding insurance-derived logic. |
default_facility_id | string | The EMR facility ID to set as the patient’s primary service location. |
voice_enabled | boolean | Enables voice (phone) notifications in the EMR patient communication settings. Defaults to off. |
text_enabled | boolean | Enables text (SMS) notifications in the EMR patient communication settings. Defaults to off. |
{
"language": "Spanish",
"race": "White",
"ethnicity": "Hispanic or Latino",
"release_of_info": true,
"rx_history_consent": false,
"default_facility_id": "25",
"voice_enabled": true,
"text_enabled": true
}
voice_enabled or text_enabled is set, the notification language in the EHR follows the patient’s language: Spanish when language contains “spanish” (case-insensitive), otherwise English. These are the only two options exposed for communication notifications.Insurance Options
When creating a patient, you can specify insurance using either the insurance name or an insurance provider ID: Option 1: Insurance Name (All EMRs){
"insurance_name": "United Healthcare"
}
insurance_provider_id from GET /v1/insurance-providers (UUID without dashes). This option:
- Automatically looks up the insurance name, address, city, and state
- Provides more accurate matching when there are duplicate insurance names
- Falls back to using provided insurance_name if the ID is not found
{
"insurance_provider_id": "e35e82b85df58f08a9b38e06a91e9f1a"
}
Example Request
Basic Request
curl -X POST https://api.usecobalt.com/v1/patients \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"last_name": "Smith",
"first_name": "John",
"phone": "5551234567",
"dob": "1980-01-01",
"sex": "male"
}'
With Provider Names
curl -X POST https://api.usecobalt.com/v1/patients \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"last_name": "Smith",
"first_name": "John",
"phone": "5551234567",
"dob": "1980-01-01",
"sex": "male",
"referring_provider_first_name": "Jane",
"referring_provider_last_name": "Doe",
"pcp_first_name": "Robert",
"pcp_last_name": "Johnson"
}'
With Provider IDs
curl -X POST https://api.usecobalt.com/v1/patients \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"last_name": "Smith",
"first_name": "John",
"phone": "5551234567",
"dob": "1980-01-01",
"sex": "male",
"referring_provider_id": "e35e82b85df58f08a9b38e06a91e9f1a",
"pcp_id": "223ecd1b29e546ca9db6b391eb49b213"
}'
Example Response
{
"success": true,
"message": "Patient processing. A webhook event will be sent upon completion.",
"patient_id": "9988776655443322",
"job_id": 12345
}
patient_id to correlate the follow-up webhook. job_id is the API log ID for the request and is also present on the resulting webhook, so you can match either identifier back to this call.
Webhook Notifications
When patient processing is complete, we will send a webhook to your registered endpoint. Here are examples of what those webhook payloads will look like:Success
{
"id": "evt_pat_succ_g7h8i9",
"access_token_reference_id": "user_pat_ref_k3l4m5",
"object": "event",
"created": "2023-10-29T12:00:00Z",
"type": "patient.created",
"job_id": "12345",
"action": "cobalt_operation",
"data": {
"patient_id": "9988776655443322",
"mrn": "123456",
"eligibility_information": [
{
"insurance_name": "Aetna",
"status": "Active"
}
] // returned when check_eligibility=true. Availability depends on EHR support.
}
}
Failure Examples
Thepatient.failed webhook event includes a failure_reason and may contain additional fields in the data object depending on the cause of the failure.
Duplicate Patient:
{
"id": "evt_pat_fail_dup_p2q3r4",
"access_token_reference_id": "user_pat_ref_k3l4m5",
"object": "event",
"created": "2023-10-29T12:05:00Z",
"type": "patient.failed",
"data": {
"patient_id": "9988776655443322",
"failure_reason": "Duplicate patient found. Please use the existing patient or update the patient information using the PATCH /v1/patients/:id endpoint.",
"existing_mrn": "654321"
}
}
{
"id": "evt_pat_fail_ref_s5t6u7",
"access_token_reference_id": "user_pat_ref_k3l4m5",
"object": "event",
"created": "2023-10-29T12:10:00Z",
"type": "patient.failed",
"data": {
"patient_id": "9988776655443323",
"failure_reason": "No valid referring provider found. Please update the referring provider using the PATCH /v1/patients/:id endpoint."
}
}
{
"id": "evt_pat_fail_pcp_y1z2a3",
"access_token_reference_id": "user_pat_ref_k3l4m5",
"object": "event",
"created": "2023-10-29T12:12:00Z",
"type": "patient.failed",
"data": {
"patient_id": "9988776655443325",
"failure_reason": "No valid PCP provider found. Please update the PCP provider using the PATCH /v1/patients/:id endpoint."
}
}
{
"id": "evt_pat_fail_ins_v8w9x0",
"access_token_reference_id": "user_pat_ref_k3l4m5",
"object": "event",
"created": "2023-10-29T12:15:00Z",
"type": "patient.failed",
"data": {
"patient_id": "9988776655443324",
"failure_reason": "No valid insurance found. Please update the insurance using the PATCH /v1/patients/:id endpoint."
}
}
Authorizations
Body
Patient first name.
"Jane"
Patient last name.
"Doe"
Date of birth (YYYY-MM-DD).
"1980-01-15"
Patient sex: male, female, or unknown.
"female"
Social Security Number, 9 digits, no dashes.
"123456789"
Primary phone (222-333-4444).
"555-123-4567"
Patient email.
"jane.doe@example.com"
Referring provider first name (provide with last name, or use referring_provider_id).
"Jane"
Referring provider last name.
"Doe"
Cobalt referring-provider UUID (from GET /v1/referring-providers).
Referring provider NPI.
"1234567890"
Primary care provider first name (provide with last name, or use pcp_id).
"Jane"
Primary care provider last name.
"Doe"
Cobalt UUID of the PCP (from GET /v1/referring-providers or GET /v1/providers).
Primary insurance company name (or use insurance_provider_id). Must match the EMR settings exactly.
"Blue Cross Anthem"
Cobalt insurance-provider UUID (from GET /v1/insurance-providers).
"insurance-provider-123"
Primary insurance subscriber / member number. Required when insurance is provided.
"INS123456789"
Insurance sequence: primary, secondary, or tertiary.
"primary"
Insurance policy type (e.g. PPO).
"PPO"
Insurance plan code. For Greenway, the payer identifier that signals insurance is being attached.
"PLAN-001"
Insurance group number.
"GRP98999"
Secondary insurance company name (provide with its subscriber number). Must match the EMR settings exactly.
"Blue Cross Anthem"
Secondary insurance subscriber / member number.
"INS123456789"
Emergency contact first name (all four emergency_contact_* fields must be provided together).
"Jane"
Emergency contact last name.
"Doe"
Emergency contact relationship to the patient.
"spouse"
Emergency contact phone (222-333-4444).
"555-123-4567"
EMR pharmacy ID.
"PHARM-123"
Cell phone (222-333-4444).
"555-987-6543"
Patient middle name.
"Anne"
Medical Record Number to assign the patient.
"12345"
URL of a document to attach to the patient.
"https://example.com/patient-doc.pdf"
Reason for the referral.
"Specialist consultation"
Referral type.
"Internal"
Referred-to provider EMR ID. Validated against the account's providers.
"provider-123"
Referred-to location EMR ID.
"location-1"
EMR facility ID.
"FAC-123"
EMR facility name.
"Main Hospital"
Street address line 1.
"123 Main Street"
Street address line 2.
"Apt 4B"
City.
"Los Angeles"
County.
"Los Angeles County"
Two-letter U.S. state abbreviation.
"CA"
5-digit U.S. ZIP code.
"90001"
Guarantor relationship to the patient. Allowed values vary by EMR (e.g. self, spouse, child, other).
"self"
Whether to run an eligibility check on creation.
true, false Guarantor first name (required when responsible_party is not self).
"Jane"
Guarantor last name.
"Doe"
Guarantor sex.
"female"
Guarantor date of birth (YYYY-MM-DD).
"1980-01-15"
Guarantor phone (222-333-4444).
"555-123-4567"
Guarantor email.
"jane.doe@example.com"
Guarantor street address line 1.
"123 Main Street"
Guarantor street address line 2.
"Apt 4B"
Guarantor city.
"Los Angeles"
Guarantor two-letter U.S. state abbreviation.
"CA"
Guarantor 5-digit U.S. ZIP code.
"90001"
EMR location ID. Validated against the account's locations.
"location-1"
Patient nationality.
"American"
Marital status.
"Married"
Billing group.
"Group A"
Reason the patient has no email, accepted in place of email.
"Patient declined"
Reason the patient has no SSN, accepted in place of ssn.
"Patient declined"
Preferred language.
"English"
Patient race.
"White"
Patient ethnicity.
"Not Hispanic or Latino"
Release-of-information consent. Accepts true/false (true maps to Y, false to N) or an eClinicalWorks code: Y (release allowed), M (modified/restricted), N (no release), I (ANSI 5010 informed consent).
true, false, Y, M, N, I Prescription-history consent. Accepts true/false (true maps to Y, false to N) or an eClinicalWorks code: Y (signed), N (denied), U (unasked).
true, false, Y, N, U Whether the patient is self-pay.
true, false Default facility EMR ID for the patient.
"FAC-123"
Whether voice notifications are enabled.
true, false Whether text notifications are enabled.
true, false URL(s) to receive the completion webhook for this patient, in addition to the account webhook.
["https://example.com/webhooks/cobalt"]