Skip to main content

Collection Files

List all files collected as part of a collection.

GET /api/collections/{id}/files

Authorization

  • Customer: Can view files from their own collections
  • Analyst: Can view files from any collection

Path Parameters

ParameterTypeRequiredDescription
idstringYesCollection ID

Query Parameters

ParameterTypeRequiredDescription
include_download_urlsbooleanNoWhen true, each file includes a time-limited download_url (SAS)

Response

{
"files": [
{
"id": "file_001",
"original_filename": "conversation_C0123ABC.json",
"stored_filename": "col_abc123/conversations/C0123ABC_1705312200.json",
"file_path": "collections/col_abc123/conversations/C0123ABC_1705312200.json",
"file_size_bytes": 24576,
"mime_type": "application/json",
"sha256_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"sha256_hash_validated": true,
"status": "stored",
"collected_at": "2024-01-15T12:30:00Z",
"api_log_id": "log_xyz789",
"download_url": "https://tracestorage.blob.core.windows.net/..."
}
],
"totals": {
"count": 234,
"total_bytes": 15728640,
"validated_count": 234,
"error_count": 0
}
}

File Properties

FieldDescription
original_filenameName assigned during collection
stored_filenameStorage object name
file_pathFull storage path (Azure Blob)
sha256_hashCryptographic hash for integrity verification
sha256_hash_validatedWhether hash has been verified after storage
statusPer-file status
api_log_idLink to the API call that collected this file (nullable)
download_urlPresent only when include_download_urls=true

Totals

FieldDescription
countNumber of files
total_bytesCombined size
validated_countFiles whose hash has been validated
error_countFiles in an error state

Example Request

curl -X GET "https://api.traces.io/api/collections/col_abc123/files?include_download_urls=true" \
-H "Authorization: Bearer <token>"

Use Cases

Verify File Integrity

Use the sha256_hash to verify files after download:

# After downloading a file
sha256sum downloaded_file.json
# Compare with sha256_hash from API

Audit Trail

Each file links to its api_log_id, which contains:

  • Full request/response details
  • Timestamp
  • Rate limit information
  • Any errors encountered

Error Responses

403 Forbidden

{
"error": {
"code": "FORBIDDEN",
"message": "You do not have access to this collection"
}
}

404 Not Found

{
"error": {
"code": "NOT_FOUND",
"message": "Collection not found"
}
}