Update document
curl --request PATCH \
--url https://enterprise.tavrn.ai/v2/documents/{document_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"path": "<string>",
"archived": true
}
'import requests
url = "https://enterprise.tavrn.ai/v2/documents/{document_id}"
payload = {
"path": "<string>",
"archived": True
}
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({path: '<string>', archived: true})
};
fetch('https://enterprise.tavrn.ai/v2/documents/{document_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://enterprise.tavrn.ai/v2/documents/{document_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([
'path' => '<string>',
'archived' => true
]),
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://enterprise.tavrn.ai/v2/documents/{document_id}"
payload := strings.NewReader("{\n \"path\": \"<string>\",\n \"archived\": true\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://enterprise.tavrn.ai/v2/documents/{document_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"path\": \"<string>\",\n \"archived\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://enterprise.tavrn.ai/v2/documents/{document_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 \"path\": \"<string>\",\n \"archived\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "doc_abc123",
"case_id": "case_xyz",
"file_name": "medical_record.pdf",
"file_size": 1234567,
"file_type": "application/pdf",
"archived": false,
"created_at": "2025-02-01T12:34:56Z",
"updated_at": "2025-02-01T12:34:56Z",
"path": "Example_General_Hospital"
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required"
}
}Case Documents
Update document
Update document metadata or archive status
PATCH
/
v2
/
documents
/
{document_id}
Update document
curl --request PATCH \
--url https://enterprise.tavrn.ai/v2/documents/{document_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"path": "<string>",
"archived": true
}
'import requests
url = "https://enterprise.tavrn.ai/v2/documents/{document_id}"
payload = {
"path": "<string>",
"archived": True
}
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({path: '<string>', archived: true})
};
fetch('https://enterprise.tavrn.ai/v2/documents/{document_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://enterprise.tavrn.ai/v2/documents/{document_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([
'path' => '<string>',
'archived' => true
]),
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://enterprise.tavrn.ai/v2/documents/{document_id}"
payload := strings.NewReader("{\n \"path\": \"<string>\",\n \"archived\": true\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://enterprise.tavrn.ai/v2/documents/{document_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"path\": \"<string>\",\n \"archived\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://enterprise.tavrn.ai/v2/documents/{document_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 \"path\": \"<string>\",\n \"archived\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "doc_abc123",
"case_id": "case_xyz",
"file_name": "medical_record.pdf",
"file_size": 1234567,
"file_type": "application/pdf",
"archived": false,
"created_at": "2025-02-01T12:34:56Z",
"updated_at": "2025-02-01T12:34:56Z",
"path": "Example_General_Hospital"
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required"
}
}Authorizations
API key authentication. Use format: Authorization: Bearer tavrn_sk_live_...
Path Parameters
Document ID
Body
application/json
Response
Document updated successfully
Unique document identifier
Example:
"doc_abc123"
Associated case ID
Example:
"case_xyz"
File name
Example:
"medical_record.pdf"
File size in bytes
Example:
1234567
MIME type
Example:
"application/pdf"
Whether document is archived
Example:
false
Creation timestamp (ISO 8601)
Example:
"2025-02-01T12:34:56Z"
Last update timestamp (ISO 8601)
Example:
"2025-02-01T12:34:56Z"
Virtual path for UI grouping
Example:
"Example_General_Hospital"