Add an action to a telephone encounter
curl --request POST \
--url https://api.usecobalt.com/v1/telephone-encounters/actions \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"text": "Called patient; left a message about their results.",
"appointment_id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"emr_appointment_id": "appt-emr-789",
"is_high_priority": "false",
"callback_urls": [
"https://example.com/webhooks/cobalt"
]
}
'import requests
url = "https://api.usecobalt.com/v1/telephone-encounters/actions"
payload = {
"text": "Called patient; left a message about their results.",
"appointment_id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"emr_appointment_id": "appt-emr-789",
"is_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.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({
text: 'Called patient; left a message about their results.',
appointment_id: 'a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4',
emr_appointment_id: 'appt-emr-789',
is_high_priority: 'false',
callback_urls: ['https://example.com/webhooks/cobalt']
})
};
fetch('https://api.usecobalt.com/v1/telephone-encounters/actions', 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/telephone-encounters/actions",
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([
'text' => 'Called patient; left a message about their results.',
'appointment_id' => 'a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4',
'emr_appointment_id' => 'appt-emr-789',
'is_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/telephone-encounters/actions"
payload := strings.NewReader("{\n \"text\": \"Called patient; left a message about their results.\",\n \"appointment_id\": \"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4\",\n \"emr_appointment_id\": \"appt-emr-789\",\n \"is_high_priority\": \"false\",\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\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/telephone-encounters/actions")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Called patient; left a message about their results.\",\n \"appointment_id\": \"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4\",\n \"emr_appointment_id\": \"appt-emr-789\",\n \"is_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/telephone-encounters/actions")
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 \"text\": \"Called patient; left a message about their results.\",\n \"appointment_id\": \"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4\",\n \"emr_appointment_id\": \"appt-emr-789\",\n \"is_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": "<string>",
"action_id": "<string>",
"job_id": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}Telephone Encounters
Add Action to Telephone Encounter
Adds a timestamped action log to an existing telephone encounter in the provider’s EMR system.
POST
/
telephone-encounters
/
actions
Add an action to a telephone encounter
curl --request POST \
--url https://api.usecobalt.com/v1/telephone-encounters/actions \
--header 'Content-Type: application/json' \
--header 'access_token: <api-key>' \
--header 'client_id: <api-key>' \
--header 'client_secret: <api-key>' \
--data '
{
"text": "Called patient; left a message about their results.",
"appointment_id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"emr_appointment_id": "appt-emr-789",
"is_high_priority": "false",
"callback_urls": [
"https://example.com/webhooks/cobalt"
]
}
'import requests
url = "https://api.usecobalt.com/v1/telephone-encounters/actions"
payload = {
"text": "Called patient; left a message about their results.",
"appointment_id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"emr_appointment_id": "appt-emr-789",
"is_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.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({
text: 'Called patient; left a message about their results.',
appointment_id: 'a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4',
emr_appointment_id: 'appt-emr-789',
is_high_priority: 'false',
callback_urls: ['https://example.com/webhooks/cobalt']
})
};
fetch('https://api.usecobalt.com/v1/telephone-encounters/actions', 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/telephone-encounters/actions",
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([
'text' => 'Called patient; left a message about their results.',
'appointment_id' => 'a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4',
'emr_appointment_id' => 'appt-emr-789',
'is_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/telephone-encounters/actions"
payload := strings.NewReader("{\n \"text\": \"Called patient; left a message about their results.\",\n \"appointment_id\": \"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4\",\n \"emr_appointment_id\": \"appt-emr-789\",\n \"is_high_priority\": \"false\",\n \"callback_urls\": [\n \"https://example.com/webhooks/cobalt\"\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/telephone-encounters/actions")
.header("client_id", "<api-key>")
.header("client_secret", "<api-key>")
.header("access_token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Called patient; left a message about their results.\",\n \"appointment_id\": \"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4\",\n \"emr_appointment_id\": \"appt-emr-789\",\n \"is_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/telephone-encounters/actions")
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 \"text\": \"Called patient; left a message about their results.\",\n \"appointment_id\": \"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4\",\n \"emr_appointment_id\": \"appt-emr-789\",\n \"is_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": "<string>",
"action_id": "<string>",
"job_id": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}{
"success": false,
"message": "<string>"
}Request Parameters
Required Fields
-
appointment_id (string, required): The identifier of the telephone encounter to add the action to. This is not the “Ref #” shown in the EHR UI. Use one of the identifiers Cobalt provides — any of the following is accepted:
- The
telephone_encounter_idreturned byPOST /telephone-encounterswhen you created the encounter. - The
emr_encounter_idfrom thetelephone_encounter.createdwebhook payload. - The appointment
idreturned by the appointment fetch endpoints/webhooks (Cobalt resolves it to the underlying encounter).
- The
- text (string, required): The action text/note to add to the telephone encounter log
How It Works
When you add an action to a telephone encounter:- Formatting: The action is automatically formatted with the staff member’s name, timestamp, and timezone
- Appending: The formatted action is appended to the existing action log in the telephone encounter
- Timestamping: Each action includes the exact date, time, and timezone when it was added
Example Request
curl -X POST https://api.usecobalt.com/v1/telephone-encounters/actions \
-H 'Content-Type: application/json' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-d '{
"appointment_id": "3fa85f6457174562b3fc2c963f66afa6",
"text": "Patient called for prescription refill"
}'
Example Response
{
"success": true,
"message": "Action processing. A webhook event will be sent upon completion.",
"action_id": "a7b8c9d0e1f2g3h4i5j6k7l8m9n0o1p2",
"job_id": 12345
}
Response Fields
- success (boolean): Indicates if the request was accepted for processing
- message (string): Confirmation message
- action_id (string): Unique identifier for the action record (32-character hex string)
- job_id (integer): Reference to the job that will process this action
Webhook Events
You’ll receive a webhook when the action is processed:Success Event
{
"id": "evt_abc123",
"object": "event",
"type": "telephone_encounter_action.created",
"created": "2026-01-21T20:15:30.000Z",
"job_id": "12345",
"access_token_reference_id": "user_123",
"data": {
"action_id": "a7b8c9d0e1f2g3h4i5j6k7l8m9n0o1p2",
"emr_appointment_id": "3784895",
"text": "Patient called for prescription refill"
}
}
Authorizations
Body
application/json
Action text (the note/message to add to the encounter).
Example:
"Called patient; left a message about their results."
Cobalt appointment ID of the telephone encounter to act on (UUID, with or without dashes).
Example:
"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4"
Legacy alias for appointment_id, still accepted for existing integrations.
Example:
"appt-emr-789"
Whether the action is high priority. One of: "true", "false".
Example:
"false"
URLs to receive the completion webhook for this action, in addition to the account webhook.
Example:
["https://example.com/webhooks/cobalt"]