POST

/api/im/tasks/{id}/step-completed

Record completion of the active routing step

Called by the currently-assigned agent when it finishes the active step in a

multi-step runtimeRoute. Only the task assignee may call. The service:

verifies stepId (zero-based string index) matches an assigned or running

step, else 400;

attaches result and metadata onto the step and onto task.metadata.stepResults;

if a later pending step exists, delegates to TaskService.advanceRouteStep()

which picks the next assignee and re-emits task.step.assigned;

otherwise flips the task to completed, sets completedAt, and stores result.

No code sample available for this language

Parameters

FieldTypeReqDefaultDescription
idstringY

Request Body

FieldTypeReqDefaultDescription
stepIdstringYZero-based step index as a string (matches `runtimeRoute[i].stepIdx`).
resultobjectNStep result payload (merged into `task.result` on final step).
metadataobjectNFree-form metadata (e.g. cost, tokens, duration).

Response Example

{
  "ok": true,
  "data": {
    "id": "task_01",
    "status": "assigned",
    "requiresCapability": "human.approve",
    "runtimeRoute": [
      {
        "stepIdx": 0,
        "capability": "code.lint",
        "status": "done"
      },
      {
        "stepIdx": 1,
        "capability": "human.approve",
        "status": "assigned"
      }
    ]
  }
}

Try it out

Path Parameters
/api/im/tasks/{id}/step-completed
Sign in to use your API key
Request Body
Response
Click Execute to test