Delete a workflow version¶
Permanently deletes a draft version record under the specified workflow. Versions in published or deprecated status cannot be deleted; to retire a published version, call Deprecate a workflow version.
DELETE https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/{workflow_id}/versions/{version_id}
Before you begin¶
Prepare a personal access token with workflow version delete permission and the target workspace ID.
Call List workflow versions or Get workflow version details to verify that the target version
Statusisdraftand confirm that the workflow is not managed by an agent automation task.
Request parameters¶
Replace $AI_STUDIO_API_KEY, $WORKSPACE_ID, $WORKFLOW_ID, and $VERSION_ID with actual values.
curl -X DELETE "https://api.moi.matrixorigin.cn/v5/workflow/v2/workflow-apps/$WORKFLOW_ID/versions/$VERSION_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Target workflow ID, obtained from List workflows. |
|
string |
Yes |
Draft version ID to delete ( |
Successful response¶
Returns HTTP 200 and confirms that the draft version record has been deleted.
{
"code": "OK",
"msg": "OK",
"data": {
"deleted": true
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
Result message; |
|
object |
Deletion result object. |
|
boolean |
Whether the version record has been deleted; |
Error response¶
Returns 404 (ErrNotFound) when the workflow does not exist, the version does not exist (including repeated deletion), or the version does not belong to the target workflow definition, and 409 (ErrWorkflowUpdateManagedByAutomation) when the workflow is managed by an agent automation task. Calling this endpoint on a published or deprecated version fails because only draft versions can be deleted.
{
"code": "ErrNotFound",
"msg": "Not Found"
}
Field |
Type |
Description |
|---|---|---|
|
string |
Error code, such as |
|
string |
Human-readable error message. |