---
title: "Undo Draft"
method: POST
path: "/v3/workflow-editor/drafts/{workflow_id}/undo"
tags: ["workflow-editor"]
---

# Undo Draft

`POST /v3/workflow-editor/drafts/{workflow_id}/undo`

## Request

- Base URL: `https://api.mentium.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mentium.io/v3/workflow-editor/drafts/{workflow_id}/undo`
- Auth: HTTP bearer

Undo the last change to a workflow draft.

Returns the restored YAML content and the undone YAML (for redo on frontend).

## Path parameters

- `workflow_id` string, uuid, required

## Headers

- `mentium-workspace-id` string, nullable

## Response `200`

Successful Response

- UndoResponseOut: Response from undo operation.
  - `draft_id` string, required
  - `yaml_content` string, required: Restored YAML content
  - `undone_yaml` string, required: The YAML that was undone (for redo)
  - `can_undo` boolean, required: Whether more undos are available

## Other responses

- `422`: Validation Error

---

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