curl --request POST \
--url https://api.eka.care/voice/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"language_hint": [
"en"
],
"model": "pro",
"templates": [
"clinical_notes_template"
],
"upload_type": "single",
"additional_data": {
"source": "mobile_app",
"app_version": "1.0.0"
},
"patient_details": {
"oid": "PAT-12345",
"name": "John Doe"
}
}
'import requests
url = "https://api.eka.care/voice/v1/sessions"
payload = {
"language_hint": ["en"],
"model": "pro",
"templates": ["clinical_notes_template"],
"upload_type": "single",
"additional_data": {
"source": "mobile_app",
"app_version": "1.0.0"
},
"patient_details": {
"oid": "PAT-12345",
"name": "John Doe"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
language_hint: ['en'],
model: 'pro',
templates: ['clinical_notes_template'],
upload_type: 'single',
additional_data: {source: 'mobile_app', app_version: '1.0.0'},
patient_details: {oid: 'PAT-12345', name: 'John Doe'}
})
};
fetch('https://api.eka.care/voice/v1/sessions', 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",
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([
'language_hint' => [
'en'
],
'model' => 'pro',
'templates' => [
'clinical_notes_template'
],
'upload_type' => 'single',
'additional_data' => [
'source' => 'mobile_app',
'app_version' => '1.0.0'
],
'patient_details' => [
'oid' => 'PAT-12345',
'name' => 'John Doe'
]
]),
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"
payload := strings.NewReader("{\n \"language_hint\": [\n \"en\"\n ],\n \"model\": \"pro\",\n \"templates\": [\n \"clinical_notes_template\"\n ],\n \"upload_type\": \"single\",\n \"additional_data\": {\n \"source\": \"mobile_app\",\n \"app_version\": \"1.0.0\"\n },\n \"patient_details\": {\n \"oid\": \"PAT-12345\",\n \"name\": \"John Doe\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.eka.care/voice/v1/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"language_hint\": [\n \"en\"\n ],\n \"model\": \"pro\",\n \"templates\": [\n \"clinical_notes_template\"\n ],\n \"upload_type\": \"single\",\n \"additional_data\": {\n \"source\": \"mobile_app\",\n \"app_version\": \"1.0.0\"\n },\n \"patient_details\": {\n \"oid\": \"PAT-12345\",\n \"name\": \"John Doe\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/voice/v1/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"language_hint\": [\n \"en\"\n ],\n \"model\": \"pro\",\n \"templates\": [\n \"clinical_notes_template\"\n ],\n \"upload_type\": \"single\",\n \"additional_data\": {\n \"source\": \"mobile_app\",\n \"app_version\": \"1.0.0\"\n },\n \"patient_details\": {\n \"oid\": \"PAT-12345\",\n \"name\": \"John Doe\"\n }\n}"
response = http.request(request)
puts response.read_body{
"session_id": "ses_abc123def456",
"status": "created",
"created_at": "2025-01-19T10:30:00Z",
"expires_at": "2025-01-19T11:30:00Z",
"upload_url": "https://api.eka.care/voice/v1/sessions/ses_abc123def456/audio",
"patient_details": {
"oid": "PAT-12345",
"name": "John Doe"
}
}{
"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": {}
}
}Create Session
Create a new scribing session. Returns a session_id that must be used in every subsequent call (audio upload, end session, status polling) and an upload_url to which audio is sent. Only upload_type is required — use single (one audio file, max 10 MB via the API; for larger recordings use the SDKs, which chunk automatically) unless you need chunked or streaming upload. The communication protocol is derived from upload_type by the server: single/chunked → http, stream → websocket.
curl --request POST \
--url https://api.eka.care/voice/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"language_hint": [
"en"
],
"model": "pro",
"templates": [
"clinical_notes_template"
],
"upload_type": "single",
"additional_data": {
"source": "mobile_app",
"app_version": "1.0.0"
},
"patient_details": {
"oid": "PAT-12345",
"name": "John Doe"
}
}
'import requests
url = "https://api.eka.care/voice/v1/sessions"
payload = {
"language_hint": ["en"],
"model": "pro",
"templates": ["clinical_notes_template"],
"upload_type": "single",
"additional_data": {
"source": "mobile_app",
"app_version": "1.0.0"
},
"patient_details": {
"oid": "PAT-12345",
"name": "John Doe"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
language_hint: ['en'],
model: 'pro',
templates: ['clinical_notes_template'],
upload_type: 'single',
additional_data: {source: 'mobile_app', app_version: '1.0.0'},
patient_details: {oid: 'PAT-12345', name: 'John Doe'}
})
};
fetch('https://api.eka.care/voice/v1/sessions', 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",
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([
'language_hint' => [
'en'
],
'model' => 'pro',
'templates' => [
'clinical_notes_template'
],
'upload_type' => 'single',
'additional_data' => [
'source' => 'mobile_app',
'app_version' => '1.0.0'
],
'patient_details' => [
'oid' => 'PAT-12345',
'name' => 'John Doe'
]
]),
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"
payload := strings.NewReader("{\n \"language_hint\": [\n \"en\"\n ],\n \"model\": \"pro\",\n \"templates\": [\n \"clinical_notes_template\"\n ],\n \"upload_type\": \"single\",\n \"additional_data\": {\n \"source\": \"mobile_app\",\n \"app_version\": \"1.0.0\"\n },\n \"patient_details\": {\n \"oid\": \"PAT-12345\",\n \"name\": \"John Doe\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.eka.care/voice/v1/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"language_hint\": [\n \"en\"\n ],\n \"model\": \"pro\",\n \"templates\": [\n \"clinical_notes_template\"\n ],\n \"upload_type\": \"single\",\n \"additional_data\": {\n \"source\": \"mobile_app\",\n \"app_version\": \"1.0.0\"\n },\n \"patient_details\": {\n \"oid\": \"PAT-12345\",\n \"name\": \"John Doe\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/voice/v1/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"language_hint\": [\n \"en\"\n ],\n \"model\": \"pro\",\n \"templates\": [\n \"clinical_notes_template\"\n ],\n \"upload_type\": \"single\",\n \"additional_data\": {\n \"source\": \"mobile_app\",\n \"app_version\": \"1.0.0\"\n },\n \"patient_details\": {\n \"oid\": \"PAT-12345\",\n \"name\": \"John Doe\"\n }\n}"
response = http.request(request)
puts response.read_body{
"session_id": "ses_abc123def456",
"status": "created",
"created_at": "2025-01-19T10:30:00Z",
"expires_at": "2025-01-19T11:30:00Z",
"upload_url": "https://api.eka.care/voice/v1/sessions/ses_abc123def456/audio",
"patient_details": {
"oid": "PAT-12345",
"name": "John Doe"
}
}{
"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": {}
}
}upload_type is required — use single for the simplest flow (one audio file). Save the returned session_id for all subsequent calls.
single uploads are capped at 10 MB — for larger recordings use chunked or an SDK. The communication protocol is derived automatically: single/chunked → http, stream → websocket (returns a wss:// upload_url).Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Audio upload method. single — one complete audio file up to 10 MB; chunked — sequential HTTP chunks for longer recordings; stream — real-time WebSocket. The communication protocol is derived automatically (single/chunked → http, stream → websocket).
single, chunked, stream ISO 639-1 language code(s) hinting the audio input language. If your UI doesn't offer a language picker, use ["auto_detect"] for the best results.
["en"]
Model ID from the discovery document.
pro, lite Optional template IDs to extract (max 2). See List Templates for valid IDs.
2["clinical_notes_template"]
Optional client-supplied session id (16–32 chars). If omitted, the server generates one.
16 - 32"ses_abc123def456"
Optional pass-through metadata returned in webhooks and status responses (≤4KB recommended).
Optional patient demographic / identifier metadata. oid is promoted to patient_oid for indexing.
Was this page helpful?

