Skip to content

Complete task

Endpoint

This endpoint marks a task as complete. The URL differs depending on whether it’s a process task or a standalone task:

  • Process task: POST /organizations/{org_id}/runs/{run_id}/completed-tasks
  • Standalone task: POST /organizations/{org_id}/completed-tasks

Replace {org_id} and {run_id} with your actual IDs.

Request

Headers

  • Authorization: Bearer {your_access_token}
  • Accept: application/json
  • X-Tallyfy-Client: APIClient
  • Content-Type: application/json

Body (JSON)

Fields:

  • task_id (string, required) - The ID of the task to complete.
  • is_approved (boolean, required for approval tasks) - Set true to approve, false to reject. Ignored for non-approval tasks.
  • override_user (integer, optional) - User ID to record as the completer instead of the authenticated user.

Note: You can’t send form field values in the completion request. Update form fields through the Update Task endpoint before completing. The API validates that all required form fields are filled before allowing completion.

Example body (simple completion):

{
"task_id": "TASK_ID_TO_COMPLETE"
}

Example body (approval task - approve):

{
"task_id": "APPROVAL_TASK_ID",
"is_approved": true
}

Code samples

These examples use the process task endpoint. For standalone tasks, drop the /runs/{run_id} segment from the URL.

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const runId = 'PROCESS_RUN_ID'; // null for standalone tasks
const taskId = 'TASK_ID_TO_COMPLETE';
const apiUrl = runId
? `https://go.tallyfy.com/api/organizations/${orgId}/runs/${runId}/completed-tasks`
: `https://go.tallyfy.com/api/organizations/${orgId}/completed-tasks`;
const payload = {
task_id: taskId,
// is_approved: true, // Required for approval tasks
};
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
headers.append('Accept', 'application/json');
headers.append('X-Tallyfy-Client', 'APIClient');
headers.append('Content-Type', 'application/json');
fetch(apiUrl, {
method: 'POST',
headers: headers,
body: JSON.stringify(payload)
})
.then(response => {
return response.json().then(data => {
if (!response.ok) {
console.error(`Failed to complete task ${taskId}:`, data);
throw new Error(`HTTP error! status: ${response.status}`);
}
console.log(`Task ${taskId} completed. Status: ${response.status}`);
return data;
});
})
.then(data => {
console.log('Completed task details:');
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error(`Error completing task ${taskId}:`, error.message);
});

Response

A successful request returns 200 OK with the completed task details.

{
"data": {
"id": "TASK_ID_TO_COMPLETE",
"title": "Review Proposal",
"status": "completed",
"completed_at": "2025-05-20T17:00:00.000Z",
"completer_id": 1001,
"tasks_changed_by_rules": {}
}
}

For process tasks, the response includes tasks_changed_by_rules showing any tasks affected by automation rules triggered by this completion. Standalone task responses don’t include this field.

The API returns an error if the task is already completed, the user lacks permission, required form fields aren’t filled, or the task has unresolved issues.


Tasks > Reopen task

Reopen a completed task by sending a DELETE request to the completed-tasks endpoint. This…