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-enhancementsAuthorization
work-item-enhance:runapi key scoperequiredRequired scope when calling with an API key.
Request body
targetobjectrequiredTarget 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.
instructionsstringoptionalOptional caller guidance for generated drafts/artifacts.
confirmbooleanrequiredMust 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_authNo credentials provided
401
invalid_api_keyAPI key is invalid or revoked
400
bad_requestMissing or invalid request fields
403
scope_insufficientKey lacks the required write scope
404
target_not_foundTarget work item does not exist or is outside the resolved workspace
400
action_not_allowedRequested action is not in the v1 allowlist
400
confirmation_requiredconfirm must be true
400
idempotency_key_requiredIdempotency-Key header is required
403
scope_insufficientcode_context requires work-item-enhance:code-context in addition to work-item-enhance:run