VocalDocscontracts 1.65.0

Complete a human task

POST /v1/human-tasks/{human_task_id}/complete

PropertyValue
Operationcomplete_human_task
GroupHuman tasks
Scopeprocesses:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited processes.human_task.complete (mutation)
Released in1.62.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Completes an open task or one the calling Member claimed, with an outcome and fields validated against the form (HumanTaskIssueCode), and answers it completed (1.62.0); the completion, its Audit event and the instance's task_completed command commit in one transaction, and the node takes the outcome's outlet. An API key or a Member who is not the assignee is forbidden (assignee_required); a task another Member claimed, or one that is not open, human_task_conflict.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the processes:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X POST "$VOCAL_API/v1/human-tasks/htk_.../complete" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "outcome": "<outcome>" }'

Parameters

NameInTypeRequiredDescription
human_task_idpathHumanTaskIdyesThe id of a human task: htk_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Request body

Content type application/json, required: HumanTaskCompletionRequest.

FieldTypeRequiredDescription
fieldsmap of anynoThe form's other fields, each checked against its declared type. Content.
outcomestringyesA value of the form's outcome enum.

Responses

StatusContent typeShapeError codes
200application/jsonHumanTask
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeprocess_not_active, human_task_conflict, idempotency_in_progress, idempotency_key_reused
422application/jsonErrorEnvelopevalidation_failed
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is HumanTask.

FieldTypeRequiredDescription
assigneeHumanTaskAssigneeyes
claimed_atTimestamp or nullyes
claimed_byMemberId or nullyes
completionHumanTaskCompletion or nullyes
created_atTimestampyes
due_atTimestamp or nullyesWhen the node takes timeout and the task expires; null when unbounded.
environmentEnvironmentyes
escalate_atTimestamp or nullyesWhen human_task.overdue is written if the task is still open or claimed.
formmap of WorkflowFieldyesTyped fields, with an outcome enum.
idHumanTaskIdyes
node_idWorkflowNodeIdyes
object"human_task"yes
organization_idOrganizationIdyes
process_idProcessInstanceIdyes
statusHumanTaskStatusyes
step_idProcessStepIdyes
titlestring or nullyesRendered from the node's template. Content; null unless the read names include=content.
updated_atTimestampyes
workflow_idWorkflowIdyes
workflow_versionintegeryes