---
title: "Restore a Drive file to a prior generation (API)"
method: POST
path: "/v3/drive/files/restore"
tags: ["v3", "Drive"]
---

# Restore a Drive file to a prior generation (API)

`POST /v3/drive/files/restore`

Restore a Drive file to a prior generation. Authenticate with your API key
    in the Authorization header: `Authorization: Bearer <your-api-key>`.

## 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` — Invalid or missing API key
- `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)
