Overview
Retrieve a paginated list of files in your account or within a specific folder.
Query Parameters
Filter files by folder ID. Omit to list files in root directory.
Page number for pagination
Number of items per page (max: 100)
sort
string
default:"created_desc"
Sort order. Options: created_asc, created_desc, modified_asc, modified_desc, name_asc, name_desc, size_asc, size_desc
Filter by file type: image, video, audio, document, archive, other
Example Request
curl https://api.hubsy.cloud/v1/files?folder_id=folder_123&per_page=10 \
-H "Authorization: Bearer YOUR_API_KEY"
Response
Indicates if the request was successful
Array of file objects
MIME type (e.g., “image/jpeg”, “application/pdf”)
File category: image, video, audio, document, archive, other
ID of parent folder, or null if in root
ISO 8601 timestamp of when file was uploaded
ISO 8601 timestamp of last modification
URL to file thumbnail (if available)
Direct download URL (expires in 1 hour)
Whether file has active share links
Example Response
{
"success": true,
"data": [
{
"id": "file_abc123",
"name": "presentation.pdf",
"size": 2458624,
"type": "application/pdf",
"category": "document",
"folder_id": "folder_123",
"created_at": "2024-01-15T10:30:00Z",
"modified_at": "2024-01-15T10:30:00Z",
"thumbnail_url": "https://cdn.hubsy.cloud/thumbs/file_abc123.jpg",
"download_url": "https://cdn.hubsy.cloud/download/file_abc123?token=xyz",
"is_shared": true
},
{
"id": "file_def456",
"name": "photo.jpg",
"size": 1024000,
"type": "image/jpeg",
"category": "image",
"folder_id": "folder_123",
"created_at": "2024-01-14T15:20:00Z",
"modified_at": "2024-01-14T15:20:00Z",
"thumbnail_url": "https://cdn.hubsy.cloud/thumbs/file_def456.jpg",
"download_url": "https://cdn.hubsy.cloud/download/file_def456?token=abc",
"is_shared": false
}
],
"pagination": {
"page": 1,
"per_page": 10,
"total_items": 42,
"total_pages": 5
}
}
Error Responses
{
"success": false,
"error": {
"code": "not_found",
"message": "Folder not found"
}
}
Notes
- The
download_url expires after 1 hour. Generate a new one by calling this endpoint again.
- Thumbnails are only available for images, videos, and PDFs
- Deleted files are not included in the list
- Maximum
per_page value is 100