Skip to main content

GET /resources/wrappers/files

Retrieve a list of all uploaded files in the system. This endpoint is primarily intended for debugging and administrative purposes.

Authentication

No authentication required.

Query Parameters

None. The endpoint returns up to 100 most recent files.

Response

files
array
required
Array of uploaded file objects.
file_id
string
required
Unique identifier for the uploaded file.
filename
string
required
Original filename as provided during upload.
file_size
integer
required
File size in bytes.
content_type
string
required
MIME type of the file (e.g., text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet).
upload_timestamp
string
required
ISO 8601 formatted timestamp of when the file was uploaded.
preview_data
string
Sample of the file content (first 5 rows) for preview purposes.
validation_status
string
required
File validation status: valid, invalid, or pending.
validation_errors
array
List of validation error messages if the file is invalid.
count
integer
required
Total number of files returned in the response.

Example Request

curl -X GET https://api.example.com/resources/wrappers/files

Example Response

Success

{
  "files": [
    {
      "file_id": "a1b2c3d4-5e6f-7g8h-9i0j-k1l2m3n4o5p6",
      "filename": "sales_data.csv",
      "file_size": 245760,
      "content_type": "text/csv",
      "upload_timestamp": "2024-03-01T10:30:00.000Z",
      "preview_data": "timestamp          value\n2024-01-01 00:00:00  100.5\n2024-01-01 01:00:00  102.3",
      "validation_status": "valid",
      "validation_errors": null
    },
    {
      "file_id": "b2c3d4e5-6f7g-8h9i-0j1k-l2m3n4o5p6q7",
      "filename": "metrics.xlsx",
      "file_size": 512000,
      "content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
      "upload_timestamp": "2024-03-01T09:15:00.000Z",
      "preview_data": "date        metric_1  metric_2\n2024-01-01  50        75",
      "validation_status": "valid",
      "validation_errors": null
    },
    {
      "file_id": "c3d4e5f6-7g8h-9i0j-1k2l-m3n4o5p6q7r8",
      "filename": "empty.csv",
      "file_size": 128,
      "content_type": "text/csv",
      "upload_timestamp": "2024-02-28T16:45:00.000Z",
      "preview_data": null,
      "validation_status": "invalid",
      "validation_errors": [
        "File is empty",
        "File must have at least 2 columns for time series data"
      ]
    }
  ],
  "count": 3
}

Error Responses

503 Service Unavailable

Database unavailable:
{
  "detail": "Database unavailable"
}

Notes

  • This endpoint returns a maximum of 100 files
  • Files are returned in the order they appear in the database (not necessarily chronological)
  • The file_path field is excluded from responses for security reasons
  • Pagination and filtering features may be added in future versions

Build docs developers (and LLMs) love