---
title: "Overwrite Flow"
method: POST
path: "/api/v1/flows/{flow_id}/overwrite"
tags: ["Flows"]
---

# Overwrite Flow

`POST /api/v1/flows/{flow_id}/overwrite`

## Request

- The document declares no server URL.
- Auth: one of:
  - OAuth 2
    - Password
    - Token URL: `api/v1/login`
  - API key in query parameter `x-api-key`
  - API key in header `x-api-key`

Replace a flow with a merged graph, keeping the replaced version in history.

This is the deliberate half of the conflict dialog, and it is still guarded.
The caller sends the token it *reviewed*, not the stale one it was refused on
and not nothing at all: writing unconditionally here would silently discard a
fourth writer who landed while the dialog was open, reopening the lost update
the whole feature exists to close. So the meaning is "replace the version I
just looked at", and a flow that moved again is refused with a fresh 409.

The archived entry is attributed to whoever last wrote the flow rather than to
the caller, because it is their work being replaced -- attributing it here
would put the caller's name on someone else's version and defeat the point of
keeping it.

The write right is claimed before anything is archived. Archiving first and
letting the refusal roll it back does not work: version entries are written in
a ``begin_nested()`` savepoint that survives the outer rollback, so a refused
overwrite left an orphan version in someone's history. Claiming first means a
stale caller is turned away before a single row is written.

## Path parameters

- `flow_id` string, uuid, required

## Headers

- `If-Match` string, nullable

## Request body

- FlowOverwrite: The merged graph a person chose to write over the version they reviewed.
  - `data` object, required

## Response `200`

Successful Response

- FlowRead
  - `a2a_card_overrides` object, nullable: User overrides for the generated A2A agent card (skill description, examples, tags)
  - `a2a_enabled` boolean, nullable: Can be exposed as an A2A agent (only meaningful when flow_type=agent)
  - `access_type` 'PRIVATE' | 'PUBLIC'
  - `action_description` string, nullable: The description of the action associated with the flow
  - `action_name` string, nullable: The name of the action associated with the flow
  - `data` object, nullable
  - `description` string, nullable
  - `endpoint_name` string, nullable
  - `flow_type` 'workflow' | 'agent'
  - `folder_id` string, uuid, nullable, required
  - `gradient` string, nullable
  - `icon` string, nullable
  - `icon_bg_color` string, nullable
  - `id` string, uuid, required
  - `is_component` boolean, nullable
  - `locked` boolean, nullable
  - `mcp_enabled` boolean, nullable: Can be exposed in the MCP server
  - `name` string, required
  - `name_key` string, nullable: Stable i18n key derived from the original English name
  - `tags` string[], nullable: The tags of the flow
  - `updated_at` string, date-time, nullable
  - `user_id` string, uuid, nullable, required
  - `version_token` string, uuid, nullable: Token identifying the version this response carries
  - `webhook` boolean, nullable: Can be used on the webhook endpoint
  - `workspace_id` string, uuid, nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-21** `4349fbe90c64`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/langflow-ai/apis/langflow/changes/api/v1/flows/:flow_id/overwrite/post.md)

---

[API](https://skmtc.dev/langflow-ai/apis/langflow.md) - [All operations](https://skmtc.dev/langflow-ai/apis/langflow/llms.txt) - [OpenAPI document](https://skmtc.dev/langflow-ai/apis/langflow/revisions/4349fbe90c64?raw)
