Skip to content

Archive task

Endpoint

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

This endpoint archives a standalone (โ€œone-offโ€) Tallyfy 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

A DELETE endpoint permanently removes standalone tasks while preserving process-related tasks that can only be deleted through their parent process run deletion.

Processes > Archive process

This DELETE endpoint archives a Tallyfy process instance by hiding it from default views while preserving all data for potential future restoration and returns the archived process details with an updated status and timestamp upon successful completion.

Tags > Archive tag

This endpoint performs a soft delete on a tag by archiving it rather than permanently removing it from the system and returns the archived tag details with a deleted_at timestamp upon successful completion.

Templates > Archive or delete template

Templates can be removed via API through either archiving (soft delete that hides the template while preserving data and allowing restoration) or permanent deletion (irreversible removal of all template data) using DELETE requests to different endpoints with appropriate authentication headers.