Reparent a work item

Runs the governed reparent operation: moves one work item under a new parent ticket (or clears the parent with null). Validates hierarchy rules including self-parenting and maximum nesting depth before writing.

POST/api/v1/work-items/:id/parent

Authorization

work-items:linkapi key scoperequired
Required scope when calling with an API key.

Path parameters

idstringrequired
Canonical work-item ID

Example: work_01k2...

Request body

parent_ticket_idstringoptional
New parent ticket ID, or null to clear the parent
expected_versionnumberoptional
Optimistic concurrency token
confirmbooleanrequired
Must be true
Example request
{
  "parent_ticket_id": "work_01k9...",
  "expected_version": 4,
  "confirm": true
}

Request

curl -X POST "https://www.digitalstack360.com/api/v1/work-items/work_01k2.../parent" \
  -H "Authorization: Bearer $DS_API_KEY" \
  -H "Idempotency-Key: reparent-work-42-v1" \
  -H "Content-Type: application/json" \
  -d '{"parent_ticket_id":"work_01k9...","expected_version":4,"confirm":true}'

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

Response

200 OK
{
  "data": {
    "ok": true,
    "item": {
      "id": "work_01k2...",
      "parent_ticket_id": "work_01k9..."
    },
    "changed_fields": [
      "parent_ticket_id"
    ],
    "event_type": "work_item.reparented",
    "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

403
scope_insufficient

Key lacks work-items:link scope

404
not_found

Work item does not exist or is outside the resolved workspace

400
self_parent

A work item cannot be its own parent

400
invalid_parent

Parent is invalid — wrong project, wrong type, or exceeds the maximum nesting depth

409
provider_not_resolved

The item’s source provider could not be resolved for write-back