Skip to content

Archive task

Endpoint

DELETE /organizations/{org_id}/tasks/{task_id}

This endpoint archives a standalone (“one-off”) task. Archived tasks are hidden from default views but can potentially be restored or deleted permanently later.

Request

Replace {org_id} with your Organization ID and {task_id} with the ID of the one-off task to archive.

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 taskId = 'TASK_ID_TO_ARCHIVE'; // ID of the standalone task
const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/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', // DELETE archives the one-off task
headers: headers
})
.then(response => {
// Check for 204 No Content or potentially 200 OK
if (response.status === 204 || response.status === 200) {
console.log(`Successfully archived one-off task ${taskId}. Status: ${response.status}`);
// Response might be empty (204) or contain the archived task (200)
if (response.status === 200) {
// Try to parse JSON only if status is 200
return response.json().catch(e => {
console.warn("Could not parse JSON response for 200 status:", e);
return null; // Continue successfully but without data
});
}
return null; // For 204 No Content
} else {
// Try to parse error JSON, fallback to text
return response.json()
.catch(() => response.text())
.then(errData => {
console.error(`Failed to archive task ${taskId}. Status: ${response.status}`, errData);
throw new Error(`HTTP error! status: ${response.status}`);
});
}
})
.then(data => {
if (data) { // Only log if data was parsed (i.e., status 200 with body)
console.log('Archived task details (if returned):');
console.log(JSON.stringify(data, null, 2));
}
})
.catch(error => {
console.error(`Error during archival of one-off task ${taskId}:`, error.message);
});

Response

A successful request returns a 200 OK status code and a JSON object containing a data

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.

Processes > Archive process

The DELETE endpoint enables archiving of process instances by hiding them from default views while maintaining data accessibility for future restoration through authenticated API requests.

Tags > Archive tag

A DELETE endpoint that enables archiving of organization tags by making them hidden while maintaining their data with authentication headers and code examples in multiple programming languages.

Templates > Archive or delete template

The API supports template removal through archiving which retains data and permanent deletion which irreversibly removes all template information and its associated data.