Skip to main content
PATCH
/
voice
/
v1
/
sessions
/
{session_id}
Update Session
curl --request PATCH \
  --url https://api.eka.care/voice/v1/sessions/{session_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "patient_details": {
    "oid": "PAT-12345",
    "name": "John Doe"
  },
  "templates": [
    "clinical_notes_template"
  ],
  "language_hint": [
    "en",
    "hi"
  ]
}
'
import requests

url = "https://api.eka.care/voice/v1/sessions/{session_id}"

payload = {
"patient_details": {
"oid": "PAT-12345",
"name": "John Doe"
},
"templates": ["clinical_notes_template"],
"language_hint": ["en", "hi"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
patient_details: {oid: 'PAT-12345', name: 'John Doe'},
templates: ['clinical_notes_template'],
language_hint: ['en', 'hi']
})
};

fetch('https://api.eka.care/voice/v1/sessions/{session_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.eka.care/voice/v1/sessions/{session_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([
'patient_details' => [
'oid' => 'PAT-12345',
'name' => 'John Doe'
],
'templates' => [
'clinical_notes_template'
],
'language_hint' => [
'en',
'hi'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$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.eka.care/voice/v1/sessions/{session_id}"

payload := strings.NewReader("{\n \"patient_details\": {\n \"oid\": \"PAT-12345\",\n \"name\": \"John Doe\"\n },\n \"templates\": [\n \"clinical_notes_template\"\n ],\n \"language_hint\": [\n \"en\",\n \"hi\"\n ]\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
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.eka.care/voice/v1/sessions/{session_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"patient_details\": {\n \"oid\": \"PAT-12345\",\n \"name\": \"John Doe\"\n },\n \"templates\": [\n \"clinical_notes_template\"\n ],\n \"language_hint\": [\n \"en\",\n \"hi\"\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.eka.care/voice/v1/sessions/{session_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"patient_details\": {\n \"oid\": \"PAT-12345\",\n \"name\": \"John Doe\"\n },\n \"templates\": [\n \"clinical_notes_template\"\n ],\n \"language_hint\": [\n \"en\",\n \"hi\"\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "session_id": "ses_abc123def456",
  "status": "success",
  "message": "Session updated successfully"
}
{
"error": {
"code": "invalid_audio_format",
"message": "Audio format 'audio/mp3' is not supported",
"details": {}
}
}
{
"error": {
"code": "invalid_audio_format",
"message": "Audio format 'audio/mp3' is not supported",
"details": {}
}
}
{
"error": {
"code": "invalid_audio_format",
"message": "Audio format 'audio/mp3' is not supported",
"details": {}
}
}
Update session metadata — patient_details, templates, language_hint, etc. Send only the fields you want to change.
session_mode and model can only be changed before End Session — afterwards the call returns 409.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

session_id
string
required

Session ID returned by Create Session

Example:

"ses_abc123def456"

Body

application/json
patient_details
object

Patient demographic / identifier metadata. The oid key is promoted to patient_oid for indexing.

templates
string[]

Replace the requested template IDs (up to 2).

language_hint
string[]

ISO 639-1 code(s) hinting the spoken language(s).

additional_data
object

Arbitrary pass-through metadata merged into the session.

session_mode
enum<string>

Updatable only before the session is committed (End Session).

Available options:
consultation,
dictation
model
enum<string>

Updatable only before the session is committed (End Session).

Available options:
pro,
lite
user_status
string

Client-side session status marker.

processing_status
string

Processing status override (advanced use).

Response

Session updated

session_id
string
status
string
Example:

"success"

message
string
Example:

"Session updated successfully"