Skip to main content
POST
/
voice
/
api
/
v1
/
documents
Create or Update Document
curl --request POST \
  --url https://api.eka.care/voice/api/v1/documents \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "session_id": "ses_abc123def456",
  "template_id": "clinical_notes_template",
  "type": "custom",
  "document_name": "Edited clinical note",
  "status": "success"
}
'
import requests

url = "https://api.eka.care/voice/api/v1/documents"

payload = {
"session_id": "ses_abc123def456",
"template_id": "clinical_notes_template",
"type": "custom",
"document_name": "Edited clinical note",
"status": "success"
}
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({
session_id: 'ses_abc123def456',
template_id: 'clinical_notes_template',
type: 'custom',
document_name: 'Edited clinical note',
status: 'success'
})
};

fetch('https://api.eka.care/voice/api/v1/documents', 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/api/v1/documents",
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([
'session_id' => 'ses_abc123def456',
'template_id' => 'clinical_notes_template',
'type' => 'custom',
'document_name' => 'Edited clinical note',
'status' => 'success'
]),
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/api/v1/documents"

payload := strings.NewReader("{\n \"session_id\": \"ses_abc123def456\",\n \"template_id\": \"clinical_notes_template\",\n \"type\": \"custom\",\n \"document_name\": \"Edited clinical note\",\n \"status\": \"success\"\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/api/v1/documents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"session_id\": \"ses_abc123def456\",\n \"template_id\": \"clinical_notes_template\",\n \"type\": \"custom\",\n \"document_name\": \"Edited clinical note\",\n \"status\": \"success\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.eka.care/voice/api/v1/documents")

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 \"session_id\": \"ses_abc123def456\",\n \"template_id\": \"clinical_notes_template\",\n \"type\": \"custom\",\n \"document_name\": \"Edited clinical note\",\n \"status\": \"success\"\n}"

response = http.request(request)
puts response.read_body
{
  "status": "success",
  "data": {
    "document_id": "doc_9f8e7d6c",
    "session_id": "ses_abc123def456",
    "template_id": "clinical_notes_template",
    "document_name": "Edited clinical note",
    "type": "markdown",
    "document_type": "custom",
    "status": "success",
    "errors": [],
    "warnings": [],
    "usage_information": {},
    "presigned_url": "https://s3.amazonaws.com/...&X-Amz-Signature=...",
    "created_at": "2026-06-06T14:21:07Z",
    "updated_at": "2026-06-06T14:25:12Z",
    "publish": {}
  }
}
{
"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 a document on a session (omit document_id201) or update one (include document_id200) — e.g. to save a doctor’s edits. The response includes a presigned PUT URL — upload the markdown content there:
curl -X PUT "<presigned_url>" -H "Content-Type: text/markdown" --data-binary @note.md

Authorizations

Authorization
string
header
required

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

Body

application/json
session_id
string
required

The session this document belongs to.

Example:

"ses_abc123def456"

document_id
string

Omit to create a new document; include to update an existing one.

template_id
string

Template the document is associated with, if any.

type
enum<string>
default:custom

Document category.

Available options:
context,
transcript,
custom,
notes,
integration
document_name
string

Human-readable document name.

status
string
default:in-progress

Document status, e.g. in-progress or success.

errors
any[]
warnings
any[]
usage_information
object

Response

Document created (also 200 when updating an existing document)

status
string
Example:

"success"

data
object