Skip to content

Download file

Endpoints

  • GET /organizations/{org_id}/file/{file_id} - View the file inline (returns the file’s actual MIME type).
  • GET /organizations/{org_id}/file/{file_id}/dl - Download the file as an attachment (always returns application/octet-stream).

Both endpoints return raw file content for an asset that’s been uploaded to Tallyfy. Use the /dl suffix when you want to force a download with a Content-Disposition: attachment header.

Request

Replace {org_id} with your organization ID and {file_id} with the asset ID of the file. You’ll get this ID when uploading the file or from task/process data.

Headers

  • Authorization: Bearer {your_access_token}
  • X-Tallyfy-Client: APIClient

Code samples (download as attachment)

These samples fetch the file from the /dl endpoint and save it locally.

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const fileId = 'ASSET_ID_TO_DOWNLOAD';
const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/file/${fileId}/dl`;
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
headers.append('X-Tallyfy-Client', 'APIClient');
fetch(apiUrl, { method: 'GET', headers })
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
// Extract filename from Content-Disposition header
const disposition = response.headers.get('content-disposition');
let filename = `downloaded_${fileId}`;
if (disposition) {
const match = /filename="?([^";\n]+)"?/i.exec(disposition);
if (match) filename = match[1];
}
return response.blob().then(blob => ({ blob, filename }));
})
.then(({ blob, filename }) => {
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
window.URL.revokeObjectURL(url);
a.remove();
console.log('File download started.');
})
.catch(error => console.error('Download failed:', error.message));

Viewing inline

To display the file inline (when the browser supports the MIME type), use the endpoint without /dl. This returns the file’s original Content-Type instead of application/octet-stream:

Terminal window
curl -X GET \
-H "Authorization: Bearer $TALLYFY_ACCESS_TOKEN" \
-H "X-Tallyfy-Client: APIClient" \
"https://go.tallyfy.com/api/organizations/$TALLYFY_ORG_ID/file/$FILE_ID"

Response

A successful request returns 200 OK. The response body is the raw file content — not JSON.

Download endpoint (/dl) headers:

  • Content-Type: application/octet-stream
  • Content-Disposition: attachment; filename="<original_name>"
  • Content-Length: <bytes>

Inline endpoint (without /dl) headers:

  • Content-Type: <actual MIME type> (e.g., image/png, application/pdf)
  • Content-Length: <bytes>

If the file ID is invalid or you don’t have access, the API returns 404 or 403 with an error message.


Files > Delete file

Tallyfy’s API lets you permanently delete an uploaded file and its storage record by sending a…

Files > Get file metadata

Tallyfy’s API lets you retrieve metadata for any uploaded file (asset) by calling GET on the…