---
title: "Create DocumentReference"
method: POST
path: "/main/DocumentReference"
tags: ["DocumentReference"]
---

# Create DocumentReference

`POST /main/DocumentReference`

Creates a single clinical note in a patient profile

## Request body

- DocumentReference — Create a new Note record
  - `masterIdentifier` FhirIdentifier
    - `use` 'usual' | 'official' | 'temp' | 'secondary' | 'old' | 'null', nullable
    - `type` FhirCodeableConcept
      - `coding` FhirCoding[] — defined by a terminology system
        - `system` string, uri, nullable — Identity of the terminology system
        - `code` string, nullable — Symbol in syntax defined by the system
        - `display` string, nullable — Representation defined by the system
        - `userSelected` boolean, nullable — If this coding was chosen directly by the user
        - `id` string, nullable — ID of the FHIR element (optional)
      - `text` string, nullable — Plain text representation of the concept
      - `id` string, nullable — ID of the FHIR element (optional)
    - `system` string, nullable — The namespace for the identifier value
    - `value` string, nullable — The unique identifier
    - `period` FhirPeriodDateTime
      - `start` string, date-time, nullable
      - `end` string, date-time, nullable
      - `id` string, nullable — ID of the FHIR element (optional)
    - `assigner` FhirReference
      - `reference` string, required — The URL (relative or absolute) to the resource being referenced
      - `type` 'Organization' | 'Patient' | 'Practitioner' | 'PractitionerRole' | 'Appointment' | 'Coverage' | 'Invoice' | 'Communication' | 'Group' | 'DocumentReference' | 'InvoiceLine' | 'PaymentTransaction' | 'Referral' | 'ReferralDefinition' | 'Schedule' | 'Slot' | 'HealthcareService' | 'AllergyIntolerance' | 'Condition' | 'Immunization' | 'Subscription' | 'SubscriptionTopic' | 'ChargeItemDefinition' | 'ServiceRequest' | 'Medication' | 'MedicationRequest' | 'Questionnaire' | 'QuestionnaireResponse' | 'Observation' | 'Binary' | 'Bundle' | 'OperationOutcome' | 'Parameters' | 'List' | 'null', nullable — The type of resource being referenced
      - `id` string, nullable — ID of the FHIR element (optional)
    - `id` string, nullable — ID of the FHIR element (optional)
  - `status` 'current' | 'superseded' — The status of the document reference
  - `docStatus` 'preliminary' | 'final', required — The status of the clinical note - preliminary for Draft, final for Published
  - `type` FhirCodeableConcept
    - `coding` FhirCoding[] — defined by a terminology system
      - `system` string, uri, nullable — Identity of the terminology system
      - `code` string, nullable — Symbol in syntax defined by the system
      - `display` string, nullable — Representation defined by the system
      - `userSelected` boolean, nullable — If this coding was chosen directly by the user
      - `id` string, nullable — ID of the FHIR element (optional)
    - `text` string, nullable — Plain text representation of the concept
    - `id` string, nullable — ID of the FHIR element (optional)
  - `category` FhirCodeableConcept[] — Categorization of the clinical note
    - `coding` FhirCoding[] — defined by a terminology system
      - `system` string, uri, nullable — Identity of the terminology system
      - `code` string, nullable — Symbol in syntax defined by the system
      - `display` string, nullable — Representation defined by the system
      - `userSelected` boolean, nullable — If this coding was chosen directly by the user
      - `id` string, nullable — ID of the FHIR element (optional)
    - `text` string, nullable — Plain text representation of the concept
    - `id` string, nullable — ID of the FHIR element (optional)
  - `subject` FhirReference, required
    - `reference` string, required — The URL (relative or absolute) to the resource being referenced
    - `type` 'Organization' | 'Patient' | 'Practitioner' | 'PractitionerRole' | 'Appointment' | 'Coverage' | 'Invoice' | 'Communication' | 'Group' | 'DocumentReference' | 'InvoiceLine' | 'PaymentTransaction' | 'Referral' | 'ReferralDefinition' | 'Schedule' | 'Slot' | 'HealthcareService' | 'AllergyIntolerance' | 'Condition' | 'Immunization' | 'Subscription' | 'SubscriptionTopic' | 'ChargeItemDefinition' | 'ServiceRequest' | 'Medication' | 'MedicationRequest' | 'Questionnaire' | 'QuestionnaireResponse' | 'Observation' | 'Binary' | 'Bundle' | 'OperationOutcome' | 'Parameters' | 'List' | 'null', nullable — The type of resource being referenced
    - `id` string, nullable — ID of the FHIR element (optional)
  - `date` string, date-time, nullable — The date and time when the clinical note was created
  - `author` FhirReference[], required — The practitioner and practice location linked as the clinical note's owner
    - `reference` string, required — The URL (relative or absolute) to the resource being referenced
    - `type` 'Organization' | 'Patient' | 'Practitioner' | 'PractitionerRole' | 'Appointment' | 'Coverage' | 'Invoice' | 'Communication' | 'Group' | 'DocumentReference' | 'InvoiceLine' | 'PaymentTransaction' | 'Referral' | 'ReferralDefinition' | 'Schedule' | 'Slot' | 'HealthcareService' | 'AllergyIntolerance' | 'Condition' | 'Immunization' | 'Subscription' | 'SubscriptionTopic' | 'ChargeItemDefinition' | 'ServiceRequest' | 'Medication' | 'MedicationRequest' | 'Questionnaire' | 'QuestionnaireResponse' | 'Observation' | 'Binary' | 'Bundle' | 'OperationOutcome' | 'Parameters' | 'List' | 'null', nullable — The type of resource being referenced
    - `id` string, nullable — ID of the FHIR element (optional)
  - `custodian` FhirReference
    - `reference` string, required — The URL (relative or absolute) to the resource being referenced
    - `type` 'Organization' | 'Patient' | 'Practitioner' | 'PractitionerRole' | 'Appointment' | 'Coverage' | 'Invoice' | 'Communication' | 'Group' | 'DocumentReference' | 'InvoiceLine' | 'PaymentTransaction' | 'Referral' | 'ReferralDefinition' | 'Schedule' | 'Slot' | 'HealthcareService' | 'AllergyIntolerance' | 'Condition' | 'Immunization' | 'Subscription' | 'SubscriptionTopic' | 'ChargeItemDefinition' | 'ServiceRequest' | 'Medication' | 'MedicationRequest' | 'Questionnaire' | 'QuestionnaireResponse' | 'Observation' | 'Binary' | 'Bundle' | 'OperationOutcome' | 'Parameters' | 'List' | 'null', nullable — The type of resource being referenced
    - `id` string, nullable — ID of the FHIR element (optional)
  - `description` string, nullable, required — The title of the clinical note
  - `content` FhirDocumentReferenceContent[] — The content of the clinical note
    - `attachment` FhirAttachment
      - `data` string — The file encoded to base64 (maximum 20MB)
      - `contentType` 'application/json' | 'application/xml' | 'application/msword' | 'application/vnd.ms-excel' | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' | 'application/pdf' | 'text/html' | 'text/xml' | 'text/plain' | 'image/jpeg' | 'image/png' | 'video/mp4' | 'application/zip' | 'application/fhir+json' — The file format of the file attachment
      - `language` 'ar' | 'bn' | 'cs' | 'da' | 'de' | 'el' | 'en' | 'en-AU' | 'es' | 'fi' | 'fr' | 'fy' | 'hi' | 'hr' | 'it' | 'ja' | 'ko' | 'nl' | 'no' | 'pa' | 'pl' | 'pt' | 'ru' | 'sr' | 'sv' | 'te' | 'zh' | 'null', nullable — Human language of the content (BCP-47)
      - `url` string, nullable — Uri where the data can be found
      - `size` integer, nullable — Number of bytes of content (if url provided)
      - `hash` string, nullable — Hash of the data (sha-1, base64ed)
      - `title` string, nullable — The file name
      - `creation` string, date-time, nullable — The date and time that the file attachment was first created
      - `id` string, nullable — ID of the FHIR element (optional)
    - `format` FhirCoding
      - `system` string, uri, nullable — Identity of the terminology system
      - `code` string, nullable — Symbol in syntax defined by the system
      - `display` string, nullable — Representation defined by the system
      - `userSelected` boolean, nullable — If this coding was chosen directly by the user
      - `id` string, nullable — ID of the FHIR element (optional)
    - `id` string, nullable — ID of the FHIR element (optional)
  - `text` FhirNarrative
    - `status` 'generated' | 'extensions' | 'additional' | 'empty' — Describes how the narrative was generated
    - `div` string — Limited xhtml content
    - `id` string, nullable — ID of the FHIR element (optional)
  - `contained` AbstractFhirResource[] — Contained, inline Resources
    - `id` string, nullable — Logical id of this artifact
    - `meta` FhirResourceMeta
      - `lastUpdated` string, date-time, nullable — When the resource version last changed
      - `profile` string[] — Profiles this resource claims to conform to
    - `resourceType` string, nullable — Resource Type
  - `id` string, nullable — Logical id of this artifact
  - `meta` FhirResourceMeta
    - `lastUpdated` string, date-time, nullable — When the resource version last changed
    - `profile` string[] — Profiles this resource claims to conform to
  - `resourceType` string, nullable — Resource Type

