Add results to an order
curl --request POST \
--url https://api.usecobalt.com/v1/orders/{id}/results \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"results": [
{
"value": "<string>",
"component": "<string>",
"field_id": "<string>"
}
],
"result_date": "<string>",
"collected_date": "<string>",
"collection_time": "<string>",
"callback_urls": [
"<string>"
]
}
'import requests
url = "https://api.usecobalt.com/v1/orders/{id}/results"
payload = {
"results": [
{
"value": "<string>",
"component": "<string>",
"field_id": "<string>"
}
],
"result_date": "<string>",
"collected_date": "<string>",
"collection_time": "<string>",
"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({
results: [{value: '<string>', component: '<string>', field_id: '<string>'}],
result_date: '<string>',
collected_date: '<string>',
collection_time: '<string>',
callback_urls: ['<string>']
})
};
fetch('https://api.usecobalt.com/v1/orders/{id}/results', 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}/results",
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([
'results' => [
[
'value' => '<string>',
'component' => '<string>',
'field_id' => '<string>'
]
],
'result_date' => '<string>',
'collected_date' => '<string>',
'collection_time' => '<string>',
'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/orders/{id}/results"
payload := strings.NewReader("{\n \"results\": [\n {\n \"value\": \"<string>\",\n \"component\": \"<string>\",\n \"field_id\": \"<string>\"\n }\n ],\n \"result_date\": \"<string>\",\n \"collected_date\": \"<string>\",\n \"collection_time\": \"<string>\",\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/orders/{id}/results")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"results\": [\n {\n \"value\": \"<string>\",\n \"component\": \"<string>\",\n \"field_id\": \"<string>\"\n }\n ],\n \"result_date\": \"<string>\",\n \"collected_date\": \"<string>\",\n \"collection_time\": \"<string>\",\n \"callback_urls\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usecobalt.com/v1/orders/{id}/results")
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 \"results\": [\n {\n \"value\": \"<string>\",\n \"component\": \"<string>\",\n \"field_id\": \"<string>\"\n }\n ],\n \"result_date\": \"<string>\",\n \"collected_date\": \"<string>\",\n \"collection_time\": \"<string>\",\n \"callback_urls\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"lab_result_id": "<string>",
"order_id": "<string>",
"job_id": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}Orders
Create Order Results
Creates a lab-result record for an order and queues it for the EHR.
POST
/
orders
/
{id}
/
results
Add results to an order
curl --request POST \
--url https://api.usecobalt.com/v1/orders/{id}/results \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"results": [
{
"value": "<string>",
"component": "<string>",
"field_id": "<string>"
}
],
"result_date": "<string>",
"collected_date": "<string>",
"collection_time": "<string>",
"callback_urls": [
"<string>"
]
}
'import requests
url = "https://api.usecobalt.com/v1/orders/{id}/results"
payload = {
"results": [
{
"value": "<string>",
"component": "<string>",
"field_id": "<string>"
}
],
"result_date": "<string>",
"collected_date": "<string>",
"collection_time": "<string>",
"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({
results: [{value: '<string>', component: '<string>', field_id: '<string>'}],
result_date: '<string>',
collected_date: '<string>',
collection_time: '<string>',
callback_urls: ['<string>']
})
};
fetch('https://api.usecobalt.com/v1/orders/{id}/results', 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}/results",
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([
'results' => [
[
'value' => '<string>',
'component' => '<string>',
'field_id' => '<string>'
]
],
'result_date' => '<string>',
'collected_date' => '<string>',
'collection_time' => '<string>',
'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/orders/{id}/results"
payload := strings.NewReader("{\n \"results\": [\n {\n \"value\": \"<string>\",\n \"component\": \"<string>\",\n \"field_id\": \"<string>\"\n }\n ],\n \"result_date\": \"<string>\",\n \"collected_date\": \"<string>\",\n \"collection_time\": \"<string>\",\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/orders/{id}/results")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"results\": [\n {\n \"value\": \"<string>\",\n \"component\": \"<string>\",\n \"field_id\": \"<string>\"\n }\n ],\n \"result_date\": \"<string>\",\n \"collected_date\": \"<string>\",\n \"collection_time\": \"<string>\",\n \"callback_urls\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usecobalt.com/v1/orders/{id}/results")
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 \"results\": [\n {\n \"value\": \"<string>\",\n \"component\": \"<string>\",\n \"field_id\": \"<string>\"\n }\n ],\n \"result_date\": \"<string>\",\n \"collected_date\": \"<string>\",\n \"collection_time\": \"<string>\",\n \"callback_urls\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"lab_result_id": "<string>",
"order_id": "<string>",
"job_id": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}Creating results is asynchronous: a valid request creates a lab-result record, returns immediately with the
lab_result_id, and queues the record for the EHR. A lab_result.created webhook is sent when processing completes. If the operation fails terminally, a lab_result.create_failed webhook is sent instead.
Each result targets a component of the order. Reference a component by its component (name) or field_id, both of which come from the result_components returned by Get Order.
Creating order results is only supported for eClinicalWorks.
Request Parameters
Required Fields
-
results (array, required): Result values, one per component. At least one entry is required. Each entry is an object with:
- value (string or number, required): The result value.
- component (string): The component name, from
GET /v1/orders/{id}. - field_id (string): The component’s EMR id, from
GET /v1/orders/{id}.
componentorfield_idto identify each component.
Optional Fields
- result_date (string, optional): Result date (ISO 8601, YYYY-MM-DD). Defaults to today when omitted.
- collected_date (string, optional): Specimen collection date (ISO 8601, YYYY-MM-DD).
- collection_time (string, optional): Specimen collection time, e.g.
"12:58 PM". - callback_urls (string[], optional): URLs to receive the
lab_result.createdwebhook, in addition to the account webhook.
Example Request
curl -X POST https://api.usecobalt.com/v1/orders/ord_123456/results \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"results": [
{ "component": "1hr Glucose (OB)", "value": 142 },
{ "field_id": "col_1002", "value": "88" }
],
"result_date": "2026-03-17",
"collected_date": "2026-03-16",
"collection_time": "09:15 AM"
}'
Example Response
{
"success": true,
"message": "Lab result created and queued. A lab_result.created webhook will be sent when it completes.",
"lab_result_id": "lr_123456",
"order_id": "ord_123456",
"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": "lab_result.created",
"job_id": "12345",
"data": {
"lab_result_id": "lr_123456",
"order_id": "ord_123456",
"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": "lab_result.create_failed",
"job_id": "12345",
"data": {
"lab_result_id": "lr_123456",
"order_id": "ord_123456",
"patient_mrn": "12345",
"failure_reason": "Lab result creation failed after multiple attempts. Please try again later or contact support."
}
}
Authorizations
Path Parameters
Cobalt order ID.
Body
application/json
Result values, one per component. Reference a component by component (its name, from GET /v1/orders/:id) or field_id.
Minimum array length:
1Show child attributes
Show child attributes
Result date (ISO 8601, YYYY-MM-DD). Defaults to today when omitted.
Specimen collection date (ISO 8601, YYYY-MM-DD).
Specimen collection time, e.g. "12:58 PM".
URLs to receive the lab_result.created webhook, in addition to the account webhook.