Tallyfy’s API provides two GET endpoints for retrieving uploaded files: one that returns the…
Delete file
Endpoint
Section titled “Endpoint”DELETE /organizations/{org_id}/file/{asset_id}
This permanently deletes an uploaded file (asset) in Tallyfy. It removes the asset record and the file itself from storage.
Request
Section titled “Request”Replace {org_id} with your organization ID. Replace {asset_id} with the asset ID of the file to delete.
Headers
Section titled “Headers”| Header | Value | Required |
|---|---|---|
Authorization | Bearer {your_access_token} | Yes |
Accept | application/json | Yes |
X-Tallyfy-Client | APIClient | Yes |
You don’t need a request body.
Code samples
Section titled “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 => { if (response.ok) { console.log(`Deleted file ${assetId}. Status: ${response.status}`); } else { return response.json().then(errData => { console.error(`Error deleting file ${assetId}:`, errData); }); }}).catch(error => { console.error(`Request failed for ${assetId}:`, error.message);});import requestsimport 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() print(f'Deleted file {asset_id}. Status: {response.status_code}')except requests.exceptions.RequestException as e: print(f'Request failed for asset {asset_id}: {e}') if e.response is not None: print(f'Status: {e.response.status_code}, Body: {e.response.text}')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("Deleted file " + assetId); } else { System.err.println("Failed: " + response.statusCode() + " " + response.body()); } } catch (IOException | InterruptedException e) { System.err.println("Request failed: " + e.getMessage()); Thread.currentThread().interrupt(); } }}package main
import ( "fmt" "io" "net/http" "os" "time")
func main() { accessToken := os.Getenv("TALLYFY_ACCESS_TOKEN") if accessToken == "" { accessToken = "YOUR_PERSONAL_ACCESS_TOKEN" } orgId := os.Getenv("TALLYFY_ORG_ID") if orgId == "" { orgId = "YOUR_ORGANIZATION_ID" } assetId := "ASSET_ID_TO_DELETE" apiUrl := fmt.Sprintf( "https://go.tallyfy.com/api/organizations/%s/file/%s", orgId, assetId)
client := &http.Client{Timeout: 10 * time.Second} req, err := http.NewRequest(http.MethodDelete, apiUrl, nil) if err != nil { fmt.Printf("Error creating request: %v\n", err) return }
req.Header.Set("Authorization", "Bearer "+accessToken) req.Header.Set("Accept", "application/json") req.Header.Set("X-Tallyfy-Client", "APIClient")
resp, err := client.Do(req) if err != nil { fmt.Printf("Error making request: %v\n", err) return } defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body) if resp.StatusCode == http.StatusOK { fmt.Printf("Deleted file %s\n", assetId) } else { fmt.Printf("Failed: %d\nBody: %s\n", resp.StatusCode, string(body)) }}#include <iostream>#include <string>#include <cpprest/http_client.h>
using namespace web;using namespace web::http;using namespace web::http::client;
pplx::task<void> DeleteAsset(const utility::string_t& assetId){ utility::string_t accessToken = U("YOUR_PERSONAL_ACCESS_TOKEN"); utility::string_t orgId = U("YOUR_ORGANIZATION_ID"); utility::string_t apiUrl = U("https://go.tallyfy.com/api/organizations/") + orgId + U("/file/") + assetId;
http_client client(apiUrl); http_request request(methods::DEL); request.headers().add(U("Authorization"), U("Bearer ") + accessToken); request.headers().add(U("Accept"), U("application/json")); request.headers().add(U("X-Tallyfy-Client"), U("APIClient"));
return client.request(request).then([assetId](http_response response) { if (response.status_code() == status_codes::OK) { std::wcout << L"Deleted file " << assetId << std::endl; } else { return response.extract_string().then([response, assetId](utility::string_t body) { std::wcerr << L"Failed: " << response.status_code() << L" " << body << std::endl; }); } return pplx::task_from_result(); });}
int main(){ try { DeleteAsset(U("ASSET_ID_TO_DELETE")).wait(); } catch (const std::exception &e) { std::cerr << "Error: " << e.what() << std::endl; } return 0;}// Requires C++ REST SDK (Casablanca)using System;using System.Net.Http;using System.Net.Http.Headers;using System.Threading.Tasks;
public class DeleteFile{ private static readonly HttpClient client = new HttpClient();
public static async Task Main(string[] args) { var accessToken = Environment.GetEnvironmentVariable("TALLYFY_ACCESS_TOKEN") ?? "YOUR_PERSONAL_ACCESS_TOKEN"; var orgId = Environment.GetEnvironmentVariable("TALLYFY_ORG_ID") ?? "YOUR_ORGANIZATION_ID"; var assetId = "ASSET_ID_TO_DELETE"; var apiUrl = $"https://go.tallyfy.com/api/organizations/{orgId}/file/{assetId}";
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add( new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Add("X-Tallyfy-Client", "APIClient");
try { var response = await client.DeleteAsync(apiUrl); if (response.IsSuccessStatusCode) { Console.WriteLine($"Deleted file {assetId}"); } else { var body = await response.Content.ReadAsStringAsync(); Console.WriteLine($"Failed: {response.StatusCode} {body}"); } } catch (HttpRequestException e) { Console.WriteLine($"Request failed: {e.Message}"); } }}Response
Section titled “Response”You’ll get 200 OK. The response body is empty. That confirms the file is gone from both the Tallyfy record and storage.
Related articles
Section titled “Related articles” Tallyfy’s API lets you permanently delete a standalone one-off task along with its form fields…
Tallyfy’s DELETE API endpoint at
/organizations/[org_id]/tags/[tag_id] permanently removes a… Tallyfy’s API lets you retrieve metadata for any uploaded file (asset) by calling GET on the…
Was this helpful?
About Tallyfy
- 2026 Tallyfy, Inc.
- Privacy Policy
- Terms of Use
- Report Issue
- Trademarks