---
title: "Unstick Engagement"
method: POST
path: "/admin/engagement/{engagement_id}/unstick"
tags: ["admin"]
---

# Unstick Engagement

`POST /admin/engagement/{engagement_id}/unstick`

## Request

- Base URL: `https://api-docs.upsmith.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api-docs.upsmith.com/admin/engagement/{engagement_id}/unstick`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Recover an engagement wedged on an orphan ext-mod write-ahead.

Two-step recovery, both in one transaction:
  1. Flip ``EventAction.success`` from NULL → False so the
     ``_any_pending_writeahead_for_modules`` gate stops firing.
  2. Persist a synthetic ``ModelRequest`` ``LLM_RESPONSE`` event with a
     ``ToolReturnPart`` for the dangling tool call. This clears the
     ``_has_dangling_tool_call`` / ``_dangling_ext_mod_tool_names`` gates
     so the next turn sees a complete tool exchange. The content
     explicitly marks the tool as failed and tells the model not to retry.

We deliberately do NOT republish ``ENGAGEMENT_RUN_REQUESTED`` — the
engagement is already in (or destined for) the DLQ, and the existing
redrive will pick it up. Republishing here would race with that and
queue an extra turn.

## Path parameters

- `engagement_id` string, required

## Headers

- `organization-id` string, nullable
- `timezone` string
- `x-user-id` string, nullable
- `x-actor-email` string, nullable
- `x-request-source` string, nullable
- `x-operation-id` string, nullable
- `x-commit-message` string, nullable
- `x-confirmation-id` string, nullable
- `x-chat-id` string, nullable

## Response `200`

Successful Response

- UnstickResponse
  - `event_action_id` string, required
  - `synthetic_event_id` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/upsmith/apis/upsmith-api.md) - [All operations](https://skmtc.dev/upsmith/apis/upsmith-api/llms.txt) - [OpenAPI document](https://skmtc.dev/upsmith/apis/upsmith-api/revisions/cce8b07a5787?raw)
