---
title: "Patch a file"
method: PATCH
path: "/matters/{matterId}/documents/files/{fileId}"
tags: ["Files"]
---

# Patch a file

`PATCH /matters/{matterId}/documents/files/{fileId}`

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

## Path parameters

- `matterId` string, required
- `fileId` string, required

## Request body

- EditFileDto
  - `fileName` string, required — Full name of the file including the file extension
  - `folderId` string, nullable — Unique identifier of the folder to add the file to. If null it will be placed in the root folder
  - `userId` string, nullable — Unique identifier of the user modifying the file. If null it will fallback to the authenticated user
  - `fileAdditionalData` object, nullable — Collection of KeyValuePair(string, string) to update File meta data.
  - `isFavorite` boolean, nullable — Flag indicating whether this file is a favorite. If null it will be ignored

## Response `202`

When request is accepted. Returns an 'UploadFileInfo' object.

- UploadFileInfo
  - `fileId` string, nullable — Unique identifier of the file.
  - `uploadUrl` string, nullable — Temporary Link to upload file. Important note: When uploading to this URL, set the 'Content-Type' header to an empty value. Example cURL: curl --location --request PUT 'URL_GOES_HERE' \ --header 'Content-Type: ""' \ --data '@/C:/dir/test.pdf'
  - `expiry` string, date-time — Expiry date/time when the upload link is no longer accessible.

## Other responses

- `400` — When an unsupported request is made.
- `404` — When file or matter with the specified id does not exist.

---

[API](https://skmtc.net/smokeball/apis/api.md) · [All operations](https://skmtc.net/smokeball/apis/api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smokeball/api/versions/197984da9b42/schema)
