curl --request PATCH \
--url https://api.usecobalt.com/v1/patients/{id} \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"phone": "555-123-4567",
"cell_phone": "555-987-6543",
"email": "jane.doe@example.com",
"address_street": "123 Main Street",
"address_line2": "Apt 4B",
"address_city": "Los Angeles",
"address_state": "CA",
"address_zip": "90001",
"referring_provider_first_name": "Jane",
"referring_provider_last_name": "Doe",
"referring_provider_id": "c3d4e5f6a1b2478899aabbccddeeff00",
"pcp_first_name": "Jane",
"pcp_last_name": "Doe",
"pcp_id": "b2c3d4e5f6a1478899aabbccddeeff00",
"referred_to_provider_id": "provider-123",
"language": "English",
"race": "White",
"ethnicity": "Not Hispanic or Latino",
"voice_enabled": "true",
"text_enabled": "true",
"billing_notes": "Balance due at next visit.",
"pharmacy_id": "PHARM-123",
"self_pay": "false",
"first_name": "Jane",
"last_name": "Doe",
"dob": "1980-01-15",
"team": "TestClinic",
"save_previous_address": "true",
"callback_urls": [
"https://example.com/webhooks/cobalt"
],
"expires_at": "2027-06-15T14:30:00Z"
}
'import requests
url = "https://api.usecobalt.com/v1/patients/{id}"
payload = {
"phone": "555-123-4567",
"cell_phone": "555-987-6543",
"email": "jane.doe@example.com",
"address_street": "123 Main Street",
"address_line2": "Apt 4B",
"address_city": "Los Angeles",
"address_state": "CA",
"address_zip": "90001",
"referring_provider_first_name": "Jane",
"referring_provider_last_name": "Doe",
"referring_provider_id": "c3d4e5f6a1b2478899aabbccddeeff00",
"pcp_first_name": "Jane",
"pcp_last_name": "Doe",
"pcp_id": "b2c3d4e5f6a1478899aabbccddeeff00",
"referred_to_provider_id": "provider-123",
"language": "English",
"race": "White",
"ethnicity": "Not Hispanic or Latino",
"voice_enabled": "true",
"text_enabled": "true",
"billing_notes": "Balance due at next visit.",
"pharmacy_id": "PHARM-123",
"self_pay": "false",
"first_name": "Jane",
"last_name": "Doe",
"dob": "1980-01-15",
"team": "TestClinic",
"save_previous_address": "true",
"callback_urls": ["https://example.com/webhooks/cobalt"],
"expires_at": "2027-06-15T14:30:00Z"
}
headers = {
"client_id": "<api-key>",
"client_secret": "<api-key>",
"access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
client_id: '<api-key>',
client_secret: '<api-key>',
access_token: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
phone: '555-123-4567',
cell_phone: '555-987-6543',
email: 'jane.doe@example.com',
address_street: '123 Main Street',
address_line2: 'Apt 4B',
address_city: 'Los Angeles',
address_state: 'CA',
address_zip: '90001',
referring_provider_first_name: 'Jane',
referring_provider_last_name: 'Doe',
referring_provider_id: 'c3d4e5f6a1b2478899aabbccddeeff00',
pcp_first_name: 'Jane',
pcp_last_name: 'Doe',
pcp_id: 'b2c3d4e5f6a1478899aabbccddeeff00',
referred_to_provider_id: 'provider-123',
language: 'English',
race: 'White',
ethnicity: 'Not Hispanic or Latino',
voice_enabled: 'true',
text_enabled: 'true',
billing_notes: 'Balance due at next visit.',
pharmacy_id: 'PHARM-123',
self_pay: 'false',
first_name: 'Jane',
last_name: 'Doe',
dob: '1980-01-15',
team: 'TestClinic',
save_previous_address: 'true',
callback_urls: ['https://example.com/webhooks/cobalt'],
expires_at: '2027-06-15T14:30:00Z'
})
};
fetch('https://api.usecobalt.com/v1/patients/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usecobalt.com/v1/patients/{id}",
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([
'phone' => '555-123-4567',
'cell_phone' => '555-987-6543',
'email' => 'jane.doe@example.com',
'address_street' => '123 Main Street',
'address_line2' => 'Apt 4B',
'address_city' => 'Los Angeles',
'address_state' => 'CA',
'address_zip' => '90001',
'referring_provider_first_name' => 'Jane',
'referring_provider_last_name' => 'Doe',
'referring_provider_id' => 'c3d4e5f6a1b2478899aabbccddeeff00',
'pcp_first_name' => 'Jane',
'pcp_last_name' => 'Doe',
'pcp_id' => 'b2c3d4e5f6a1478899aabbccddeeff00',
'referred_to_provider_id' => 'provider-123',
'language' => 'English',
'race' => 'White',
'ethnicity' => 'Not Hispanic or Latino',
'voice_enabled' => 'true',
'text_enabled' => 'true',
'billing_notes' => 'Balance due at next visit.',
'pharmacy_id' => 'PHARM-123',
'self_pay' => 'false',
'first_name' => 'Jane',
'last_name' => 'Doe',
'dob' => '1980-01-15',
'team' => 'TestClinic',
'save_previous_address' => 'true',
'callback_urls' => [
'https://example.com/webhooks/cobalt'
],
'expires_at' => '2027-06-15T14:30:00Z'
]),
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/{id}"
payload := strings.NewReader("{\n \"phone\": \"555-123-4567\",\n \"cell_phone\": \"555-987-6543\",\n \"email\": \"jane.doe@example.com\",\n \"address_street\": \"123 Main Street\",\n \"address_line2\": \"Apt 4B\",\n \"address_city\": \"Los Angeles\",\n \"address_state\": \"CA\",\n \"address_zip\": \"90001\",\n \"referring_provider_first_name\": \"Jane\",\n \"referring_provider_last_name\": \"Doe\",\n \"referring_provider_id\": \"c3d4e5f6a1b2478899aabbccddeeff00\",\n \"pcp_first_name\": \"Jane\",\n \"pcp_last_name\": \"Doe\",\n \"pcp_id\": \"b2c3d4e5f6a1478899aabbccddeeff00\",\n \"referred_to_provider_id\": \"provider-123\",\n \"language\": \"English\",\n \"race\": \"White\",\n \"ethnicity\": \"Not Hispanic or Latino\",\n \"voice_enabled\": \"true\",\n \"text_enabled\": \"true\",\n \"billing_notes\": \"Balance due at next visit.\",\n \"pharmacy_id\": \"PHARM-123\",\n \"self_pay\": \"false\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"dob\": \"1980-01-15\",\n \"team\": \"TestClinic\",\n \"save_previous_address\": \"true\",\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ],\n \"expires_at\": \"2027-06-15T14:30:00Z\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.usecobalt.com/v1/patients/{id}")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"555-123-4567\",\n \"cell_phone\": \"555-987-6543\",\n \"email\": \"jane.doe@example.com\",\n \"address_street\": \"123 Main Street\",\n \"address_line2\": \"Apt 4B\",\n \"address_city\": \"Los Angeles\",\n \"address_state\": \"CA\",\n \"address_zip\": \"90001\",\n \"referring_provider_first_name\": \"Jane\",\n \"referring_provider_last_name\": \"Doe\",\n \"referring_provider_id\": \"c3d4e5f6a1b2478899aabbccddeeff00\",\n \"pcp_first_name\": \"Jane\",\n \"pcp_last_name\": \"Doe\",\n \"pcp_id\": \"b2c3d4e5f6a1478899aabbccddeeff00\",\n \"referred_to_provider_id\": \"provider-123\",\n \"language\": \"English\",\n \"race\": \"White\",\n \"ethnicity\": \"Not Hispanic or Latino\",\n \"voice_enabled\": \"true\",\n \"text_enabled\": \"true\",\n \"billing_notes\": \"Balance due at next visit.\",\n \"pharmacy_id\": \"PHARM-123\",\n \"self_pay\": \"false\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"dob\": \"1980-01-15\",\n \"team\": \"TestClinic\",\n \"save_previous_address\": \"true\",\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ],\n \"expires_at\": \"2027-06-15T14:30:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usecobalt.com/v1/patients/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.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 \"phone\": \"555-123-4567\",\n \"cell_phone\": \"555-987-6543\",\n \"email\": \"jane.doe@example.com\",\n \"address_street\": \"123 Main Street\",\n \"address_line2\": \"Apt 4B\",\n \"address_city\": \"Los Angeles\",\n \"address_state\": \"CA\",\n \"address_zip\": \"90001\",\n \"referring_provider_first_name\": \"Jane\",\n \"referring_provider_last_name\": \"Doe\",\n \"referring_provider_id\": \"c3d4e5f6a1b2478899aabbccddeeff00\",\n \"pcp_first_name\": \"Jane\",\n \"pcp_last_name\": \"Doe\",\n \"pcp_id\": \"b2c3d4e5f6a1478899aabbccddeeff00\",\n \"referred_to_provider_id\": \"provider-123\",\n \"language\": \"English\",\n \"race\": \"White\",\n \"ethnicity\": \"Not Hispanic or Latino\",\n \"voice_enabled\": \"true\",\n \"text_enabled\": \"true\",\n \"billing_notes\": \"Balance due at next visit.\",\n \"pharmacy_id\": \"PHARM-123\",\n \"self_pay\": \"false\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"dob\": \"1980-01-15\",\n \"team\": \"TestClinic\",\n \"save_previous_address\": \"true\",\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ],\n \"expires_at\": \"2027-06-15T14:30:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Patient update queued",
"patient_id": "a1b2c3d4e5f6478899aabbccddeeff00",
"job_id": 12345
}{
"success": false,
"message": "Bad request — missing or invalid parameters"
}{
"success": false,
"message": "Unauthorized — missing or invalid credentials"
}{
"success": false,
"message": "Resource not found"
}{
"success": false,
"message": "A patient update is already in progress",
"patient_id": null
}{
"success": false,
"message": "Internal server error"
}Update Patient
Updates an existing patient. The update process differs based on the current status of the patient.
curl --request PATCH \
--url https://api.usecobalt.com/v1/patients/{id} \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"phone": "555-123-4567",
"cell_phone": "555-987-6543",
"email": "jane.doe@example.com",
"address_street": "123 Main Street",
"address_line2": "Apt 4B",
"address_city": "Los Angeles",
"address_state": "CA",
"address_zip": "90001",
"referring_provider_first_name": "Jane",
"referring_provider_last_name": "Doe",
"referring_provider_id": "c3d4e5f6a1b2478899aabbccddeeff00",
"pcp_first_name": "Jane",
"pcp_last_name": "Doe",
"pcp_id": "b2c3d4e5f6a1478899aabbccddeeff00",
"referred_to_provider_id": "provider-123",
"language": "English",
"race": "White",
"ethnicity": "Not Hispanic or Latino",
"voice_enabled": "true",
"text_enabled": "true",
"billing_notes": "Balance due at next visit.",
"pharmacy_id": "PHARM-123",
"self_pay": "false",
"first_name": "Jane",
"last_name": "Doe",
"dob": "1980-01-15",
"team": "TestClinic",
"save_previous_address": "true",
"callback_urls": [
"https://example.com/webhooks/cobalt"
],
"expires_at": "2027-06-15T14:30:00Z"
}
'import requests
url = "https://api.usecobalt.com/v1/patients/{id}"
payload = {
"phone": "555-123-4567",
"cell_phone": "555-987-6543",
"email": "jane.doe@example.com",
"address_street": "123 Main Street",
"address_line2": "Apt 4B",
"address_city": "Los Angeles",
"address_state": "CA",
"address_zip": "90001",
"referring_provider_first_name": "Jane",
"referring_provider_last_name": "Doe",
"referring_provider_id": "c3d4e5f6a1b2478899aabbccddeeff00",
"pcp_first_name": "Jane",
"pcp_last_name": "Doe",
"pcp_id": "b2c3d4e5f6a1478899aabbccddeeff00",
"referred_to_provider_id": "provider-123",
"language": "English",
"race": "White",
"ethnicity": "Not Hispanic or Latino",
"voice_enabled": "true",
"text_enabled": "true",
"billing_notes": "Balance due at next visit.",
"pharmacy_id": "PHARM-123",
"self_pay": "false",
"first_name": "Jane",
"last_name": "Doe",
"dob": "1980-01-15",
"team": "TestClinic",
"save_previous_address": "true",
"callback_urls": ["https://example.com/webhooks/cobalt"],
"expires_at": "2027-06-15T14:30:00Z"
}
headers = {
"client_id": "<api-key>",
"client_secret": "<api-key>",
"access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
client_id: '<api-key>',
client_secret: '<api-key>',
access_token: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
phone: '555-123-4567',
cell_phone: '555-987-6543',
email: 'jane.doe@example.com',
address_street: '123 Main Street',
address_line2: 'Apt 4B',
address_city: 'Los Angeles',
address_state: 'CA',
address_zip: '90001',
referring_provider_first_name: 'Jane',
referring_provider_last_name: 'Doe',
referring_provider_id: 'c3d4e5f6a1b2478899aabbccddeeff00',
pcp_first_name: 'Jane',
pcp_last_name: 'Doe',
pcp_id: 'b2c3d4e5f6a1478899aabbccddeeff00',
referred_to_provider_id: 'provider-123',
language: 'English',
race: 'White',
ethnicity: 'Not Hispanic or Latino',
voice_enabled: 'true',
text_enabled: 'true',
billing_notes: 'Balance due at next visit.',
pharmacy_id: 'PHARM-123',
self_pay: 'false',
first_name: 'Jane',
last_name: 'Doe',
dob: '1980-01-15',
team: 'TestClinic',
save_previous_address: 'true',
callback_urls: ['https://example.com/webhooks/cobalt'],
expires_at: '2027-06-15T14:30:00Z'
})
};
fetch('https://api.usecobalt.com/v1/patients/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usecobalt.com/v1/patients/{id}",
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([
'phone' => '555-123-4567',
'cell_phone' => '555-987-6543',
'email' => 'jane.doe@example.com',
'address_street' => '123 Main Street',
'address_line2' => 'Apt 4B',
'address_city' => 'Los Angeles',
'address_state' => 'CA',
'address_zip' => '90001',
'referring_provider_first_name' => 'Jane',
'referring_provider_last_name' => 'Doe',
'referring_provider_id' => 'c3d4e5f6a1b2478899aabbccddeeff00',
'pcp_first_name' => 'Jane',
'pcp_last_name' => 'Doe',
'pcp_id' => 'b2c3d4e5f6a1478899aabbccddeeff00',
'referred_to_provider_id' => 'provider-123',
'language' => 'English',
'race' => 'White',
'ethnicity' => 'Not Hispanic or Latino',
'voice_enabled' => 'true',
'text_enabled' => 'true',
'billing_notes' => 'Balance due at next visit.',
'pharmacy_id' => 'PHARM-123',
'self_pay' => 'false',
'first_name' => 'Jane',
'last_name' => 'Doe',
'dob' => '1980-01-15',
'team' => 'TestClinic',
'save_previous_address' => 'true',
'callback_urls' => [
'https://example.com/webhooks/cobalt'
],
'expires_at' => '2027-06-15T14:30:00Z'
]),
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/{id}"
payload := strings.NewReader("{\n \"phone\": \"555-123-4567\",\n \"cell_phone\": \"555-987-6543\",\n \"email\": \"jane.doe@example.com\",\n \"address_street\": \"123 Main Street\",\n \"address_line2\": \"Apt 4B\",\n \"address_city\": \"Los Angeles\",\n \"address_state\": \"CA\",\n \"address_zip\": \"90001\",\n \"referring_provider_first_name\": \"Jane\",\n \"referring_provider_last_name\": \"Doe\",\n \"referring_provider_id\": \"c3d4e5f6a1b2478899aabbccddeeff00\",\n \"pcp_first_name\": \"Jane\",\n \"pcp_last_name\": \"Doe\",\n \"pcp_id\": \"b2c3d4e5f6a1478899aabbccddeeff00\",\n \"referred_to_provider_id\": \"provider-123\",\n \"language\": \"English\",\n \"race\": \"White\",\n \"ethnicity\": \"Not Hispanic or Latino\",\n \"voice_enabled\": \"true\",\n \"text_enabled\": \"true\",\n \"billing_notes\": \"Balance due at next visit.\",\n \"pharmacy_id\": \"PHARM-123\",\n \"self_pay\": \"false\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"dob\": \"1980-01-15\",\n \"team\": \"TestClinic\",\n \"save_previous_address\": \"true\",\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ],\n \"expires_at\": \"2027-06-15T14:30:00Z\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.usecobalt.com/v1/patients/{id}")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"555-123-4567\",\n \"cell_phone\": \"555-987-6543\",\n \"email\": \"jane.doe@example.com\",\n \"address_street\": \"123 Main Street\",\n \"address_line2\": \"Apt 4B\",\n \"address_city\": \"Los Angeles\",\n \"address_state\": \"CA\",\n \"address_zip\": \"90001\",\n \"referring_provider_first_name\": \"Jane\",\n \"referring_provider_last_name\": \"Doe\",\n \"referring_provider_id\": \"c3d4e5f6a1b2478899aabbccddeeff00\",\n \"pcp_first_name\": \"Jane\",\n \"pcp_last_name\": \"Doe\",\n \"pcp_id\": \"b2c3d4e5f6a1478899aabbccddeeff00\",\n \"referred_to_provider_id\": \"provider-123\",\n \"language\": \"English\",\n \"race\": \"White\",\n \"ethnicity\": \"Not Hispanic or Latino\",\n \"voice_enabled\": \"true\",\n \"text_enabled\": \"true\",\n \"billing_notes\": \"Balance due at next visit.\",\n \"pharmacy_id\": \"PHARM-123\",\n \"self_pay\": \"false\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"dob\": \"1980-01-15\",\n \"team\": \"TestClinic\",\n \"save_previous_address\": \"true\",\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ],\n \"expires_at\": \"2027-06-15T14:30:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usecobalt.com/v1/patients/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.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 \"phone\": \"555-123-4567\",\n \"cell_phone\": \"555-987-6543\",\n \"email\": \"jane.doe@example.com\",\n \"address_street\": \"123 Main Street\",\n \"address_line2\": \"Apt 4B\",\n \"address_city\": \"Los Angeles\",\n \"address_state\": \"CA\",\n \"address_zip\": \"90001\",\n \"referring_provider_first_name\": \"Jane\",\n \"referring_provider_last_name\": \"Doe\",\n \"referring_provider_id\": \"c3d4e5f6a1b2478899aabbccddeeff00\",\n \"pcp_first_name\": \"Jane\",\n \"pcp_last_name\": \"Doe\",\n \"pcp_id\": \"b2c3d4e5f6a1478899aabbccddeeff00\",\n \"referred_to_provider_id\": \"provider-123\",\n \"language\": \"English\",\n \"race\": \"White\",\n \"ethnicity\": \"Not Hispanic or Latino\",\n \"voice_enabled\": \"true\",\n \"text_enabled\": \"true\",\n \"billing_notes\": \"Balance due at next visit.\",\n \"pharmacy_id\": \"PHARM-123\",\n \"self_pay\": \"false\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Doe\",\n \"dob\": \"1980-01-15\",\n \"team\": \"TestClinic\",\n \"save_previous_address\": \"true\",\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ],\n \"expires_at\": \"2027-06-15T14:30:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Patient update queued",
"patient_id": "a1b2c3d4e5f6478899aabbccddeeff00",
"job_id": 12345
}{
"success": false,
"message": "Bad request — missing or invalid parameters"
}{
"success": false,
"message": "Unauthorized — missing or invalid credentials"
}{
"success": false,
"message": "Resource not found"
}{
"success": false,
"message": "A patient update is already in progress",
"patient_id": null
}{
"success": false,
"message": "Internal server error"
}id in the URL path. The {id} parameter should be the Cobalt patient ID returned from API responses or GET endpoints, not the MRN or EHR ID.1. Updating Pending or Failed Patients
For patients with a status of ‘pending’ or ‘failed’, the patient does not yet exist in the EHR. You can update any attribute, and the new values will be used the next time the patient creation runs.| Parameter | Type | Required | Description |
|---|---|---|---|
| Any patient attribute | varies | No | Any attribute of the patient can be updated. All fields are optional. |
retry | string | No | Failed patients only. When "true", re-runs the create under the same patient ID even if no other field changes. Without it, a PATCH with values unchanged from the failed attempt returns 409. |
2. Updating Active Patients
For patients with a status of ‘active’ (already created in the EHR), you can update the patient’s contact information, address, and provider assignments. The change is queued and applied to the EHR asynchronously; the patient’s status will move to ‘pending_update’ while the update is in flight and back to ‘active’ once the EHR write completes.Contact & Address Fields
| Parameter | Type | Required | Description |
|---|---|---|---|
phone | string | No | Home phone, formatted as 222-333-4444. |
cell_phone | string | No | Cell phone, formatted as 222-333-4444. |
email | string | No | Patient email address. |
address_street | string | No | Street address line 1. |
address_line2 | string | No | Address line 2 (apartment, suite, unit, etc.). |
address_city | string | No | City. |
address_state | string | No | Two-letter state code (e.g. CA). DC is accepted. |
address_zip | string | No | ZIP code. Accepts 5-digit (12345) or ZIP+4 (12345-6789) formats. |
save_previous_address | boolean | No | When true (default), the patient’s current address is saved as address history in the EHR before the new address is applied. Set to false to overwrite without preserving history. |
Provider Fields
| Parameter | Type | Required | Description |
|---|---|---|---|
referring_provider_first_name | string | No | Referring provider’s first name. Must be used with referring_provider_last_name. |
referring_provider_last_name | string | No | Referring provider’s last name. Must be used with referring_provider_first_name. |
referring_provider_id | string | No | Cobalt referring provider UUID (from GET /v1/referring-providers). Looks up the provider’s name and contact info for more accurate matching. |
pcp_first_name | string | No | PCP’s first name. Must be used with pcp_last_name. |
pcp_last_name | string | No | PCP’s last name. Must be used with pcp_first_name. |
pcp_id | string | No | Cobalt referring provider UUID (from GET /v1/referring-providers). Looks up the provider’s name and contact info for more accurate matching. |
referred_to_provider_id | string | No | Rendering provider EHR ID — use the ehr_id value from GET /v1/providers (not the id). |
Demographics & Contact Preference Fields
| Parameter | Type | Required | Description |
|---|---|---|---|
language | string | No | Patient preferred language. Must match a valid language name in your EHR instance. |
race | string | No | Patient race. Must match a valid race name in your EHR instance. |
ethnicity | string | No | Patient ethnicity. Must match a valid ethnicity code or display name in your EHR instance. |
voice_enabled | boolean | No | Enables or disables voice (phone) notifications in the EHR patient communication settings. |
text_enabled | boolean | No | Enables or disables text (SMS) notifications in the EHR patient communication settings. |
billing_notes | string | No | The patient’s billing alert notes (free text). The value you send replaces the current notes verbatim; the same field is returned as billing_notes by POST /v1/patients/fetch. |
pharmacy_id | string | No | The patient’s primary pharmacy, as the EMR pharmacy ID (the ehr_id from GET /v1/pharmacies). Adds the pharmacy as the primary, keeping any existing pharmacies and demoting the prior primary. |
self_pay | boolean | No | Marks the patient as self-pay. Accepts true or false. A provider-only update never changes this flag. |
billing_notes via patient fetch, transform it (for example, rewrite referral: ...; to scheduledreferral: ...;), then PATCH it back.voice_enabled or text_enabled is set, the notification language in the EHR follows the patient’s language (using the new value if language is included in the same request, otherwise the patient’s current language): Spanish when language contains “spanish” (case-insensitive), otherwise English. These are the only two options exposed for communication notifications.failed_fields array on the patient.updated webhook, along with a human-readable message. If no fields could be applied, the request fails and a patient.update_failed webhook is sent instead. Use referring_provider_id or pcp_id instead of names when possible, as ID-based resolution is more reliable.Example Request for Updating a Pending/Failed Patient
curl -X PATCH https://api.usecobalt.com/v1/patients/65ed04f9d25fca3876f367d9ad94e3c3 \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"phone": "555-987-6543",
"insurance_name": "Aetna",
"insurance_subscriber_number": "ABC987654321"
}'
Example Request for Updating an Active Patient’s Contact Info
curl -X PATCH https://api.usecobalt.com/v1/patients/65ed04f9d25fca3876f367d9ad94e3c3 \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"phone": "555-987-6543",
"cell_phone": "555-987-6544",
"email": "patient@example.com"
}'
Example Request for Updating an Active Patient’s Address
curl -X PATCH https://api.usecobalt.com/v1/patients/65ed04f9d25fca3876f367d9ad94e3c3 \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"address_street": "456 New St",
"address_line2": "Apt 7",
"address_city": "Austin",
"address_state": "TX",
"address_zip": "78701"
}'
save_previous_address: false:
curl -X PATCH https://api.usecobalt.com/v1/patients/65ed04f9d25fca3876f367d9ad94e3c3 \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"address_street": "456 New St",
"address_city": "Austin",
"address_state": "TX",
"address_zip": "78701",
"save_previous_address": false
}'
Example Request for Updating an Active Patient’s Providers
curl -X PATCH https://api.usecobalt.com/v1/patients/65ed04f9d25fca3876f367d9ad94e3c3 \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"referring_provider_id": "e35e82b85df58f08a9b38e06a91e9f1a",
"pcp_id": "223ecd1b29e546ca9db6b391eb49b213",
"referred_to_provider_id": "82749"
}'
curl -X PATCH https://api.usecobalt.com/v1/patients/65ed04f9d25fca3876f367d9ad94e3c3 \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"referring_provider_first_name": "Jane",
"referring_provider_last_name": "Doe",
"pcp_first_name": "Robert",
"pcp_last_name": "Johnson"
}'
Example Request for Updating an Active Patient’s Demographics & Contact Preferences
curl -X PATCH https://api.usecobalt.com/v1/patients/65ed04f9d25fca3876f367d9ad94e3c3 \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"first_name": "Jane",
"last_name": "Doe",
"dob": "1980-01-15",
"language": "Spanish",
"race": "White",
"ethnicity": "Hispanic or Latino",
"voice_enabled": true,
"text_enabled": true
}'
Example Request for Marking a Patient as Self-Pay
curl -X PATCH https://api.usecobalt.com/v1/patients/65ed04f9d25fca3876f367d9ad94e3c3 \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"self_pay": true
}'
Example Response
{
"success": true,
"message": "Patient update queued.",
"patient_id": "65ed04f9d25fca3876f367d9ad94e3c3",
"job_id": 12345
}
job_id is the API log ID for the request and is also present on the resulting patient.updated webhook, so you can match either identifier back to this call.
Authorizations
Path Parameters
Cobalt patient ID (UUID, with or without dashes).
"a1b2c3d4e5f6478899aabbccddeeff00"
Body
Primary phone (222-333-4444).
"555-123-4567"
Cell phone (222-333-4444).
"555-987-6543"
Patient email.
"jane.doe@example.com"
Street address line 1.
"123 Main Street"
Street address line 2.
"Apt 4B"
City.
"Los Angeles"
Two-letter U.S. state abbreviation.
"CA"
5-digit U.S. ZIP code.
"90001"
Referring provider first name.
"Jane"
Referring provider last name.
"Doe"
Cobalt referring-provider UUID (from GET /v1/referring-providers).
"c3d4e5f6a1b2478899aabbccddeeff00"
Primary care provider first name.
"Jane"
Primary care provider last name.
"Doe"
Cobalt UUID of the PCP (from GET /v1/referring-providers or GET /v1/providers).
"b2c3d4e5f6a1478899aabbccddeeff00"
Referred-to provider EMR ID.
"provider-123"
Preferred language.
"English"
Patient race.
"White"
Patient ethnicity.
"Not Hispanic or Latino"
Whether voice notifications are enabled.
true, false "true"
Whether text notifications are enabled.
true, false "true"
Patient billing alert notes (free text).
"Balance due at next visit."
EMR pharmacy ID (the ehr_id from GET /v1/pharmacies). Sets the patient's primary pharmacy, keeping any existing pharmacies and demoting the prior primary.
"PHARM-123"
Whether the patient is self-pay.
true, false "false"
Patient first name.
"Jane"
Patient last name.
"Doe"
Date of birth (YYYY-MM-DD).
"1980-01-15"
Team name (or numeric team id) to assign the client to. Assigning a team creates an episode for the client when one does not already exist.
"TestClinic"
Whether to keep the prior address on file when the address changes.
true, false "true"
URL(s) to receive the completion webhook for this update.
["https://example.com/webhooks/cobalt"]
Optional ISO 8601 timestamp with an explicit timezone offset, in the future when submitted. Cobalt starts no new operation attempt after this deadline and reports reasons[].code EXPIRED. An attempt already in progress, including write reconciliation, may finish after it.
"2027-06-15T14:30:00Z"