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

# Update a file

`PATCH /files/{file_id}`

## Request

- Base URL: `https://{tenant_name}.benchling.com/api/v2`
- URL: `https://{tenant_name}.benchling.com/api/v2/files/{file_id}`
- Auth: HTTP bearer

Update a file. After you upload the file contents to S3, call this endpoint to mark the upload as `SUCCEEDED`. See [Create a file](https://docs.benchling.com/docs/api/v2/benchling-api/files/create-file) for documentation of the full upload flow.

## Path parameters

- `file_id` string, required

## Request body

- FileUpdate
  - `customFields` CustomFields
  - `errorMessage` string: Error message for the file upload
  - `folderId` string: ID of the folder that the file is moved into
  - `uploadStatus` 'SUCCEEDED' | 'FAILED_VALIDATION'

## Response `200`

OK

- File
  - `errorMessage` string, nullable
  - `uploadStatus` 'IN_PROGRESS' | 'SUCCEEDED' | 'FAILED_VALIDATION' | 'NOT_UPLOADED'
  - `archiveRecord` ArchiveRecord
    - `reason` string
  - `createdAt` string, date-time: Date and time the file was created
  - `creator` FileCreator: UserSummary of the user who created the file
    - `handle` string
    - `id` string
    - `name` string
  - `customFields` CustomFields
  - `displayId` string: User-friendly ID of the file
  - `filename` string
  - `folderId` string: ID of the folder that contains the file
  - `id` string
  - `modifiedAt` string, date-time: Date and time the file was last modified
  - `name` string

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found

---

[API](https://skmtc.dev/benchling/apis/benchling-api-2.md) - [All operations](https://skmtc.dev/benchling/apis/benchling-api-2/llms.txt) - [OpenAPI document](https://skmtc.dev/benchling/apis/benchling-api-2/revisions/01d2fa8523cd?raw)
