Skip to content

Reopen task

Endpoint

This endpoint reopens a completed task, setting its status back usually to active or incomplete. The exact endpoint depends on the task type:

  • Process Task: DELETE /organizations/{org_id}/runs/{run_id}/completed-tasks/{task_id}
  • One-off Task: DELETE /organizations/{org_id}/completed-tasks/{task_id}

Replace {org_id}, {run_id} (if applicable), and {task_id} with the appropriate IDs.

Request

Headers

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

Body

No request body is needed for this DELETE request.

Code samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const runId = 'PROCESS_RUN_ID'; // Set to null or omit for one-off task
const taskId = 'TASK_ID_TO_REOPEN';
const apiUrl = runId
? `https://go.tallyfy.com/api/organizations/${orgId}/runs/${runId}/completed-tasks/${taskId}`
: `https://go.tallyfy.com/api/organizations/${orgId}/completed-tasks/${taskId}`;
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
headers.append('Accept', 'application/json');
headers.append('X-Tallyfy-Client', 'APIClient');
fetch(apiUrl, {
method: 'DELETE', // Use DELETE method on completed-tasks endpoint
headers: headers
})
.then(response => {
return response.json().then(data => { // Attempt to parse JSON regardless of status
if (!response.ok) { // Check for 200 OK on success
console.error(`Failed to reopen task ${taskId}:`, data);
throw new Error(`HTTP error! status: ${response.status}`);
}
console.log(`Successfully reopened task ${taskId}. Status: ${response.status}`);
return data; // Reopen might return the updated task state
});
})
.then(data => {
if(data) {
console.log('Reopened task details:');
console.log(JSON.stringify(data, null, 2));
}
})
.catch(error => {
console.error(`Error reopening task ${taskId}:`, error.message);
});

Response

A successful request returns a 200 OK status code. The response body typically contains the details of the task, now back in an active (or incomplete) state.

{
"data": {
"id": "TASK_ID_TO_REOPEN",
"title": "Review Proposal",
"status": "active", // Status is no longer 'completed'
"completed_at": null, // Completion timestamp is removed
"completer_id": null,
// ... other task properties ...
}
}

If the task was not previously completed or the ID is invalid, an error status will be returned.


Tasks > Complete task

The API endpoint allows marking tasks as complete by sending a POST request with task ID and optional fields like approval status and form data while supporting both process-run tasks and standalone one-off tasks through different URL structures.

Tasks > Delete task

An API endpoint that permanently deletes standalone tasks through DELETE requests with mandatory authorization headers and returns a 204 status code upon successful deletion.

Tasks > Archive task

A DELETE endpoint archives standalone tasks by hiding them from default views while preserving data for potential future restoration through authenticated API requests with provided code examples in multiple programming languages.

Tasks > Complete or reopen tasks

Tasks can be marked complete through checkmark icons or completion buttons and reopened via a dedicated button while tasks with subtasks require meeting checklist requirements before allowing completion.