Skip to main content
POST
Permanently delete a trashed workflow
The reference panel describes the current v3 operation. The notes below describe its v2 compatibility API. Follow the v3 request schema for current calls: v3 can move identifiers from the body or query into the URL. Keep the v2 method, path, and payload together when using the compatibility API.

v2 compatibility notes

POST /api/v2/workflows/purge returns {workflowId, deletedVersions, deletedDrafts, deletedNodes, deletedEdges}.

Authentication

External App credential or platform API key, or a Personal key. Requires permission workflows:manage (an elevated permission) held at the workflow’s home, as the Console decides it; otherwise 403, recorded, and nothing is written. Forge agents can never hold workflows:manage. Because the success answers a read, the credential’s scopes must include workflows:read as well (otherwise 403 naming it), and the workflow must be readable at its home (otherwise 404). A Personal key acts as its owner, narrowed by its scopes; an External App or platform key acts as itself. The change is stored and audited with that actor (for an app or platform key, with who granted it), under the Console’s own audit events.

Behavior

Deletes the trashed workflow with its versions, draft, nodes and edges. Its triggers, asset bindings and runs are kept. Irreversible. A live workflow answers 409 invalid_state (trash it first), as does one with a run in flight. A very large workflow can exceed one write and answer 500.

Idempotency

A same-key retry returns the recorded result while you still hold the route’s permissions (Stored-response replay), and the purge never runs twice. Without a key, read the workflow to learn the outcome (404 once purged).

Authorizations

Authorization
string
header
required

An External App: the JWT it obtains from POST /oauth/token with OAuth2 client_credentials. Pass as Authorization: Bearer <jwt>. An app's static companion key also authenticates as the app, but is deprecated and is not protected by Idempotency-Key.

Headers

Idempotency-Key
string

Optional logical intent key. A same-key retry within 24 hours returns the recorded result without writing again.

Required string length: 1 - 255

Path Parameters

workflowId
string
required

The workflow.

Minimum string length: 1

Response

Success

data
object
required
meta
object
required