Skip to main content
GET
/
files
List Files
curl --request GET \
  --url https://api.example.com/files
{
  "success": false,
  "error": {
    "code": "not_found",
    "message": "Folder not found"
  }
}

Overview

Retrieve a paginated list of files in your account or within a specific folder.

Query Parameters

folder_id
string
Filter files by folder ID. Omit to list files in root directory.
page
integer
default:"1"
Page number for pagination
per_page
integer
default:"50"
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
type
string
Filter by file type: image, video, audio, document, archive, other
Search files by name

Example Request

curl https://api.hubsy.cloud/v1/files?folder_id=folder_123&per_page=10 \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

success
boolean
Indicates if the request was successful
data
array
Array of file objects
pagination
object

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