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 => { throw new Error(/*...*/); }).catch(() => { throw new Error(/*...*/); });
}
})
.then(data => {
if (data) {
console.log('Delete response details (if returned):');
console.log(JSON.stringify(data, null, 2));
}
})
.catch(error => {
console.error(`Error deleting file/asset ${assetId}:`, error);
});

Response

A successful request typically returns a 200 OK status code. The response body might be empty or contain a simple success message.

If the asset ID is not found or you lack permission, a 404 or 403 error will be returned.