Skip to content

Delete file

Endpoint

DELETE /organizations/{org_id}/file/{asset_id}

This endpoint deletes an uploaded file (asset), removing it from the task or kick-off form field it was attached to.

Request

Replace {org_id} with your Organization ID and {asset_id} with the Asset ID of the file to delete.

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 assetId = 'ASSET_ID_TO_DELETE';
const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/file/${assetId}`;
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 200 OK on success
if (response.ok) {
console.log(`Successfully deleted file/asset ${assetId}. Status: ${response.status}`);
// Check if body exists (might return success message)
return response.text().then(text => text ? JSON.parse(text) : null);
} else {
// Error handling...
return response.json().then(errData => {
console.error(`Error deleting file/asset ${assetId}:`, errData);
throw new Error(`HTTP error! status: ${response.status}`);
}).catch(() => {
console.error(`Error deleting file/asset ${assetId}: Status ${response.status}`);
throw new Error(`HTTP error! status: ${response.status}`);
});
}
})
.then(data => {
if (data) {
console.log('Delete response details (if returned):');
console.log(JSON.stringify(data, null, 2));
}
})
.catch(error => {
console.error(`Error during deletion for ${assetId}:`, error.message);
});

Response

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

Files > Download file

An API endpoint that downloads file content using various programming languages including JavaScript Python Java and Go by sending a GET request with proper authentication headers to retrieve the raw file data.

Files > Get file metadata

The GET endpoint allows retrieval of file metadata including filename upload date and related object details by providing organization ID and asset ID in the request URL path.

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.

Code Samples > Managing files

The API enables file management functionalities including uploading downloading getting metadata and removing files associated with tasks or kick-off forms.