Skip to main content
Use this endpoint to modify an existing structured clinical document. All body fields are optional — only fields you include are updated. When updating sections, the supplied array replaces the existing sections in full, so include all sections you want to preserve. A common use case is setting status to amended and appending a new addendum section.

Request

PATCH https://api.clinikapi.com/v1/documents/:id

Headers

x-api-key
string
required
Your ClinikAPI secret key (clk_live_* or clk_test_*).
Content-Type
string
required
Must be application/json.

Path parameters

id
string
required
The ID of the document to update (e.g. doc_abc123).

Body

status
string
Updated document status. One of: preliminary, final, amended.
title
string
Updated document title.
sections
array
Replacement sections array. This fully replaces the existing sections, so include all sections you want to keep.
confidentiality
string
Updated confidentiality level. One of: N, R, V.
date
string
Updated document date in YYYY-MM-DD format.

Response

Returns 200 OK with the updated document wrapped in the standard envelope. All fields reflect the post-update state.
data.id
string
Document ID.
data.status
string
Updated document status.
data.sections
array
Full updated sections array.
meta
object
Standard response metadata including requestId, timestamp, status, and rate-limit fields.

Examples

curl

curl -X PATCH https://api.clinikapi.com/v1/documents/doc_abc123 \
  -H "x-api-key: clk_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "amended",
    "sections": [
      { "title": "Chief Complaint", "code": "chief-complaint", "text": "Patient admitted for evaluation of acute chest pain." },
      { "title": "Hospital Course", "code": "hospital-course", "text": "Troponin negative x3. Discharged in stable condition." },
      { "title": "Addendum", "code": "addendum", "text": "Patient called post-discharge reporting mild nausea with naproxen. Advised to take with food." }
    ]
  }'

TypeScript SDK

import { Clinik } from '@clinikapi/sdk';

const clinik = new Clinik(process.env.CLINIKAPI_SECRET_KEY!);

const { data: doc } = await clinik.documents.update('doc_abc123', {
  status: 'amended',
  sections: [
    { title: 'Chief Complaint', code: 'chief-complaint', text: 'Patient admitted for evaluation of acute chest pain.' },
    { title: 'Hospital Course', code: 'hospital-course', text: 'Troponin negative x3. Discharged in stable condition.' },
    { title: 'Addendum', code: 'addendum', text: 'Patient called post-discharge reporting mild nausea with naproxen. Advised to take with food.' },
  ],
});

console.log(doc.status); // "amended"