> ## Documentation Index
> Fetch the complete documentation index at: https://developer.opus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Archive a Workflow

> Archive a workflow, removing it from listings

Archive a workflow. Archiving removes it from listings; it does not delete the workflow or its version history, and [Restore a Workflow](/api-reference/v1-workflow-generation/restore-workflow) brings it back.

Requires the **Workflow: Full** permission on the workflow.

<Warning>
  A workflow that still has an **active version cannot be archived** — the call returns `400` with `WF_HAS_ACTIVE_VERSIONS`. Deactivate the workflow first by setting `activeStatus` to `inactive` via [Update a Workflow](/api-reference/v1-workflow-generation/update-workflow), then archive it.
</Warning>

## Path Parameters

<ParamField path="workflowId" type="string" required>
  The ID of the workflow to archive
</ParamField>

## Headers

<ParamField header="x-service-key" type="string" required>
  Your API authentication key
</ParamField>

## Response

<ResponseField name="workflowId" type="string" required>
  The workflow ID that was archived — the same ID you supplied in the path
</ResponseField>

<ResponseField name="isArchived" type="boolean" required>
  Archive status after the call. Always `true` on a 2xx response.
</ResponseField>

<ResponseField name="archivedAt" type="string">
  When the workflow was archived, ISO 8601. `null` if unknown.
</ResponseField>

<ResponseField name="archivedBy" type="string">
  Display name of the user who archived the workflow. `null` if unknown.
</ResponseField>

<Note>
  Archiving is idempotent. Archiving a workflow that is already archived succeeds and changes nothing — and `archivedAt` returns the **original** archive time, not the time of the repeat call.
</Note>

## Errors

<ResponseField name="400" type="Bad Request">
  The workflow still has an active version (`WF_HAS_ACTIVE_VERSIONS`) — deactivate it before archiving.
</ResponseField>

<ResponseField name="401" type="Unauthorized">
  Missing, invalid, or expired API key.
</ResponseField>

<ResponseField name="403" type="Forbidden">
  No access to this workflow.
</ResponseField>

<ResponseField name="404" type="Not Found">
  The workflow does not exist.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request DELETE \
    --url https://operator.opus.com/api/v1/workflow/{YOUR_WORKFLOW_ID} \
    --header 'x-service-key: {YOUR_SERVICE_KEY}'
  ```

  ```python Python theme={null}
  import requests

  response = requests.delete(
      "https://operator.opus.com/api/v1/workflow/{YOUR_WORKFLOW_ID}",
      headers={"x-service-key": "{YOUR_SERVICE_KEY}"},
  )

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://operator.opus.com/api/v1/workflow/{YOUR_WORKFLOW_ID}",
    {
      method: "DELETE",
      headers: { "x-service-key": "{YOUR_SERVICE_KEY}" },
    }
  );

  const data = await response.json();
  console.log(data);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Response theme={null}
  {
    "workflowId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "isArchived": true,
    "archivedAt": "2026-01-15T10:30:00.000Z",
    "archivedBy": "Ada Lovelace"
  }
  ```

  ```json 400 Active Version theme={null}
  {
    "statusCode": 400,
    "message": "WF_HAS_ACTIVE_VERSIONS"
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.