# Duplicate a Workstream

> Copies a workstream into a new draft, so an accountant can adapt a trusted process for another client or period without touching the original. It needs…

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

Copies a workstream into a new draft, so an accountant can adapt a trusted process for another client or period without touching the original. It needs the workstream_id to copy and accepts an optional new_name. It returns the identifier, permakey and name of the new copy.

Body parameters

workstream_id string Required

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

new_name string

Name for the copy (defaults to 'Copy of <original>')

Returns

Skill executed successfully

skill string Required

Example workstream_duplicate

output object Required

output.stub_fields array of strings

output.warnings array of strings

output.workstream_id string · default

The NEW copy's permakey (the public id).

output.permakey string · default

7-char public id of the copy.

output.name string · default

output.error string

missing_workspace | not_found 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 ← 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/)[Next List Workstreams Visible to the Caller →](https://heyarchie.com/en-gb/developers/api-reference/workstreams/list-workstreams-visible-to-the-caller/)

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

```
from heyarchie import Archie
archie = Archie(api_key="sk_...")
result = archie.skills.invoke(
    "workstream.duplicate",
    workstream_id="string",
    new_name=None,
)
print(result)
```

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

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

Response

```
{
  "skill": "workstream_duplicate",
  "output": {
    "name": "Month-end close (NZ)",
    "permakey": "q4n8d2c",
    "workstream_id": "q4n8d2c"
  },
  "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.
