Skip to content

Get file metadata

Endpoint

GET /organizations/{org_id}/assets/{asset_id}

This endpoint retrieves metadata for a specific uploaded file (called an “asset” in Tallyfy’s API). It returns details like the filename, upload date, and which object the file is attached to.

Request

Replace {org_id} with your Organization ID and {asset_id} with the asset ID of the file you want metadata for.

Headers

  • Authorization: Bearer {your_access_token}
  • Accept: application/json
  • X-Tallyfy-Client: APIClient

Code samples

const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';
const orgId = 'YOUR_ORGANIZATION_ID';
const assetId = 'ASSET_ID_TO_GET_METADATA';
const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/assets/${assetId}`;
const headers = new Headers();
headers.append('Authorization', `Bearer ${accessToken}`);
headers.append('Accept', 'application/json');
headers.append('X-Tallyfy-Client', 'APIClient');
fetch(apiUrl, {
method: 'GET',
headers: headers
})
.then(response => {
if (!response.ok) {
return response.json()
.catch(() => response.text())
.then(errData => {
console.error(`Error response for asset ${assetId}:`, errData);
throw new Error(`HTTP error! status: ${response.status}`);
});
}
return response.json();
})
.then(data => {
console.log(`Metadata for asset ${assetId}:`);
console.log(JSON.stringify(data, null, 2));
})
.catch(error => {
console.error(`Error getting asset metadata ${assetId}:`, error.message);
});

Response

A successful request returns a 200 OK status and a JSON object with the asset metadata inside a data property.

{
"data": {
"id": "ASSET_ID_TO_GET_METADATA",
"filename": "report_q1.pdf",
"version": 1,
"uploaded_from": "capture_id_abc123",
"uploaded_at": "2024-03-15T10:30:00Z",
"step_id": "step_id_xyz789",
"source": "local",
"system": null,
"uploaded_to_s3": true,
"subject": {
"id": "run_id_or_checklist_id",
"type": "Run"
}
}
}

Key fields in the response:

FieldDescription
idUnique asset identifier
filenameOriginal filename of the uploaded file
versionVersion number of the asset
uploaded_fromForm field ID the file was uploaded from, or ko_field for kick-off fields
uploaded_atTimestamp when the file was uploaded
step_idStep ID if the file is attached to a task step (can be null)
sourceUpload source - defaults to local
systemExternal storage system if applicable (e.g., Dropbox, Google Drive)
uploaded_to_s3Whether the file was stored in S3
subjectObject containing the parent’s id and type (e.g., Run, Checklist, Organization)

If the asset ID isn’t found or you don’t have permission, you’ll get a 404 or 403 error.


Files > Download file

Download or view files inline from Tallyfy using GET requests with your organization and file IDs. The response returns raw binary content with appropriate headers.

Code Samples > Managing files

Tallyfy’s API lets you upload, download, get metadata for, and delete files attached to tasks or kick-off forms using multipart form data and S3 storage.

Files > Delete file

A DELETE endpoint that permanently removes an uploaded file from a task or kick-off form field using /organizations/[org_id]/file/[asset_id] and returns a 200 OK status with an empty response body.

Files > Upload & attach file

Attaching files to form fields via Tallyfy’s API requires uploading the file to get an asset reference and then updating the task or process to link that asset to the specific form field.