SDK Reference
Documents
SDK reference for structured document (Composition) operations.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
SDK reference for structured document (Composition) operations.
const { data, meta } = await clinik.documents.create(request: DocumentCreateRequest): Promise<ApiResponse<Composition>>
| Field | Type | Required | Description |
|---|---|---|---|
status | string | Yes | preliminary, final, amended |
type | string | Yes | Document type (e.g. “discharge-summary”) |
category | string[] | No | Document categories for classification |
patientId | string | Yes | Patient reference |
encounterId | string | No | Encounter reference |
practitionerId | string | Yes | Author reference |
title | string | Yes | Document title |
date | string | No | Document date |
sections | DocumentSection[] | Yes | Document sections (recursive) |
confidentiality | 'N' | 'R' | 'V' | No | Normal, Restricted, Very Restricted |
attester | DocumentAttester[] | No | Who attested to accuracy |
custodianId | string | No | Organization maintaining the document |
relatesTo | DocumentRelatesTo[] | No | Relationships to other compositions |
event | DocumentEvent[] | No | Clinical services being documented |
{
title: string;
code?: string;
text: string;
resourceIds?: string[];
authorId?: string; // Per-section author
mode?: 'working' | 'snapshot' | 'changes';
sections?: DocumentSection[]; // Nested sub-sections
}
{
mode: 'personal' | 'professional' | 'legal' | 'official';
time?: string;
partyId?: string; // Practitioner ID
}