> ## Documentation Index
> Fetch the complete documentation index at: https://docs.decodahealth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Link Attachments To Note

> Link existing attachments to a note without re-uploading.

This endpoint creates NoteToNoteAttachment records to link existing attachments
to a note. It validates:
- Note exists and is not archived
- All attachments exist and are not archived
- All attachments belong to the same patient as the note (security)
- Skips any attachments already linked to the note



## OpenAPI

````yaml post /attachments/link-to-note
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /attachments/link-to-note:
    post:
      tags:
        - provider
        - scribe
        - attachments
      summary: Link Attachments To Note
      description: >-
        Link existing attachments to a note without re-uploading.


        This endpoint creates NoteToNoteAttachment records to link existing
        attachments

        to a note. It validates:

        - Note exists and is not archived

        - All attachments exist and are not archived

        - All attachments belong to the same patient as the note (security)

        - Skips any attachments already linked to the note
      operationId: link_attachments_to_note_attachments_link_to_note_post
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkAttachmentsToNoteRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/NoteAttachmentResponse'
                type: array
                title: >-
                  Response Link Attachments To Note Attachments Link To Note
                  Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    LinkAttachmentsToNoteRequest:
      properties:
        noteId:
          type: string
          title: Noteid
        attachmentIds:
          items:
            type: string
          type: array
          title: Attachmentids
      type: object
      required:
        - noteId
        - attachmentIds
      title: LinkAttachmentsToNoteRequest
    NoteAttachmentResponse:
      properties:
        id:
          type: string
          title: Id
        noteId:
          anyOf:
            - type: string
            - type: 'null'
          title: Noteid
        gcsPath:
          type: string
          title: Gcspath
        originalFilename:
          type: string
          title: Originalfilename
        signedUrl:
          type: string
          title: Signedurl
        thumbnailSignedUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Thumbnailsignedurl
        annotations:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Annotations
        name:
          type: string
          title: Name
        createdDate:
          type: string
          format: date-time
          title: Createddate
        externalId:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalid
        patient:
          anyOf:
            - $ref: '#/components/schemas/PatientSummary'
            - type: 'null'
        note:
          anyOf:
            - $ref: '#/components/schemas/NoteAttachmentNote'
            - type: 'null'
        provider:
          anyOf:
            - $ref: '#/components/schemas/ProviderTiny'
            - type: 'null'
        tags:
          items:
            $ref: '#/components/schemas/NoteAttachmentTagSummary'
          type: array
          title: Tags
      type: object
      required:
        - id
        - gcsPath
        - originalFilename
        - signedUrl
        - name
        - createdDate
      title: NoteAttachmentResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PatientSummary:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier for the user.
        firstName:
          anyOf:
            - type: string
            - type: 'null'
          title: Firstname
          description: The user's first name.
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastname
          description: The user's last name.
        phoneNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Phonenumber
          description: The user's phone number.
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: The user's email address.
        type:
          $ref: '#/components/schemas/UserType'
          description: The type of user.
        locationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Locationid
          description: The location of the user.
        externalId:
          anyOf:
            - type: string
            - type: 'null'
          title: Externalid
          description: The user's external identifier if available.
        address:
          anyOf:
            - type: string
            - type: 'null'
          title: Address
          description: The user's primary address.
        addressLineTwo:
          anyOf:
            - type: string
            - type: 'null'
          title: Addresslinetwo
          description: Additional address information.
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
          description: The city of the user's address.
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
          description: The state of the user's address.
        zipCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Zipcode
          description: The postal code of the user's address.
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: The country of the user's address.
        createdDate:
          type: string
          format: date-time
          title: Createddate
          description: The date and time when the user was created.
        addressValid:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Addressvalid
          description: Whether the user's address is valid.
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
          description: Any additional metadata about the user relevant to your system.
        isArchived:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Isarchived
          description: Whether the user is archived.
        primaryLocationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Primarylocationid
          description: The primary location of the user.
        gender:
          anyOf:
            - type: string
            - type: 'null'
          title: Gender
          description: The gender of the patient.
        pronouns:
          anyOf:
            - type: string
            - type: 'null'
          title: Pronouns
          description: The patient's pronouns (e.g., 'he/him', 'she/her', 'they/them').
        preferredName:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Preferredname
          description: The patient's preferred name or nickname.
        dateOfBirth:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Dateofbirth
          description: The date of birth of the patient.
        patientMedications:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Patientmedications
          description: List of patient's self-reported medications.
        patientSource:
          anyOf:
            - $ref: '#/components/schemas/PatientSource'
            - type: 'null'
          description: The source of the patient.
        leadSource:
          anyOf:
            - type: string
            - type: 'null'
          title: Leadsource
          description: Flexible lead source for tracking patient acquisition.
        onSchedulingBlacklist:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Onschedulingblacklist
          description: Whether the patient is on the scheduling blacklist.
        surchargeDisabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Surchargedisabled
          description: Whether surcharges are disabled for this patient.
        tags:
          anyOf:
            - items:
                $ref: '#/components/schemas/PatientTagSummary'
              type: array
            - type: 'null'
          title: Tags
          description: List of patient tags
        creditBalance:
          anyOf:
            - type: integer
            - type: 'null'
          title: Creditbalance
          description: Patient's credit balance in cents.
        preferredProviderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Preferredproviderid
          description: The preferred provider ID for this patient.
        dosespotPatientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Dosespotpatientid
          description: DoseSpot Patient ID for e-prescribing integration
      type: object
      required:
        - id
        - type
        - createdDate
      title: PatientSummary
    NoteAttachmentNote:
      properties:
        id:
          type: string
          title: Id
        createdDate:
          type: string
          format: date-time
          title: Createddate
      type: object
      required:
        - id
        - createdDate
      title: NoteAttachmentNote
    ProviderTiny:
      properties:
        id:
          type: string
          title: Id
        firstName:
          type: string
          title: Firstname
        lastName:
          anyOf:
            - type: string
            - type: 'null'
          title: Lastname
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
      type: object
      required:
        - id
        - firstName
      title: ProviderTiny
    NoteAttachmentTagSummary:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        color:
          type: string
          title: Color
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
      type: object
      required:
        - id
        - name
        - color
      title: NoteAttachmentTagSummary
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    UserType:
      type: string
      enum:
        - PROVIDER
        - PATIENT
        - ASSISTANT
      title: UserType
    PatientSource:
      type: string
      enum:
        - SELF_SCHEDULING
        - CALL
        - TEXT
        - MANUALLY_CREATED
        - UPLOADED_FROM_FILE
        - FORM
        - SEED_DATA
        - DEMO
        - EXTERNAL_INTEGRATION
        - OTHER
      title: PatientSource
    PatientTagSummary:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the patient tag
        name:
          type: string
          title: Name
          description: Name of the patient tag
        emoji:
          anyOf:
            - type: string
            - type: 'null'
          title: Emoji
          description: Emoji associated with the tag
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
          description: Color code for the tag (hex format)
        isActive:
          type: boolean
          title: Isactive
          description: Whether the tag is active
        createdDate:
          type: string
          format: date-time
          title: Createddate
          description: Date and time when the tag was created
        updatedDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updateddate
          description: Date and time when the tag was last updated
      type: object
      required:
        - id
        - name
        - isActive
        - createdDate
      title: PatientTagSummary

````