Confirm task step
Endpoint
POST /bot/tasks/{task_id}/confirm
Confirms the current workflow step of a task. Once every assignment of the current step is confirmed, the task moves to the next step, or finishes when there is no next step. This is the bot equivalent of the Confirm action in the task view.
Auth
Authorization: Bearer <bot_token>
Content-Type: application/jsonThe bot must have full (update) rights on the task's form. When the confirmation finishes the task, the bot must also have permission to close tasks, as for Finish tasks.
Path params
task_id- task ID
Request body
The body is optional.
{
"assignment_id": 123
}- With
assignment_id, only that assignment is confirmed. It must belong to the task's current step. This matches a user confirming their own assignment. - Without a body (or with
{}), every unconfirmed assignment of the current step is confirmed.
Finding assignment_id
Call GET /bot/tasks/{task_id} and inspect data.step_assignments. Select an assignment whose step_id equals the task's current step_id. An assignment from an earlier or later step is rejected.
See Read task for the complete assignment schema.
Examples
Confirm the whole current step:
curl -X POST \
-H "Authorization: Bearer <bot_token>" \
-H "Content-Type: application/json" \
-d '{}' \
https://public-api.hcapp.ee/bot/tasks/5001/confirmConfirm one assignment of the current step:
curl -X POST \
-H "Authorization: Bearer <bot_token>" \
-H "Content-Type: application/json" \
-d '{"assignment_id": 123}' \
https://public-api.hcapp.ee/bot/tasks/5001/confirmResponse body
{
"success": true,
"error_message": null,
"data": {
"task_id": 5001,
"form_id": 12,
"confirmed_assignment_ids": [123],
"step_changed": true,
"previous_step_id": 5,
"step_id": 8,
"responsible_id": 45,
"is_finished": false
}
}confirmed_assignment_ids- assignments confirmed by this call. Empty when everything was already confirmed.step_changed-truewhen the task moved to another step.previous_step_id- step the task was on before the call.step_id- step the task is on after the call.responsible_id- task responsible after the call.nullfor a group assignment.is_finished-truewhen the confirmation finished the task.
Behavior
- Marks the selected assignments as confirmed and creates a
CONFIRMsystem comment for each of them. - If any assignment of the current step remains unconfirmed, the task stays on the current step (
step_changed: false). - Once all assignments of the current step are confirmed, the task moves to the next step that has unconfirmed assignments or no assignments yet. Steps whose assignments are already confirmed (for example after a step return) are skipped.
- When the next step has no assignments, its default assignees are created from the workflow configuration and the task responsible is updated. When the step already has assignments, the assignee of its
RESPONSIBLEassignment becomes the task responsible. - Creates a
STEP_CHANGEDsystem comment, grants task access to the new step's assignees, and creates in-app notifications for them. External delivery is queued through each recipient's enabled notification channels. - When there is no next step, the task is finished:
is_finishedistrue, aFINISHsystem comment is created, and the normal post-finish processing runs. - Calling the endpoint on a step where every assignment is already confirmed moves the task forward without confirming anything (
confirmed_assignment_ids: []). - Updates the task activity time.
To send a task back, use Return task to step.
Errors
422 assignment_idmust be greater than0.400 Task is already finished.400 Task is not in a workflow step.400 Assignment does not belong to the current step.403 Form access not found- the bot has no full rights on the form.403 No close rights for this form- the confirmation would finish the task, but the bot cannot close tasks in the form.404 Task not found.404 Assignment with id {id} not found for this task.
The endpoint uses the standard bot update rate limit.