Update an encounter
curl --request PATCH \
--url https://api.usecobalt.com/v1/encounters/{id} \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"approved": true,
"callback_urls": [
"<string>"
]
}
'import requests
url = "https://api.usecobalt.com/v1/encounters/{id}"
payload = {
"approved": True,
"callback_urls": ["<string>"]
}
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({approved: true, callback_urls: ['<string>']})
};
fetch('https://api.usecobalt.com/v1/encounters/{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/encounters/{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([
'approved' => true,
'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/encounters/{id}"
payload := strings.NewReader("{\n \"approved\": true,\n \"callback_urls\": [\n \"<string>\"\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/encounters/{id}")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"approved\": true,\n \"callback_urls\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usecobalt.com/v1/encounters/{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 \"approved\": true,\n \"callback_urls\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"encounter_id": "<string>",
"job_id": 123
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}Encounters
Update Encounter
Approves an existing encounter in the provider’s EMR system.
PATCH
/
encounters
/
{id}
Update an encounter
curl --request PATCH \
--url https://api.usecobalt.com/v1/encounters/{id} \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"approved": true,
"callback_urls": [
"<string>"
]
}
'import requests
url = "https://api.usecobalt.com/v1/encounters/{id}"
payload = {
"approved": True,
"callback_urls": ["<string>"]
}
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({approved: true, callback_urls: ['<string>']})
};
fetch('https://api.usecobalt.com/v1/encounters/{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/encounters/{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([
'approved' => true,
'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/encounters/{id}"
payload := strings.NewReader("{\n \"approved\": true,\n \"callback_urls\": [\n \"<string>\"\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/encounters/{id}")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"approved\": true,\n \"callback_urls\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usecobalt.com/v1/encounters/{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 \"approved\": true,\n \"callback_urls\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"encounter_id": "<string>",
"job_id": 123
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}Some EMR configurations approve an encounter automatically when it is signed; others leave it unapproved. The
The webhook data includes:
A failed update is not retried automatically; send the request again once the cause is fixed. Common
encounter.created webhook tells you which: when approved is false, call this endpoint to approve the encounter.
Updates are processed asynchronously. We return a success response as soon as the request is accepted, then send a webhook when the update has been applied in the EMR.
Path Parameters
- id (string, required): The Cobalt
encounter_idreturned when the encounter was created.
Request Parameters
Required Fields
- approved (boolean, required): Must be
true. Approves the encounter. Unapproving is not supported. If the encounter was already approved in the EMR before your request (for example, approved by a user in the EMR), nothing is changed and theencounter.updatedwebhook hasalready_approved: true.
Optional Fields
- callback_urls (array of strings, optional): URLs to receive the completion webhook for this update, in addition to your account webhook.
Example Request
curl -X PATCH https://api.usecobalt.com/v1/encounters/123e4567e89b12d3a456426614174000 \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"approved": true
}'
Example Response
{
"success": true,
"message": "Encounter update processing. A webhook event will be sent upon completion.",
"encounter_id": "123e4567e89b12d3a456426614174000",
"job_id": 12346
}
Error Responses
Missing Approved
{
"success": false,
"message": "Missing required field: approved (must be true)."
}
Encounter Not Found
{
"success": false,
"message": "Encounter with id '123e4567e89b12d3a456426614174000' not found."
}
Encounter Not Created Yet
{
"success": false,
"message": "Encounter has not been created in the EMR yet. Wait for the encounter.created webhook before updating it."
}
Update Already In Progress
{
"success": false,
"message": "An update is already in progress for this encounter. Please wait for it to complete before submitting another update."
}
Unsupported EMR
{
"success": false,
"message": "Updating encounters is not supported for [EMR Name]."
}
Webhook Notifications
Success
{
"id": "<id-of-webhook-response>",
"access_token_reference_id": "<access-token-reference-id>",
"object": "event",
"created": "2026-10-06T10:30:00.000Z",
"type": "encounter.updated",
"job_id": "12346",
"data": {
"encounter_id": "123e4567e89b12d3a456426614174000",
"emr_encounter_id": "927341",
"emr_status": "COMPLETED",
"approved": true,
"already_approved": false,
"patient_mrn": "1234567"
}
}
- encounter_id: The Cobalt encounter ID.
- emr_encounter_id: The encounter id in the EMR.
- emr_status: The encounter status in the EMR.
- approved:
trueonce the encounter is approved. - already_approved:
trueif the encounter was already approved in the EMR before your request, so nothing was changed.falseif this request approved it. - patient_mrn: The patient’s medical record number.
Failure
{
"id": "<id-of-webhook-response>",
"access_token_reference_id": "<access-token-reference-id>",
"object": "event",
"created": "2026-10-06T10:35:00.000Z",
"type": "encounter.update_failed",
"job_id": "12346",
"data": {
"encounter_id": "123e4567e89b12d3a456426614174000",
"emr_encounter_id": "927341",
"patient_mrn": "1234567",
"failure_reason": "Service 927341 cannot be approved by this account (no Approve button on the visit view)."
}
}
failure_reason values:
Service <id> cannot be approved by this account (no Approve button on the visit view).— the connected EMR user does not have rights to approve this encounter.Approve did not persist for service <id> ...— the EMR did not record the approval. Retry the request.
Authorizations
Path Parameters
Cobalt encounter ID (UUID, with or without dashes).
Body
application/json