---
title: "Restore a Drive file to a prior generation"
method: POST
path: "/v3/teams/{team_id}/drive/files/restore"
tags: ["v3", "Drive"]
---

# Restore a Drive file to a prior generation

`POST /v3/teams/{team_id}/drive/files/restore`

Restore a Drive file to a previously retained GCS generation.

    The restore is atomic: GCS uses `if_generation_match` against the current
    live generation, so a half-restored read is impossible. The chosen
    generation is copied on top of the live path, becoming the new live
    generation while the prior live generation is retained as noncurrent.

## Path parameters

- `team_id` string, required

## Request body

- DriveRestoreRequest — Request body for restoring a Drive file to a prior generation.
  - `path` string, required — Drive-relative path of the file to restore
  - `generation` integer, required — GCS generation ID to restore as the new live version

## Response `200`

File restored successfully

- DriveRestoreResponse — Response after a successful Drive file restore.
  - `path` string, required — Drive-relative path that was restored
  - `new_generation` integer, required — New live generation ID after the restore
  - `restored_from` integer, required — Generation ID that was promoted to live
  - `updated` string, date-time, required — Timestamp of the new live generation
  - `size_bytes` integer, required — Size of the restored file in bytes

## Other responses

- `400` — Invalid path
- `403` — Cannot access files outside your team
- `404` — File not found
- `422` — Validation Error
- `500` — Failed to restore file

---

[API](https://skmtc.dev/definite/apis/defapi.md) · [All operations](https://skmtc.dev/definite/apis/defapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/definite/defapi/revisions/5ea378187147/schema)
