Skip to main content

Get Storage Files (v1)

Method & Path

GET /api/v1/workspace/:workspaceId/storage/files

Description

Get a paginated list of storage files with optional filtering and sorting.

Authentication

Required: Workspace authentication. User must be authenticated as Workspace Owner or Staff with workspace permissions.

Headers

Authorization: Bearer <workspace_token>
Content-Type: application/json

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier

Query Parameters

ParameterTypeRequiredDescription
pagenumberNoPage number (default: 1)
limitnumberNoNumber of results per page (default: 50)
categorystringNoFilter by category (sessions, storefront, vcard, financial, sms, ai-tools, other)
sortBystringNoSort field (size, name, date) - default: date
sortOrderstringNoSort order (asc, desc) - default: desc

Response 200 OK

{
"files": [
{
"path": "sessions/session-id/attachment-123.webp",
"sizeBytes": 500000,
"sizeMB": 0.48,
"category": "sessions",
"contentType": "image/webp",
"createdAt": "2025-01-15T10:30:00.000Z"
}
],
"pagination": {
"total": 150,
"page": 1,
"limit": 50,
"totalPages": 3
}
}

Response Fields

files

Array of file objects:

  • path (string): File path in storage
  • sizeBytes (number): File size in bytes
  • sizeMB (number): File size in megabytes
  • category (string): File category
  • contentType (string): MIME type
  • createdAt (string): Creation timestamp (ISO 8601 format)

pagination

  • total (number): Total number of files
  • page (number): Current page number
  • limit (number): Number of results per page
  • totalPages (number): Total number of pages

Common Errors

400 Bad Request: Invalid query parameters

401 Unauthorized: Missing or invalid authentication token

404 Not Found: Workspace not found

500 Internal Server Error: Server error occurred while processing the request