Add a global alert
curl --request POST \
--url https://api.usecobalt.com/v1/patients/{patient_id}/global-alerts \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"template_id": "7",
"notes": "Shoes arrived 11/18, pick up by 12/18",
"expiry_date": "2026-12-31",
"callback_urls": [
"https://example.com/webhooks/cobalt"
],
"expires_at": "2027-06-15T14:30:00Z"
}
'import requests
url = "https://api.usecobalt.com/v1/patients/{patient_id}/global-alerts"
payload = {
"template_id": "7",
"notes": "Shoes arrived 11/18, pick up by 12/18",
"expiry_date": "2026-12-31",
"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.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({
template_id: '7',
notes: 'Shoes arrived 11/18, pick up by 12/18',
expiry_date: '2026-12-31',
callback_urls: ['https://example.com/webhooks/cobalt'],
expires_at: '2027-06-15T14:30:00Z'
})
};
fetch('https://api.usecobalt.com/v1/patients/{patient_id}/global-alerts', 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/{patient_id}/global-alerts",
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([
'template_id' => '7',
'notes' => 'Shoes arrived 11/18, pick up by 12/18',
'expiry_date' => '2026-12-31',
'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/{patient_id}/global-alerts"
payload := strings.NewReader("{\n \"template_id\": \"7\",\n \"notes\": \"Shoes arrived 11/18, pick up by 12/18\",\n \"expiry_date\": \"2026-12-31\",\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ],\n \"expires_at\": \"2027-06-15T14:30:00Z\"\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/{patient_id}/global-alerts")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"template_id\": \"7\",\n \"notes\": \"Shoes arrived 11/18, pick up by 12/18\",\n \"expiry_date\": \"2026-12-31\",\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/{patient_id}/global-alerts")
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 \"template_id\": \"7\",\n \"notes\": \"Shoes arrived 11/18, pick up by 12/18\",\n \"expiry_date\": \"2026-12-31\",\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": "Global alert processing. A webhook event will be sent upon completion.",
"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": "Internal server error"
}Global Alerts
Add Global Alert
Adds a global alert from one of the practice’s templates to a patient chart.
POST
/
patients
/
{patient_id}
/
global-alerts
Add a global alert
curl --request POST \
--url https://api.usecobalt.com/v1/patients/{patient_id}/global-alerts \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"template_id": "7",
"notes": "Shoes arrived 11/18, pick up by 12/18",
"expiry_date": "2026-12-31",
"callback_urls": [
"https://example.com/webhooks/cobalt"
],
"expires_at": "2027-06-15T14:30:00Z"
}
'import requests
url = "https://api.usecobalt.com/v1/patients/{patient_id}/global-alerts"
payload = {
"template_id": "7",
"notes": "Shoes arrived 11/18, pick up by 12/18",
"expiry_date": "2026-12-31",
"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.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({
template_id: '7',
notes: 'Shoes arrived 11/18, pick up by 12/18',
expiry_date: '2026-12-31',
callback_urls: ['https://example.com/webhooks/cobalt'],
expires_at: '2027-06-15T14:30:00Z'
})
};
fetch('https://api.usecobalt.com/v1/patients/{patient_id}/global-alerts', 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/{patient_id}/global-alerts",
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([
'template_id' => '7',
'notes' => 'Shoes arrived 11/18, pick up by 12/18',
'expiry_date' => '2026-12-31',
'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/{patient_id}/global-alerts"
payload := strings.NewReader("{\n \"template_id\": \"7\",\n \"notes\": \"Shoes arrived 11/18, pick up by 12/18\",\n \"expiry_date\": \"2026-12-31\",\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ],\n \"expires_at\": \"2027-06-15T14:30:00Z\"\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/{patient_id}/global-alerts")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"template_id\": \"7\",\n \"notes\": \"Shoes arrived 11/18, pick up by 12/18\",\n \"expiry_date\": \"2026-12-31\",\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/{patient_id}/global-alerts")
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 \"template_id\": \"7\",\n \"notes\": \"Shoes arrived 11/18, pick up by 12/18\",\n \"expiry_date\": \"2026-12-31\",\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": "Global alert processing. A webhook event will be sent upon completion.",
"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": "Internal server error"
}patient_id is the patient’s id or MRN. Pick template_id from global_alert_templates on GET /settings. The chart’s alerts, each with its emr_alert_id, are returned in alerts.global_alerts on POST /patients/fetch.
Example Request
curl -X POST https://api.usecobalt.com/v1/patients/81792/global-alerts \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"template_id": "7",
"notes": "Shoes arrived 11/18, pick up by 12/18",
"expiry_date": "2026-12-18"
}'
Example Response
{
"success": true,
"message": "Global alert processing. A webhook event will be sent upon completion.",
"job_id": 12345
}
Webhook Events
You’ll receiveglobal_alert.created when the alert is on the chart, or global_alert.create_failed. See Operation Events.
{
"id": "evt_abc123",
"object": "event",
"type": "global_alert.created",
"created": "2026-11-19T22:05:00.000Z",
"job_id": "12345",
"access_token_reference_id": "user_123",
"data": {
"patient_mrn": "81792",
"emr_alert_id": "141004",
"template_id": "7",
"name": "SHOES/INSERTS IN @141",
"notes": "Shoes arrived 11/18, pick up by 12/18",
"expiry_date": "2026-12-18"
}
}
Authorizations
Path Parameters
Body
application/json
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.
Example:
"2027-06-15T14:30:00Z"