---
title: "Revert File to version"
method: POST
path: "/api/v3/file/{file_id}:revert"
tags: ["File"]
---

# Revert File to version

`POST /api/v3/file/{file_id}:revert`

## Request

- Base URL: `https://{tenant_name}.benchling.com`
- URL: `https://{tenant_name}.benchling.com/api/v3/file/{file_id}:revert`
- Auth: HTTP bearer

Publish a new version of a File whose content copies an earlier version. The earlier version stays in the File's history and the new version becomes current. `expectedVersionId` must be the File's current version; the revert is rejected if another version has been published since. Reverting to the current version is rejected.

## Path parameters

- `file_id` string, required

## Request body

- RevertFileInput
  - `expectedVersionId` string, required
  - `fileVersionId` string, required

## Response `200`

OK

- File: A File represents an uploaded document or data file that is surfaced in Benchling's Data Catalog for discovery and organization. Files are primarily created through Benchling Connect (for external file integrations) and the Analysis Tool (for pipeline outputs). Each File is backed by a ScratchFile containing the actual binary content and upload state. Files are folder-based items that can be starred for quick access, linked to Studies, and support custom fields. Files differ from EntryExternalFile (attachments within notebook entries) and Blob (raw binary storage) in that they are first-class data catalog items with full metadata and discovery capabilities.
  - `__typename` string
  - `archiveReason` string, nullable
  - `archived` boolean
  - `createdAt` string, datetime
  - `creator` PrincipalRef
    - `__typename` string
    - `id` string, api_id
  - `currentVersionId` string, nullable
  - `customFields` CustomField[], nullable
    - `__typename` string
    - `name` string, nullable
    - `value` string, nullable
  - `displayId` string, nullable
  - `externalFileId` string, nullable: Use scratchFile to access externalFileId.
  - `filename` string, nullable: Use scratchFile to access filename.
  - `folder` FolderRef
    - `__typename` string
    - `id` string, api_id
  - `id` string
  - `mimeType` string, nullable: Use scratchFile to access mimeType.
  - `modifiedAt` string, datetime
  - `name` string, nullable
  - `scratchFile` ScratchFileRef
    - `__typename` string
    - `id` string, api_id
  - `versions` string, uri: Published versions of the File, newest first.

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `429`: Too Many Requests
- `500`: Internal Server Error

---

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