## Response `201`

DocumentReference resource created

- DocumentReference — Create a new Note record
  - `masterIdentifier` FhirIdentifier
    - `use` 'usual' | 'official' | 'temp' | 'secondary' | 'old' | 'null', nullable
    - `type` FhirCodeableConcept
      - `coding` FhirCoding[] — defined by a terminology system
        - `system` string, uri, nullable — Identity of the terminology system
        - `code` string, nullable — Symbol in syntax defined by the system
        - `display` string, nullable — Representation defined by the system
        - `userSelected` boolean, nullable — If this coding was chosen directly by the user
        - `id` string, nullable — ID of the FHIR element (optional)
      - `text` string, nullable — Plain text representation of the concept
      - `id` string, nullable — ID of the FHIR element (optional)
    - `system` string, nullable — The namespace for the identifier value
    - `value` string, nullable — The unique identifier
    - `period` FhirPeriodDateTime
      - `start` string, date-time, nullable
      - `end` string, date-time, nullable
      - `id` string, nullable — ID of the FHIR element (optional)
    - `assigner` FhirReference
      - `reference` string, required — The URL (relative or absolute) to the resource being referenced
      - `type` 'Organization' | 'Patient' | 'Practitioner' | 'PractitionerRole' | 'Appointment' | 'Coverage' | 'Invoice' | 'Communication' | 'Group' | 'DocumentReference' | 'InvoiceLine' | 'PaymentTransaction' | 'Referral' | 'ReferralDefinition' | 'Schedule' | 'Slot' | 'HealthcareService' | 'AllergyIntolerance' | 'Condition' | 'Immunization' | 'Subscription' | 'SubscriptionTopic' | 'ChargeItemDefinition' | 'ServiceRequest' | 'Medication' | 'MedicationRequest' | 'Questionnaire' | 'QuestionnaireResponse' | 'Observation' | 'Binary' | 'Bundle' | 'OperationOutcome' | 'Parameters' | 'List' | 'null', nullable — The type of resource being referenced
      - `id` string, nullable — ID of the FHIR element (optional)
    - `id` string, nullable — ID of the FHIR element (optional)
  - `status` 'current' | 'superseded' — The status of the document reference
  - `docStatus` 'preliminary' | 'final', required — The status of the clinical note - preliminary for Draft, final for Published
  - `type` FhirCodeableConcept
    - `coding` FhirCoding[] — defined by a terminology system
      - `system` string, uri, nullable — Identity of the terminology system
      - `code` string, nullable — Symbol in syntax defined by the system
      - `display` string, nullable — Representation defined by the system
      - `userSelected` boolean, nullable — If this coding was chosen directly by the user
      - `id` string, nullable — ID of the FHIR element (optional)
    - `text` string, nullable — Plain text representation of the concept
    - `id` string, nullable — ID of the FHIR element (optional)
  - `category` FhirCodeableConcept[] — Categorization of the clinical note
    - `coding` FhirCoding[] — defined by a terminology system
      - `system` string, uri, nullable — Identity of the terminology system
      - `code` string, nullable — Symbol in syntax defined by the system
      - `display` string, nullable — Representation defined by the system
      - `userSelected` boolean, nullable — If this coding was chosen directly by the user
      - `id` string, nullable — ID of the FHIR element (optional)
    - `text` string, nullable — Plain text representation of the concept
    - `id` string, nullable — ID of the FHIR element (optional)
  - `subject` FhirReference, required
    - `reference` string, required — The URL (relative or absolute) to the resource being referenced
    - `type` 'Organization' | 'Patient' | 'Practitioner' | 'PractitionerRole' | 'Appointment' | 'Coverage' | 'Invoice' | 'Communication' | 'Group' | 'DocumentReference' | 'InvoiceLine' | 'PaymentTransaction' | 'Referral' | 'ReferralDefinition' | 'Schedule' | 'Slot' | 'HealthcareService' | 'AllergyIntolerance' | 'Condition' | 'Immunization' | 'Subscription' | 'SubscriptionTopic' | 'ChargeItemDefinition' | 'ServiceRequest' | 'Medication' | 'MedicationRequest' | 'Questionnaire' | 'QuestionnaireResponse' | 'Observation' | 'Binary' | 'Bundle' | 'OperationOutcome' | 'Parameters' | 'List' | 'null', nullable — The type of resource being referenced
    - `id` string, nullable — ID of the FHIR element (optional)
  - `date` string, date-time, nullable — The date and time when the clinical note was created
  - `author` FhirReference[], required — The practitioner and practice location linked as the clinical note's owner
    - `reference` string, required — The URL (relative or absolute) to the resource being referenced
    - `type` 'Organization' | 'Patient' | 'Practitioner' | 'PractitionerRole' | 'Appointment' | 'Coverage' | 'Invoice' | 'Communication' | 'Group' | 'DocumentReference' | 'InvoiceLine' | 'PaymentTransaction' | 'Referral' | 'ReferralDefinition' | 'Schedule' | 'Slot' | 'HealthcareService' | 'AllergyIntolerance' | 'Condition' | 'Immunization' | 'Subscription' | 'SubscriptionTopic' | 'ChargeItemDefinition' | 'ServiceRequest' | 'Medication' | 'MedicationRequest' | 'Questionnaire' | 'QuestionnaireResponse' | 'Observation' | 'Binary' | 'Bundle' | 'OperationOutcome' | 'Parameters' | 'List' | 'null', nullable — The type of resource being referenced
    - `id` string, nullable — ID of the FHIR element (optional)
  - `custodian` FhirReference
    - `reference` string, required — The URL (relative or absolute) to the resource being referenced
    - `type` 'Organization' | 'Patient' | 'Practitioner' | 'PractitionerRole' | 'Appointment' | 'Coverage' | 'Invoice' | 'Communication' | 'Group' | 'DocumentReference' | 'InvoiceLine' | 'PaymentTransaction' | 'Referral' | 'ReferralDefinition' | 'Schedule' | 'Slot' | 'HealthcareService' | 'AllergyIntolerance' | 'Condition' | 'Immunization' | 'Subscription' | 'SubscriptionTopic' | 'ChargeItemDefinition' | 'ServiceRequest' | 'Medication' | 'MedicationRequest' | 'Questionnaire' | 'QuestionnaireResponse' | 'Observation' | 'Binary' | 'Bundle' | 'OperationOutcome' | 'Parameters' | 'List' | 'null', nullable — The type of resource being referenced
    - `id` string, nullable — ID of the FHIR element (optional)
  - `description` string, nullable, required — The title of the clinical note
  - `content` FhirDocumentReferenceContent[] — The content of the clinical note
    - `attachment` FhirAttachment
      - `data` string — The file encoded to base64 (maximum 20MB)
      - `contentType` 'application/json' | 'application/xml' | 'application/msword' | 'application/vnd.ms-excel' | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' | 'application/pdf' | 'text/html' | 'text/xml' | 'text/plain' | 'image/jpeg' | 'image/png' | 'video/mp4' | 'application/zip' | 'application/fhir+json' — The file format of the file attachment
      - `language` 'ar' | 'bn' | 'cs' | 'da' | 'de' | 'el' | 'en' | 'en-AU' | 'es' | 'fi' | 'fr' | 'fy' | 'hi' | 'hr' | 'it' | 'ja' | 'ko' | 'nl' | 'no' | 'pa' | 'pl' | 'pt' | 'ru' | 'sr' | 'sv' | 'te' | 'zh' | 'null', nullable — Human language of the content (BCP-47)
      - `url` string, nullable — Uri where the data can be found
      - `size` integer, nullable — Number of bytes of content (if url provided)
      - `hash` string, nullable — Hash of the data (sha-1, base64ed)
      - `title` string, nullable — The file name
      - `creation` string, date-time, nullable — The date and time that the file attachment was first created
      - `id` string, nullable — ID of the FHIR element (optional)
    - `format` FhirCoding
      - `system` string, uri, nullable — Identity of the terminology system
      - `code` string, nullable — Symbol in syntax defined by the system
      - `display` string, nullable — Representation defined by the system
      - `userSelected` boolean, nullable — If this coding was chosen directly by the user
      - `id` string, nullable — ID of the FHIR element (optional)
    - `id` string, nullable — ID of the FHIR element (optional)
  - `text` FhirNarrative
    - `status` 'generated' | 'extensions' | 'additional' | 'empty' — Describes how the narrative was generated
    - `div` string — Limited xhtml content
    - `id` string, nullable — ID of the FHIR element (optional)
  - `contained` AbstractFhirResource[] — Contained, inline Resources
    - `id` string, nullable — Logical id of this artifact
    - `meta` FhirResourceMeta
      - `lastUpdated` string, date-time, nullable — When the resource version last changed
      - `profile` string[] — Profiles this resource claims to conform to
    - `resourceType` string, nullable — Resource Type
  - `id` string, nullable — Logical id of this artifact
  - `meta` FhirResourceMeta
    - `lastUpdated` string, date-time, nullable — When the resource version last changed
    - `profile` string[] — Profiles this resource claims to conform to
  - `resourceType` string, nullable — Resource Type

## Other responses

- `400` — Invalid input
- `403` — Forbidden
- `422` — Unprocessable entity

---

[API](https://skmtc.dev/halaxy/apis/halaxy-api.md) · [All operations](https://skmtc.dev/halaxy/apis/halaxy-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/halaxy/halaxy-api/revisions/d72139daaa89/schema)
