Fetch claims
curl --request POST \
--url https://api.usecobalt.com/v1/claims/fetch \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"service_date": "2026-03-15",
"claim_ids": [
"16382",
"16383"
],
"callback_urls": [
"https://example.com/webhooks/cobalt"
],
"expires_at": "2027-06-15T14:30:00Z"
}
'import requests
url = "https://api.usecobalt.com/v1/claims/fetch"
payload = {
"service_date": "2026-03-15",
"claim_ids": ["16382", "16383"],
"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({
service_date: '2026-03-15',
claim_ids: ['16382', '16383'],
callback_urls: ['https://example.com/webhooks/cobalt'],
expires_at: '2027-06-15T14:30:00Z'
})
};
fetch('https://api.usecobalt.com/v1/claims/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/claims/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([
'service_date' => '2026-03-15',
'claim_ids' => [
'16382',
'16383'
],
'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/claims/fetch"
payload := strings.NewReader("{\n \"service_date\": \"2026-03-15\",\n \"claim_ids\": [\n \"16382\",\n \"16383\"\n ],\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/claims/fetch")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"service_date\": \"2026-03-15\",\n \"claim_ids\": [\n \"16382\",\n \"16383\"\n ],\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/claims/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 \"service_date\": \"2026-03-15\",\n \"claim_ids\": [\n \"16382\",\n \"16383\"\n ],\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": "Claims fetch accepted",
"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"
}Claims
Fetch Claims
Refresh claims live from the EMR, for one service date or a list of claim numbers.
POST
/
claims
/
fetch
Fetch claims
curl --request POST \
--url https://api.usecobalt.com/v1/claims/fetch \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"service_date": "2026-03-15",
"claim_ids": [
"16382",
"16383"
],
"callback_urls": [
"https://example.com/webhooks/cobalt"
],
"expires_at": "2027-06-15T14:30:00Z"
}
'import requests
url = "https://api.usecobalt.com/v1/claims/fetch"
payload = {
"service_date": "2026-03-15",
"claim_ids": ["16382", "16383"],
"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({
service_date: '2026-03-15',
claim_ids: ['16382', '16383'],
callback_urls: ['https://example.com/webhooks/cobalt'],
expires_at: '2027-06-15T14:30:00Z'
})
};
fetch('https://api.usecobalt.com/v1/claims/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/claims/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([
'service_date' => '2026-03-15',
'claim_ids' => [
'16382',
'16383'
],
'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/claims/fetch"
payload := strings.NewReader("{\n \"service_date\": \"2026-03-15\",\n \"claim_ids\": [\n \"16382\",\n \"16383\"\n ],\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/claims/fetch")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"service_date\": \"2026-03-15\",\n \"claim_ids\": [\n \"16382\",\n \"16383\"\n ],\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/claims/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 \"service_date\": \"2026-03-15\",\n \"claim_ids\": [\n \"16382\",\n \"16383\"\n ],\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": "Claims fetch accepted",
"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"
}Queues an on-demand fetch of claims from the EMR. Use it to refresh claims that the
regular sync no longer pulls, such as older claims that are still open or claims that
were entered long after the date of service. This is asynchronous: the endpoint
returns a
job_id, Cobalt fetches the claims and stores them, then sends a
claim.live_fetch_completed webhook. The refreshed claims are also returned by
GET /claims.
Send exactly one of:
service_date: one date of service (YYYY-MM-DD). Every claim with that date is fetched.claim_ids: 1-25 EMR claim numbers (theemr_claim_idof a claim).
Flow
POST /claims/fetchreturns202and ajob_id.- Cobalt fetches each claim from the EMR and stores it.
claim.createdandclaim.updatedwebhooks are sent as usual. - A
claim.live_fetch_completedwebhook is sent with the fetched claims.
Example Request
curl -X POST "https://api.usecobalt.com/v1/claims/fetch" \
-H "client_id: your_client_id" \
-H "client_secret: your_client_secret" \
-H "access_token: your_access_token" \
-H "Content-Type: application/json" \
-d '{"claim_ids": ["16382", "16383"]}'
Webhook
data.claims has one entry per fetched claim, with change set to created,
updated or unchanged. not_found_claim_ids lists requested claim numbers the
EMR did not return.
{
"id": "evt_1J9X2q2eZvKYlo2Cmnopqr",
"job_id": "job_1J9X2q2eZvKYlo2Cmnopqr",
"object": "event",
"created": "2026-10-20T22:54:50Z",
"type": "claim.live_fetch_completed",
"data": {
"success": true,
"claim_ids": ["16382", "16383"],
"claims": [
{
"id": "a1b2c3d4e5f6789012345678abcdef90",
"emr_claim_id": "16382",
"service_date": "2026-05-02",
"claim_status": "PD",
"claim_status_description": "Paid",
"total_charge": "161.00",
"balance": "0.00",
"change": "updated"
}
],
"not_found_claim_ids": ["16383"]
}
}
Failures and Partial Results
Cobalt retries transient failures automatically. Intermediate failed attempts do not sendclaim.live_fetch_completed. A terminal or exhausted failure sends
success: false, the existing error message, and
reasons: [{ code, description }] when a shared code is known.
A successful fetch can include issues[] with code: "EHR_RATE_LIMITED" when
rate limiting prevented claim details or related billing data from being fetched.
Returned claims are still stored and produce the usual claim change webhooks,
but their data may be incomplete. not_found_claim_ids continues to identify
claims not returned by the search; it does not identify failed enrichment.
For EHR_RATE_LIMITED, try again later. If it happens frequently, add credential
sets to the account to spread requests across more EHR sessions.
Status Codes
- 202: Fetch accepted; results are delivered via webhook and stored claims are returned by
GET /claims. - 400: Neither or both of
service_dateandclaim_ids, an invalidservice_date, invalid or more than 25claim_ids, or the connected EMR is not supported.
Authorizations
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"