DELETE /{workflowId} needs workflowBuilder.POST /{workflowId}/undeploy first when the intent is to stop it rather than remove it.Authorization: Bearer <API_KEY> with workflowBuilder, on a workflow of the key's community. If-Match is optional. Send the revision you read and a stale value is refused with 409 VERSION_CONFLICT instead of deleting a workflow someone else has changed since; omit it and the delete applies as the last write. Deleting a deployed workflow needs no extra header: the delete applies immediately.| Failure | Meaning | Recovery |
|---|---|---|
409 VERSION_CONFLICT | Someone changed or already deleted it since your read | Re-read; if it is gone, the delete is effectively done. |
{
"data": {
"id": "65f1a2b3c4d5e6f708192a3b",
"deleted": true
}
}200 with data.deleted: true. There is nothing left to read back on the workflow itself, so prove the delete with the list: GET / must no longer contain that _id, and GET /{workflowId} must answer 404 WORKFLOW_NOT_FOUND. Runs of the workflow are removed with it, so GET /{workflowId}/runs also answers 404.| Status and code | When | Recovery |
|---|---|---|
400 VALIDATION_FAILED | The id is not 24 hexadecimal characters | Use the id exactly as returned. |
401 AUTHENTICATION_REQUIRED | No key, or an unknown key | Send a valid key. |
403 API_KEY_PERMISSION_DENIED | No workflowBuilder | Grant the permission. |
404 WORKFLOW_NOT_FOUND | Unknown id, or another community's workflow | Nothing to delete; confirm with the list. |
409 VERSION_CONFLICT | You sent an If-Match that is not the current revision | Re-read; retry only if the workflow still exists. |
409 WORKFLOW_LOCKED | Another write to this workflow is in progress | Re-read; retry only if the workflow still exists. |
429 RATE_LIMITED | The community's API rate limit was reached | Wait for the window to reset, then retry. |
500 INTERNAL_ERROR | Unexpected failure | Re-read before retrying: a partial cascade is possible on a database failure, and the workflow may already be gone. |
503 LOCK_UNAVAILABLE | The write lock store did not answer, so nothing was written | Retry shortly. |
404 rather than deleting something else. Do not switch to a new id to "make the delete work": confirm with GET / which id still exists.GET /{workflowId}/runs before deleting.GET / to confirm the workflow is gone.POST / to recreate it from an export if it was deleted by mistake.POST /{workflowId}/undeploy first, when the target is still deployed.curl --location --request DELETE 'https://api.returning.ai/v1/workflow-builder/data-workflows/65f1a2b3c4d5e6f708192a3b' \
--header 'Authorization: Bearer <API_KEY>' \
--header 'If-Match: 162af81f5de4ff2b557a4087de9a9a73a0ed4e621f737787e35a93614cb50d1c'{
"data": {
"id": "65f1a2b3c4d5e6f708192a3b",
"deleted": true
}
}