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

# Patch a file

> Updates the metadata for a file or uploads a new version of the file



## OpenAPI

````yaml /openapi.json patch /matters/{matterId}/documents/files/{fileId}
openapi: 3.0.1
info:
  title: API
  version: '1.0'
servers:
  - url: https://api.smokeball.com
  - url: https://api.smokeball.com.au
  - url: https://api.smokeball.co.uk
  - url: https://stagingapi.smokeball.com
  - url: https://stagingapi.smokeball.com.au
  - url: https://stagingapi.smokeball.co.uk
security:
  - api-key: []
    token: []
paths:
  /matters/{matterId}/documents/files/{fileId}:
    patch:
      tags:
        - Files
      summary: Patch a file
      description: Updates the metadata for a file or uploads a new version of the file
      operationId: PatchFile
      parameters:
        - name: matterId
          in: path
          required: true
          schema:
            type: string
        - name: fileId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/EditFileDto'
          application/json:
            schema:
              $ref: '#/components/schemas/EditFileDto'
          application/*+json:
            schema:
              $ref: '#/components/schemas/EditFileDto'
      responses:
        '202':
          description: When request is accepted. Returns an 'UploadFileInfo' object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadFileInfo'
        '400':
          description: When an unsupported request is made.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: When file or matter with the specified id does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    EditFileDto:
      required:
        - fileName
      type: object
      properties:
        fileName:
          maxLength: 256
          minLength: 0
          type: string
          description: Full name of the file including the file extension
          example: court filing.pdf
        folderId:
          type: string
          description: >-
            Unique identifier of the folder to add the file to. If null it will
            be placed in the root folder
          nullable: true
          example: b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2
        userId:
          type: string
          description: >-
            Unique identifier of the user modifying the file. If null it will
            fallback to the authenticated user
          nullable: true
          example: 750eb5c5-ac0b-7d11-4997-e0ce9d8896c8
        fileAdditionalData:
          type: object
          additionalProperties:
            nullable: true
          description: Collection of KeyValuePair(string, string) to update File meta data.
          nullable: true
        isFavorite:
          type: boolean
          description: >-
            Flag indicating whether this file is a favorite. If null it will be
            ignored
          nullable: true
      additionalProperties: false
    UploadFileInfo:
      type: object
      properties:
        fileId:
          type: string
          description: Unique identifier of the file.
          nullable: true
          example: b471682e-fa17-4e46-b7fe-9b2b8fdcb3c2
        uploadUrl:
          type: string
          description: "Temporary Link to upload file.\r\n\r\nImportant note: When uploading to this URL, set the 'Content-Type' header to an empty value.\r\n\r\nExample cURL: curl --location --request PUT 'URL_GOES_HERE' \\ --header 'Content-Type: \"\"' \\ --data '@/C:/dir/test.pdf'"
          nullable: true
          example: ''
        expiry:
          type: string
          description: Expiry date/time when the upload link is no longer accessible.
          format: date-time
          example: '2022-04-23T14:30:00Z'
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
  securitySchemes:
    api-key:
      type: apiKey
      name: x-api-key
      in: header
    token:
      type: apiKey
      name: Authorization
      in: header
      x-amazon-apigateway-authtype: cognito_user_pools

````