Skip to content

Delete task

Endpoint

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

This endpoint permanently deletes a standalone (“one-off”) task. This action cannot be undone.

Request

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

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 = 'ONE_OFF_TASK_ID_TO_DELETE';
const apiUrl = `https://api.tallyfy.com/organizations/${orgId}/tasks/${taskId}/delete`; // Note the /delete suffix
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
headers.append('Accept', 'application/json');
headers.append('X-Tallyfy-Client', 'APIClient');
fetch(apiUrl, {
method: 'DELETE',
headers: headers
})
.then(response => {
// Expect 204 No Content for successful deletion
if (response.status === 204) {
console.log(`Successfully deleted one-off task ${taskId}. Status: ${response.status}`);
return null; // No body expected
} else {
// Error handling...
return response.json().then(errData => { throw new Error(/*...*/); }).catch(() => { throw new Error(/*...*/); });
}
})
.catch(error => {
console.error(`Error deleting one-off task ${taskId}:`, error);
});

Response

A successful permanent deletion request returns a 204 No Content status code, and no response body.

If the task ID doesn’t exist, is not a one-off task, or you lack permission, an appropriate error status code (404, 403, 400) will be returned, potentially with an error message in the response body.