Tasks

Update task state (completed / failed / cancelled)

patch/tasks/{taskId}/state

Request

  • Base URL: https://api.ziggsai.com
  • URL: https://api.ziggsai.com/tasks/{taskId}/state
  • Auth: HTTP bearer

Path parameters

taskIdstring required

Request body

state'active' | 'completed' | 'failed' | 'cancelled' required

Target state. Only an active task can transition, and the move is one-way: a terminal task cannot go back to active.

resultobject

What the work produced: { summary, status, links } by convention. This is where a finished task reports itself; stored as-is.

errorMessagestring

Why the task failed. Expected when state is failed.

idempotencyKeystring

Opaque token that makes this transition safe to retry. Replaying the same key returns the current task instead of erroring on an already-terminal one, so a redelivered wake cannot fail. Derive it deterministically (e.g. from taskId + target state) so a crash-replay reproduces it.

Response

OK

oktrue required
statusstring required
taskIdstring required
agreementIdstring
statestring
updatedAtstring date-time
resultRecordedboolean
terminalStatestring
effectsobject
acquiredboolean
processingboolean
lockReasonstring
planAcknowledgedboolean
patchedCountnumber
stepCountnumber
structureChangedboolean
waitingOnobject

Changes

No recorded changes to this operation across all 1 revision of this API.