# Delete a Workstream

> Removes a workstream from listings, so an accountant can retire a process that is no longer used. It needs the workstreamid and confirm set to true, and…

POST /api/v1/skills/workstream.delete/invoke

Removes a workstream from listings, so an accountant can retire a process that is no longer used. It needs the workstream_id and confirm set to true, and a person is asked to confirm before Archie deletes anything. It refuses while a cycle of the workstream is still in progress, and it returns the workstream_id, whether it was deleted and its status.

Body parameters

workstream_id string Required

Workstream UUID, slug, or 7-char permakey to delete

confirm boolean · default false

Explicit confirmation. Must be true to proceed — a delete with confirm=false is refused (error='confirmation_required'), so an accidental call is a safe no-op.

Returns

Skill executed successfully

skill string Required

Example workstream_delete

output object Required

output.stub_fields array of strings

output.warnings array of strings

output.workstream_id string · default

The deleted workstream's permakey (the public id).

output.deleted boolean · default false

True when the workstream was soft-deleted.

output.status string · default

The workstream's status after the call (e.g. 'deleted').

output.error string

missing_workspace | not_found | confirmation_required | has_active_cycles on failure, else null

correlation_id string Required

Errors

Status Type When

401 AUTH.TOKEN_INVALID Authentication required

403 PERMISSION.CAPABILITY_DENIED Insufficient permissions

404 SKILL.NOT_FOUND Skill not found

422 VALIDATION.INVALID_FORMAT Validation error

429 RATE_LIMIT.USER Rate limit exceeded

5XX INTERNAL.UNKNOWN Internal server error

[Previous ← Cancel a Running Workstream Run](https://heyarchie.com/en-gb/developers/api-reference/workstreams/cancel-a-running-workstream-run/)[Next Describe a Workstream by Id, Slug, or Permakey →](https://heyarchie.com/en-gb/developers/api-reference/workstreams/describe-a-workstream-by-id-slug-or-permakey/)

```
curl https://uk.heyarchie.com/api/v1/skills/workstream.delete/invoke \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{
       "workstream_id": "string",
       "confirm": false
     }'
```

```
from heyarchie import Archie
archie = Archie(api_key="sk_...")
result = archie.skills.invoke(
    "workstream.delete",
    workstream_id="string",
    confirm=False,
)
print(result)
```

```
import { Archie } from "heyarchie";

const archie = new Archie({ apiKey: "sk_..." });
const result = await archie.skills.invoke("workstream.delete", {
  "workstream_id": "string",
  "confirm": false
});
console.log(result);
```

Response

```
{
  "skill": "workstream_delete",
  "output": {
    "deleted": true,
    "status": "deleted",
    "workstream_id": "k7m2p9x"
  },
  "correlation_id": "<string>"
}
```

```
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "retry_after_seconds": "<integer>"
  }
}
```

Every response also carries X-Request-ID. Quote it if you write to us about a call.
