> ## 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.

# Update Attachment Patient Portal Sharing

> Share or unshare a photo to the patient's portal gallery.

When sharing, the caption defaults to the attachment's name if none is
supplied (a blank caption is stored as NULL). Unsharing leaves any existing
caption in place so it is preserved if the photo is re-shared.



## OpenAPI

````yaml put /attachments/{attachment_id}/patient-portal
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /attachments/{attachment_id}/patient-portal:
    put:
      tags:
        - Attachments
      summary: Update Attachment Patient Portal Sharing
      description: >-
        Share or unshare a photo to the patient's portal gallery.


        When sharing, the caption defaults to the attachment's name if none is

        supplied (a blank caption is stored as NULL). Unsharing leaves any
        existing

        caption in place so it is preserved if the photo is re-shared.
      operationId: >-
        update_attachment_patient_portal_sharing_attachments__attachment_id__patient_portal_put
      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
        - name: attachment_id
          in: path
          required: true
          schema:
            type: string
            title: Attachment Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NoteAttachmentPatientPortalUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: boolean
                title: >-
                  Response Update Attachment Patient Portal Sharing Attachments 
                  Attachment Id  Patient Portal Put
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    NoteAttachmentPatientPortalUpdate:
      properties:
        visibleToPatient:
          type: boolean
          title: Visibletopatient
        patientCaption:
          anyOf:
            - type: string
            - type: 'null'
          title: Patientcaption
      type: object
      required:
        - visibleToPatient
      title: NoteAttachmentPatientPortalUpdate
      description: >-
        Toggle whether a photo is shared to the patient portal, with an optional

        patient-facing caption. When sharing with no caption supplied, the
        endpoint

        falls back to the attachment's name.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````