---
title: "Bring one earlier saved version of a Hive automation back as the current DRAFT. Nothing is erased and nothing goes live: setting it live is a separate step a person approves in Hive."
method: POST
path: "/api/v1/tools/restore_flow_version"
---

# Bring one earlier saved version of a Hive automation back as the current DRAFT. Nothing is erased and nothing goes live: setting it live is a separate step a person approves in Hive.

`POST /api/v1/tools/restore_flow_version`

## Request

- Base URL: `https://hivepublish.com`
- URL: `https://hivepublish.com/api/v1/tools/restore_flow_version`
- Auth: HTTP bearer

## Headers

- `Idempotency-Key` string, required

## Request body

- object
  - `flowId` string, required: The Hive automation to restore into.
  - `versionId` string, required: The version to restore, from read_flow_versions.
  - `expectedDraftVersionId` string: The draftVersionId read_flow_document returned, or leave it out when there is no draft.
  - `expectedDraftRevision` integer: The revision read_flow_document returned, or leave it out when there is no draft.

## Response `200`

Tool result

- ToolResult
  - `data` unknown, required
  - `meta` object, required
    - `tool` string
    - `workspaceId` string, uuid

## Other responses

- `400`: Invalid input
- `401`: Missing or invalid credential
- `403`: Missing workspace scope, role permission, or plan entitlement
- `409`: Idempotency conflict, replay, or request still in progress
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/hivepublish/apis/hive-developer-api.md) · [All operations](https://skmtc.dev/hivepublish/apis/hive-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hivepublish/apis/hive-developer-api/revisions/b440c763583e?raw)
