Fetch Org Settings
curl --request POST \
--url https://api.usecobalt.com/v1/org-settings/fetch \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"callback_urls": [
"<string>"
]
}
'import requests
url = "https://api.usecobalt.com/v1/org-settings/fetch"
payload = { "callback_urls": ["<string>"] }
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({callback_urls: ['<string>']})
};
fetch('https://api.usecobalt.com/v1/org-settings/fetch', 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/org-settings/fetch",
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([
'callback_urls' => [
'<string>'
]
]),
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/org-settings/fetch"
payload := strings.NewReader("{\n \"callback_urls\": [\n \"<string>\"\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/org-settings/fetch")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"callback_urls\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usecobalt.com/v1/org-settings/fetch")
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 \"callback_urls\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status": "queued",
"message": "Org settings sync started. An org_settings.synced webhook will be sent when it completes.",
"job_execution_id": "<string>"
}{
"success": false,
"message": "callback_urls must contain only non-empty https URL strings."
}{
"success": false,
"status": "running",
"message": "An org settings sync is already in progress for this account. Please try again once it completes.",
"job_execution_id": "<string>"
}Org Settings
Fetch Org Settings
Queues a live sync of your organization’s settings from the connected EMR system.
POST
/
org-settings
/
fetch
Fetch Org Settings
curl --request POST \
--url https://api.usecobalt.com/v1/org-settings/fetch \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"callback_urls": [
"<string>"
]
}
'import requests
url = "https://api.usecobalt.com/v1/org-settings/fetch"
payload = { "callback_urls": ["<string>"] }
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({callback_urls: ['<string>']})
};
fetch('https://api.usecobalt.com/v1/org-settings/fetch', 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/org-settings/fetch",
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([
'callback_urls' => [
'<string>'
]
]),
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/org-settings/fetch"
payload := strings.NewReader("{\n \"callback_urls\": [\n \"<string>\"\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/org-settings/fetch")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"callback_urls\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usecobalt.com/v1/org-settings/fetch")
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 \"callback_urls\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status": "queued",
"message": "Org settings sync started. An org_settings.synced webhook will be sent when it completes.",
"job_execution_id": "<string>"
}{
"success": false,
"message": "callback_urls must contain only non-empty https URL strings."
}{
"success": false,
"status": "running",
"message": "An org settings sync is already in progress for this account. Please try again once it completes.",
"job_execution_id": "<string>"
}Cobalt automatically syncs org settings nightly for every organization. You
do not need to call this endpoint on a schedule — the nightly sync already
keeps providers, locations, visit types, and the rest of your org settings up to
date. Use this endpoint sparingly, only when you need a refresh sooner than the
next nightly run (for example, right after adding a new provider or location in
your EMR and wanting it reflected immediately).
This is an asynchronous operation. It returns immediately with a
job_execution_id and delivers an org_settings.synced webhook when the sync
finishes. To read the synced values, use the corresponding read endpoints such as
Get Providers,
Get Locations,
Get Visit Types,
Get Visit Statuses, and
Get Settings.What Gets Synced
A single sync refreshes the full set of organization settings from the EMR:- Providers
- Locations
- Visit types
- Visit statuses
- Insurance companies
- Pharmacies
- Referring providers
- Timezone
- Required patient fields
Concurrency
Only one org settings sync can be in flight per linked account at a time. If a sync is already running when you call this endpoint, the request returns409 with the
job_execution_id of the in-flight sync so you can wait for it to finish rather
than queuing a duplicate.
Example Request
curl -X POST https://api.usecobalt.com/v1/org-settings/fetch \
-H "Content-Type: application/json" \
-H "client_id: your_client_id" \
-H "client_secret: your_client_secret" \
-H "access_token: your_access_token" \
-d '{}'
Routing the completion webhook
The completion webhook is delivered to your account’s registered webhook URLs by default. To route this specific sync’sorg_settings.synced event elsewhere,
include a callback_urls array (see Webhook setup). Each
URL must use HTTPS.
curl -X POST https://api.usecobalt.com/v1/org-settings/fetch \
-H "Content-Type: application/json" \
-H "client_id: your_client_id" \
-H "client_secret: your_client_secret" \
-H "access_token: your_access_token" \
-d '{
"callback_urls": ["https://your-domain.com/cobalt-webhook"]
}'
Example Response
{
"success": true,
"status": "queued",
"message": "Org settings sync started. An org_settings.synced webhook will be sent when it completes.",
"job_execution_id": "job_1J9X2q2eZvKYlo2Cmnopqr"
}
Webhook Notification
When the sync completes, Cobalt sends anorg_settings.synced webhook to your
registered endpoint (or to callback_urls if you supplied them). The payload is
intentionally minimal — it signals completion and reports counts of what changed.
Re-fetch the synced values from the read endpoints listed above.
{
"id": "508c368e7de13b40f9397eec966d0329",
"access_token_reference_id": "your-reference-id",
"object": "event",
"job_id": "job_1J9X2q2eZvKYlo2Cmnopqr",
"created": "2026-07-22T08:50:42.491-07:00",
"type": "org_settings.synced",
"action": "ehr_sync",
"data": {
"status": "completed",
"summary": {
"providers_created": 1,
"providers_updated": 3,
"locations_created": 0,
"locations_updated": 2,
"visit_types_created": 0,
"visit_types_updated": 5,
"visit_statuses_created": 0,
"visit_statuses_updated": 0,
"insurance_companies_created": 0,
"pharmacies_created": 0,
"pharmacies_updated": 0,
"referring_providers_created": 0,
"referring_providers_updated": 1,
"policy_types_count": 12,
"staff_list_count": 24,
"required_patient_fields_synced": true,
"timezone_synced": true,
"link_org_updated": true
}
}
}
You must be subscribed to the
org_settings.synced event for the webhook to be
delivered. See Webhook setup to manage your
subscriptions.Authorizations
Body
application/json
Optional. One or more HTTPS URLs to receive the org_settings.synced completion webhook for this request instead of your account's registered webhook URLs. Accepts a single string or an array of strings. Each URL must use HTTPS.