Talk with Archie
API reference › WorkStreams
API reference › WorkStreams

Duplicate a Workstream

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_idstringRequired
Workstream UUID, slug, or 7-char permakey to copy
new_namestring
Name for the copy (defaults to 'Copy of <original>')
Returns

Skill executed successfully

skillstringRequired
Example workstream_duplicate
outputobjectRequired
output.stub_fieldsarray of strings
output.warningsarray of strings
output.workstream_idstring · default
The NEW copy's permakey (the public id).
output.permakeystring · default
7-char public id of the copy.
output.namestring · default
output.errorstring
missing_workspace | not_found on failure, else null
correlation_idstringRequired
Errors
StatusTypeWhen
401AUTH.TOKEN_INVALIDAuthentication required
403PERMISSION.CAPABILITY_DENIEDInsufficient permissions
404SKILL.NOT_FOUNDSkill not found
422VALIDATION.INVALID_FORMATValidation error
429RATE_LIMIT.USERRate limit exceeded
5XXINTERNAL.UNKNOWNInternal server error
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>"
  }
}
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "retry_after_seconds": "<integer>"
  }
}
{
  "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.