Create a Work Item Enhance run

Creates a proposal-first enhancement run for one canonical work item and immediately returns generated drafts/artifacts for review. The run does not mutate the work item until selected drafts are explicitly applied.

POST/api/v1/work-item-enhancements

Authorization

work-item-enhance:runapi key scoperequired
Required scope when calling with an API key.

Request body

targetobjectrequired
Target work item: { type: "work_item", id }.
actionsarrayrequired"requirements" | "description" | "design" | "code_context" | "implementation_plan" | "acceptance_criteria" | "test_plan" | "estimate" | "risk_check"
Enhancement actions to run. Including code_context also requires work-item-enhance:code-context.
instructionsstringoptional
Optional caller guidance for generated drafts/artifacts.
confirmbooleanrequired
Must be true.
Example request
{
  "target": {
    "type": "work_item",
    "id": "work_01k2..."
  },
  "actions": [
    "requirements",
    "description",
    "implementation_plan",
    "acceptance_criteria"
  ],
  "instructions": "Prepare this for an engineer to start tomorrow.",
  "confirm": true
}

Request

curl -X POST "https://www.digitalstack360.com/api/v1/work-item-enhancements" \
  -H "Authorization: Bearer $DS_API_KEY" \
  -H "Idempotency-Key: enhance-work-42-v1" \
  -H "Content-Type: application/json" \
  -d '{"target":{"type":"work_item","id":"work_01k2..."},"actions":["requirements","description","implementation_plan","acceptance_criteria"],"instructions":"Prepare this for an engineer to start tomorrow.","confirm":true}'

Examples use a placeholder key from your environment. Store your key in $DS_API_KEY — never commit it.

Response

200 OK
{
  "data": {
    "id": "wie_01k6...",
    "state": "needs_review",
    "target": {
      "type": "work_item",
      "id": "work_01k2...",
      "key": "DSN-42",
      "title": "Implement board projection API",
      "version": "2026-07-15T14:22:04Z"
    },
    "requested_actions": [
      "requirements",
      "description"
    ],
    "drafts": [
      {
        "id": "draft_01k6...",
        "action": "description",
        "field": "description",
        "apply_eligible": true
      }
    ],
    "artifacts": []
  },
  "meta": {
    "idempotency_replayed": false
  }
}

Errors

401
missing_auth

No credentials provided

401
invalid_api_key

API key is invalid or revoked

400
bad_request

Missing or invalid request fields

403
scope_insufficient

Key lacks the required write scope

404
target_not_found

Target work item does not exist or is outside the resolved workspace

400
action_not_allowed

Requested action is not in the v1 allowlist

400
confirmation_required

confirm must be true

400
idempotency_key_required

Idempotency-Key header is required

403
scope_insufficient

code_context requires work-item-enhance:code-context in addition to work-item-enhance:run