Update an order
curl --request PATCH \
--url https://api.usecobalt.com/v1/orders/{id} \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"result_date": "2026-03-15",
"collected_date": "2026-03-15",
"collection_time": "9:30 AM",
"performed_date": "2026-03-15",
"assigned_to_id": "STAFF-123",
"high_priority": false,
"callback_urls": [
"https://example.com/webhooks/cobalt"
]
}
'import requests
url = "https://api.usecobalt.com/v1/orders/{id}"
payload = {
"result_date": "2026-03-15",
"collected_date": "2026-03-15",
"collection_time": "9:30 AM",
"performed_date": "2026-03-15",
"assigned_to_id": "STAFF-123",
"high_priority": False,
"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.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({
result_date: '2026-03-15',
collected_date: '2026-03-15',
collection_time: '9:30 AM',
performed_date: '2026-03-15',
assigned_to_id: 'STAFF-123',
high_priority: false,
callback_urls: ['https://example.com/webhooks/cobalt']
})
};
fetch('https://api.usecobalt.com/v1/orders/{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/orders/{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([
'result_date' => '2026-03-15',
'collected_date' => '2026-03-15',
'collection_time' => '9:30 AM',
'performed_date' => '2026-03-15',
'assigned_to_id' => 'STAFF-123',
'high_priority' => false,
'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/orders/{id}"
payload := strings.NewReader("{\n \"result_date\": \"2026-03-15\",\n \"collected_date\": \"2026-03-15\",\n \"collection_time\": \"9:30 AM\",\n \"performed_date\": \"2026-03-15\",\n \"assigned_to_id\": \"STAFF-123\",\n \"high_priority\": false,\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ]\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/orders/{id}")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"result_date\": \"2026-03-15\",\n \"collected_date\": \"2026-03-15\",\n \"collection_time\": \"9:30 AM\",\n \"performed_date\": \"2026-03-15\",\n \"assigned_to_id\": \"STAFF-123\",\n \"high_priority\": false,\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usecobalt.com/v1/orders/{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 \"result_date\": \"2026-03-15\",\n \"collected_date\": \"2026-03-15\",\n \"collection_time\": \"9:30 AM\",\n \"performed_date\": \"2026-03-15\",\n \"assigned_to_id\": \"STAFF-123\",\n \"high_priority\": false,\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Order queued for delivery to the EMR",
"order_id": "b2c3d4e5f6a1478899aabbccddeeff00",
"job_id": 12345
}{
"success": false,
"message": "Bad request — missing or invalid parameters"
}{
"success": false,
"message": "Unauthorized — missing or invalid credentials"
}{
"success": false,
"message": "Internal server error"
}Orders
Update Order
Updates an existing order’s dates, assignee, or priority.
PATCH
/
orders
/
{id}
Update an order
curl --request PATCH \
--url https://api.usecobalt.com/v1/orders/{id} \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"result_date": "2026-03-15",
"collected_date": "2026-03-15",
"collection_time": "9:30 AM",
"performed_date": "2026-03-15",
"assigned_to_id": "STAFF-123",
"high_priority": false,
"callback_urls": [
"https://example.com/webhooks/cobalt"
]
}
'import requests
url = "https://api.usecobalt.com/v1/orders/{id}"
payload = {
"result_date": "2026-03-15",
"collected_date": "2026-03-15",
"collection_time": "9:30 AM",
"performed_date": "2026-03-15",
"assigned_to_id": "STAFF-123",
"high_priority": False,
"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.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({
result_date: '2026-03-15',
collected_date: '2026-03-15',
collection_time: '9:30 AM',
performed_date: '2026-03-15',
assigned_to_id: 'STAFF-123',
high_priority: false,
callback_urls: ['https://example.com/webhooks/cobalt']
})
};
fetch('https://api.usecobalt.com/v1/orders/{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/orders/{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([
'result_date' => '2026-03-15',
'collected_date' => '2026-03-15',
'collection_time' => '9:30 AM',
'performed_date' => '2026-03-15',
'assigned_to_id' => 'STAFF-123',
'high_priority' => false,
'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/orders/{id}"
payload := strings.NewReader("{\n \"result_date\": \"2026-03-15\",\n \"collected_date\": \"2026-03-15\",\n \"collection_time\": \"9:30 AM\",\n \"performed_date\": \"2026-03-15\",\n \"assigned_to_id\": \"STAFF-123\",\n \"high_priority\": false,\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ]\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/orders/{id}")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"result_date\": \"2026-03-15\",\n \"collected_date\": \"2026-03-15\",\n \"collection_time\": \"9:30 AM\",\n \"performed_date\": \"2026-03-15\",\n \"assigned_to_id\": \"STAFF-123\",\n \"high_priority\": false,\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usecobalt.com/v1/orders/{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 \"result_date\": \"2026-03-15\",\n \"collected_date\": \"2026-03-15\",\n \"collection_time\": \"9:30 AM\",\n \"performed_date\": \"2026-03-15\",\n \"assigned_to_id\": \"STAFF-123\",\n \"high_priority\": false,\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Order queued for delivery to the EMR",
"order_id": "b2c3d4e5f6a1478899aabbccddeeff00",
"job_id": 12345
}{
"success": false,
"message": "Bad request — missing or invalid parameters"
}{
"success": false,
"message": "Unauthorized — missing or invalid credentials"
}{
"success": false,
"message": "Internal server error"
}Order updates are processed asynchronously: a valid request returns immediately with a
202, and an order.updated webhook is sent when processing completes. If the update fails terminally, an order.update_failed webhook is sent instead.
Request Parameters
All fields are optional; send only the fields you want to change.- result_date (string, optional): Result date (ISO 8601, YYYY-MM-DD).
- collected_date (string, optional): Specimen collection date (ISO 8601, YYYY-MM-DD).
- collection_time (string, optional): Specimen collection time, e.g.
"12:58 PM". - performed_date (string, optional): Performed date (ISO 8601, YYYY-MM-DD). Diagnostic imaging.
- assigned_to_id (string, optional): EMR staff id to assign the order to.
- high_priority (boolean, optional): Flag the order high priority.
- callback_urls (string[], optional): URLs to receive the
order.updatedwebhook, in addition to the account webhook.
Example Request
curl -X PATCH https://api.usecobalt.com/v1/orders/ord_123456 \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"collected_date": "2026-03-16",
"collection_time": "09:15 AM",
"assigned_to_id": "staff_101",
"high_priority": true
}'
Example Response
{
"success": true,
"status": "queued",
"message": "Order update queued. An order.updated webhook will be sent when it completes.",
"job_id": 12345
}
Webhook Notifications
When processing completes, we send a webhook to your registered endpoint.Success
{
"id": "evt_1J9X2q2eZvKYlo2CluR9g9gV",
"access_token_reference_id": "user_1J9X2q2eZvKYlo2Cxyz",
"object": "event",
"created": "2025-10-09T10:30:00Z",
"type": "order.updated",
"job_id": "12345",
"data": {
"emr_order_id": "998877",
"emr_encounter_id": "445566",
"patient_mrn": "12345"
}
}
Failure
{
"id": "evt_1J9X2q2eZvKYlo2CluR9g9gW",
"access_token_reference_id": "user_1J9X2q2eZvKYlo2Cxyz",
"object": "event",
"created": "2025-10-09T10:35:00Z",
"type": "order.update_failed",
"job_id": "12345",
"data": {
"patient_mrn": "12345",
"failure_reason": "Order update failed after multiple attempts. Please try again later or contact support."
}
}
Authorizations
Path Parameters
Cobalt order ID.
Example:
"b2c3d4e5f6a1478899aabbccddeeff00"
Body
application/json
Result date (ISO 8601, YYYY-MM-DD).
Example:
"2026-03-15"
Specimen collection date (ISO 8601, YYYY-MM-DD).
Example:
"2026-03-15"
Specimen collection time, e.g. "12:58 PM".
Example:
"9:30 AM"
Performed date (ISO 8601, YYYY-MM-DD). Diagnostic imaging.
Example:
"2026-03-15"
EMR staff id to assign the order to (an ehr_id from GET /v1/staff).
Example:
"STAFF-123"
Flag the order high priority.
Example:
false
URLs to receive the order.updated webhook, in addition to the account webhook.
Example:
["https://example.com/webhooks/cobalt"]