Remove Diagnosis Codes
curl --request DELETE \
--url https://api.usecobalt.com/v1/appointments/{appointment_id}/codes \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"codes": [
{
"type": "icd10",
"code": "<string>"
}
],
"callback_urls": [
"<string>"
]
}
'import requests
url = "https://api.usecobalt.com/v1/appointments/{appointment_id}/codes"
payload = {
"codes": [
{
"type": "icd10",
"code": "<string>"
}
],
"callback_urls": ["<string>"]
}
headers = {
"client_id": "<api-key>",
"client_secret": "<api-key>",
"access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {
client_id: '<api-key>',
client_secret: '<api-key>',
access_token: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({codes: [{type: 'icd10', code: '<string>'}], callback_urls: ['<string>']})
};
fetch('https://api.usecobalt.com/v1/appointments/{appointment_id}/codes', 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/appointments/{appointment_id}/codes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'codes' => [
[
'type' => 'icd10',
'code' => '<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/appointments/{appointment_id}/codes"
payload := strings.NewReader("{\n \"codes\": [\n {\n \"type\": \"icd10\",\n \"code\": \"<string>\"\n }\n ],\n \"callback_urls\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("DELETE", 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.delete("https://api.usecobalt.com/v1/appointments/{appointment_id}/codes")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"codes\": [\n {\n \"type\": \"icd10\",\n \"code\": \"<string>\"\n }\n ],\n \"callback_urls\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usecobalt.com/v1/appointments/{appointment_id}/codes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.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 \"codes\": [\n {\n \"type\": \"icd10\",\n \"code\": \"<string>\"\n }\n ],\n \"callback_urls\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"job_id": "<string>"
}Codes
Remove Diagnosis Codes
Removes ICD-10 diagnosis codes from an existing appointment’s encounter.
DELETE
/
appointments
/
{appointment_id}
/
codes
Remove Diagnosis Codes
curl --request DELETE \
--url https://api.usecobalt.com/v1/appointments/{appointment_id}/codes \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"codes": [
{
"type": "icd10",
"code": "<string>"
}
],
"callback_urls": [
"<string>"
]
}
'import requests
url = "https://api.usecobalt.com/v1/appointments/{appointment_id}/codes"
payload = {
"codes": [
{
"type": "icd10",
"code": "<string>"
}
],
"callback_urls": ["<string>"]
}
headers = {
"client_id": "<api-key>",
"client_secret": "<api-key>",
"access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {
client_id: '<api-key>',
client_secret: '<api-key>',
access_token: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({codes: [{type: 'icd10', code: '<string>'}], callback_urls: ['<string>']})
};
fetch('https://api.usecobalt.com/v1/appointments/{appointment_id}/codes', 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/appointments/{appointment_id}/codes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'codes' => [
[
'type' => 'icd10',
'code' => '<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/appointments/{appointment_id}/codes"
payload := strings.NewReader("{\n \"codes\": [\n {\n \"type\": \"icd10\",\n \"code\": \"<string>\"\n }\n ],\n \"callback_urls\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("DELETE", 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.delete("https://api.usecobalt.com/v1/appointments/{appointment_id}/codes")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"codes\": [\n {\n \"type\": \"icd10\",\n \"code\": \"<string>\"\n }\n ],\n \"callback_urls\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usecobalt.com/v1/appointments/{appointment_id}/codes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.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 \"codes\": [\n {\n \"type\": \"icd10\",\n \"code\": \"<string>\"\n }\n ],\n \"callback_urls\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"job_id": "<string>"
}This is an asynchronous operation. The request returns a
job_id immediately, and a webhook is sent when the operation completes. Codes that are not on the encounter are ignored. Currently available on eClinicalWorks.{ "type": "icd10", "code": "..." }, and you can remove one or many in a single request.
Example Request
curl -X DELETE https://api.usecobalt.com/v1/appointments/APPT-12345/codes \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"codes": [
{ "type": "icd10", "code": "I10" }
]
}'
Example Response
{
"success": true,
"message": "Codes operation in progress. A webhook event will be sent upon completion.",
"job_id": "12346"
}
Webhook
On completion we send acodes.removed event (or codes.failed on error). notFound lists codes that were not on the encounter.
{
"id": "evt_1J9X2q2eZvKYlo2CluR9g9gW",
"access_token_reference_id": "user_1J9X2q2eZvKYlo2Cxyz",
"object": "event",
"created": "2025-10-09T10:35:00Z",
"type": "codes.removed",
"job_id": "12346",
"data": {
"appointment_id": "APPT-12345",
"operation": "remove",
"icd": {
"removed": ["I10"],
"notFound": []
}
}
}
Authorizations
Path Parameters
The Cobalt appointment ID.
Body
application/json
⌘I