v1

latestOpenAPI 3.1.12026-07-124448163.2 KB
files

Update a file

Updates a file by ID.

patch/files/{id}

Path parameters

idstring cuid required

The ID of the item

Example:cmf41ajzv003706un4i99q19z

Headers

x-client-idstring cuid required

The ID of the client

Example:cmf41ajzv003706un4i99q19z

Request body

namestring

The name of the file

documentDatestring date-time

The date of the document (not the upload date). ISO-8601 format (YYYY-MM-DDTHH:MM:SSZ).

folderIdstring cuid

The ID of the folder to place the file in

Example request

{
  "name": "document.pdf",
  "documentDate": "2021-01-01T00:00:00Z",
  "folderId": "cmf41ajzv003706un4i99q19z"
}

Response

File updated successfully

idstring cuid required

The ID of the file

documentDatestring date-time nullable required

The date of the document (not the upload date)

createdAtstring date-time required

The date and time of the creation for the file. ISO-8601 format (YYYY-MM-DDTHH:MM:SSZ).

updatedAtstring date-time required

The date and time of the last update for the file. ISO-8601 format (YYYY-MM-DDTHH:MM:SSZ).

namestring required

The name of the file

mimetypestring required

The mime type of the file

sizenumber required

The size of the file in bytes

workspaceIdstring cuid required

The ID of the workspace

createdByIdstring cuid nullable required

The ID of the creator

taskIdstring cuid nullable required

The ID of the task this file was uploaded to.

folderIdstring cuid nullable required

The ID of the folder this file was uploaded to.

labelIdsstring[] nullable required

The IDs of the assigned labels

Example response

{
  "id": "cmf41ajzv003706un4i99q19z",
  "documentDate": "2021-01-01T00:00:00Z",
  "createdAt": "2021-01-01T00:00:00Z",
  "updatedAt": "2021-01-01T00:00:00Z",
  "name": "document.pdf",
  "mimetype": "application/pdf",
  "size": 1024,
  "workspaceId": "cmf41ajzv003706un4i99q19z",
  "createdById": "cmf41ajzv003706un4i99q19z",
  "taskId": "cmf41ajzv003706un4i99q19z",
  "folderId": "cmf41ajzv003706un4i99q19z",
  "labelIds": [
    "cmf41ajzv003706un4i99q19z"
  ]
}