---
title: "Update a file"
method: PATCH
path: "/files/{id}"
tags: ["files"]
---

# Update a file

`PATCH /files/{id}`

Updates a file by ID.

## Path parameters

- `id` string, cuid, required — The ID of the item

## Headers

- `x-client-id` string, cuid, required — The ID of the client

## Request body

- FileUpdate
  - `name` string — The name of the file
  - `documentDate` string, date-time — The date of the document (not the upload date). ISO-8601 format (YYYY-MM-DDTHH:MM:SSZ).
  - `folderId` string, cuid — The ID of the folder to place the file in

## Response `200`

File updated successfully

- File
  - `id` string, cuid, required — The ID of the file
  - `documentDate` string, date-time, nullable, required — The date of the document (not the upload date)
  - `createdAt` string, date-time, required — The date and time of the creation for the file. ISO-8601 format (YYYY-MM-DDTHH:MM:SSZ).
  - `updatedAt` string, date-time, required — The date and time of the last update for the file. ISO-8601 format (YYYY-MM-DDTHH:MM:SSZ).
  - `name` string, required — The name of the file
  - `mimetype` string, required — The mime type of the file
  - `size` number, required — The size of the file in bytes
  - `workspaceId` string, cuid, required — The ID of the workspace
  - `createdById` string, cuid, nullable, required — The ID of the creator
  - `taskId` string, cuid, nullable, required — The ID of the task this file was uploaded to.
  - `folderId` string, cuid, nullable, required — The ID of the folder this file was uploaded to.
  - `labelIds` string[], nullable, required — The IDs of the assigned labels

## Other responses

- `401` — Unauthorized
- `404` — File not found
- `422` — The validation error(s)
- `429` — Rate limit exceeded
- `500` — Internal server error

---

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