Get metadata before deleting.
Delete file
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.
Replace {org_id}
with your Organization ID and {asset_id}
with the Asset ID of the file to delete.
Authorization: Bearer {your_access_token}
Accept: application/json
X-Tallyfy-Client: APIClient
No request body is needed for this DELETE request.
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);});
import requestsimport jsonimport os
access_token = os.environ.get('TALLYFY_ACCESS_TOKEN', 'YOUR_PERSONAL_ACCESS_TOKEN')org_id = os.environ.get('TALLYFY_ORG_ID', 'YOUR_ORGANIZATION_ID')asset_id = 'ASSET_ID_TO_DELETE'api_url = f'https://go.tallyfy.com/api/organizations/{org_id}/file/{asset_id}'
headers = { 'Authorization': f'Bearer {access_token}', 'Accept': 'application/json', 'X-Tallyfy-Client': 'APIClient'}
try: response = requests.delete(api_url, headers=headers) response.raise_for_status() # Expect 200 OK
print(f'Successfully deleted file/asset {asset_id}. Status: {response.status_code}') if response.content: try: delete_response = response.json() print('Delete response details (if returned):') print(json.dumps(delete_response, indent=4)) except json.JSONDecodeError: print(f"(Response body: {response.text})")
except requests.exceptions.RequestException as e: # Error handling... print(f"Request failed: {e}")
import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;import java.io.IOException;
public class DeleteFile { public static void main(String[] args) { String accessToken = System.getenv().getOrDefault("TALLYFY_ACCESS_TOKEN", "YOUR_PERSONAL_ACCESS_TOKEN"); String orgId = System.getenv().getOrDefault("TALLYFY_ORG_ID", "YOUR_ORGANIZATION_ID"); String assetId = "ASSET_ID_TO_DELETE"; String apiUrl = String.format("https://go.tallyfy.com/api/organizations/%s/file/%s", orgId, assetId);
HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(apiUrl)) .header("Authorization", "Bearer " + accessToken) .header("Accept", "application/json") .header("X-Tallyfy-Client", "APIClient") .DELETE() .build();
try { HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() == 200) { System.out.println("Successfully deleted file/asset " + assetId + ". Status: " + response.statusCode()); if (response.body() != null && !response.body().isEmpty()) { System.out.println("Response Body:"); System.out.println(response.body()); // TODO: Parse JSON if applicable } } else { // Error handling... System.err.println("Failed. Status: " + response.statusCode()); System.err.println("Response: " + response.body()); // Print error body } } catch (IOException | InterruptedException e) { // Error handling... System.err.println("Request failed: " + e.getMessage()); } }}
package main
import ( "fmt" "io/ioutil" "net/http" "os")
func main() { accessToken := os.Getenv("TALLYFY_ACCESS_TOKEN") orgId := os.Getenv("TALLYFY_ORG_ID") assetId := "ASSET_ID_TO_DELETE" apiUrl := fmt.Sprintf("https://go.tallyfy.com/api/organizations/%s/file/%s", orgId, assetId)
client := &http.Client{} req, err := http.NewRequest(http.MethodDelete, apiUrl, nil) // Error handling...
req.Header.Set("Authorization", "Bearer "+accessToken) req.Header.Set("Accept", "application/json") req.Header.Set("X-Tallyfy-Client", "APIClient")
resp, err := client.Do(req) // Error handling... defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body) // Error handling...
if resp.StatusCode == http.StatusOK { fmt.Printf("Successfully deleted file/asset %s. Status: %d\n", assetId, resp.StatusCode) if len(body) > 0 { fmt.Println("Response Body:") fmt.Println(string(body)) // TODO: Unmarshal JSON if applicable } } else { // Error handling... fmt.Printf("Failed. Status: %d\nBody: %s\n", resp.StatusCode, string(body)) }}
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.
Upload a new file.
About Tallyfy
- 2025 Tallyfy, Inc.
- Privacy Policy
- Terms of Use
- Report Issue
- Trademarks