# Promote a Workstream Draft

> Promotes a draft to an active workstream. Supply the draftid of a draft that passes validation, and the reply gives the workstreamid, the permakey and…

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

Promotes a draft to an active workstream. Supply the `draft_id` of a draft that passes validation, and the reply gives the `workstream_id`, the `permakey` and the `status`. If validation fails the commit is refused and the draft stays a draft.

Body parameters

draft_id string · uuid Required

The draft id from `workstream_draft.draft_id`.

scope enum · default firm

Authoring scope for the committed workstream.

user team firm

name string

Optional final name. Defaults to the draft's working name. Cannot collide with another active workstream in the workspace.

idempotency_key string

Caller-supplied stable token. Replaying within 24h returns the previously-created workstream id rather than erroring on the name collision.

Returns

Skill executed successfully

skill string Required

Example workstream_commit

output object Required

Pointer to the committed workstream.

output.stub_fields array of strings

output.warnings array of strings

output.workstream_id string · uuid

Newly-created workstream id.

output.permakey string · default

7-char human-friendly id for URLs and Slack.

output.status enum · default active

`active` on success; `draft` if commit failed validation and the draft still exists.

draft active

output.error string Deprecated

output.error_envelope

Canonical structured error. Populated when commit failed.

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 ← Draft a New Workstream Conversationally](https://heyarchie.com/en-gb/developers/api-reference/authoring/draft-a-new-workstream-conversationally/)[Next Specify a WorkStream Before Drafting Its Steps →](https://heyarchie.com/en-gb/developers/api-reference/authoring/specify-a-workstream-before-drafting-its-steps/)

```
curl https://uk.heyarchie.com/api/v1/skills/workstream.commit/invoke \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{
       "draft_id": "00000000-0000-0000-0000-000000000000",
       "scope": "user",
       "name": null,
       "idempotency_key": null
     }'
```

```
from heyarchie import Archie
archie = Archie(api_key="sk_...")
result = archie.skills.invoke(
    "workstream.commit",
    draft_id="00000000-0000-0000-0000-000000000000",
    scope="user",
    name=None,
    idempotency_key=None,
)
print(result)
```

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

const archie = new Archie({ apiKey: "sk_..." });
const result = await archie.skills.invoke("workstream.commit", {
  "draft_id": "00000000-0000-0000-0000-000000000000",
  "scope": "user",
  "name": null,
  "idempotency_key": null
});
console.log(result);
```

Response

```
{
  "skill": "workstream_commit",
  "output": {
    "permakey": "ws4k8n2",
    "status": "active",
    "workstream_id": "c4d19a72-0e3b-4586-b7f1-8a2d5e6c9b04"
  },
  "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.
