---
title: "Add file to a matter"
method: POST
path: "/matters/{matterId}/documents/files"
tags: ["Files"]
---

# Add file to a matter

`POST /matters/{matterId}/documents/files`

Uploads a new file for the specified matter.

## Path parameters

- `matterId` string, required

## Request body

- AddFileDto
  - `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 file owner. If null it will fallback to the authenticated user
  - `folderPath` string, nullable — Path of the folder to add the file to. If null then the FolderId will be used
  - `fileAdditionalData` object, nullable — Collection of KeyValuePair(string, string) to update File meta data.
  - `dateCreated` string, date-time, nullable — The original datetime that the file was created. If null the current datetime will be used
  - `dateModified` string, date-time, nullable — The initial datetime that the file was last modified. If null the current datetime will be used

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

---

[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)
