PlatformXeDocs
Get API Key

Manage Files

API reference for listing, retrieving, deleting, and reordering files.

Manage your stored files with endpoints for listing, retrieving details, deleting, and reordering.

List files

Retrieve a paginated list of files in your organization's storage.

GET /api/v1/storage/media/files

Scope: storage:read

Query parameters

ParameterTypeRequiredDescription
folderstringNoFilter by folder path
tagsstringNoComma-separated tags to filter by
accessstringNoFilter by access level: public, authenticated, private
pagenumberNoPage number. Default: 1
limitnumberNoResults per page (max 100). Default: 20
sortstringNoSort field: createdAt, size, name. Default: createdAt
orderstringNoSort order: asc or desc. Default: desc

Response

{
  "success": true,
  "data": {
    "files": [
      {
        "fileId": "file_abc123def456",
        "url": "https://cdn.platformxe.com/org_123/products/photo.jpg",
        "filename": "photo.jpg",
        "format": "jpeg",
        "size": 154320,
        "width": 1200,
        "height": 800,
        "folder": "products",
        "access": "public",
        "tags": ["product", "featured"],
        "createdAt": "2026-04-05T14:30:00.000Z"
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 20,
      "total": 142,
      "totalPages": 8
    }
  }
}

curl

curl -G https://api.platformxe.com/api/v1/storage/media/files \
  -H "x-api-key: pxk_live_your_api_key_here" \
  -d "folder=products" \
  -d "limit=10" \
  -d "sort=createdAt" \
  -d "order=desc"

SDK

import { PlatformXe } from '@caldera/platformxe-sdk';

const px = new PlatformXe({ apiKey: 'pxk_live_your_api_key_here' });

const result = await px.storage.files.list({
  folder: 'products',
  limit: 10,
  sort: 'createdAt',
  order: 'desc',
});

console.log(result.data.files.length);
// 10

console.log(result.data.pagination.total);
// 142

Get a single file

Retrieve metadata for a specific file.

GET /api/v1/storage/media/files/:fileId

Scope: storage:read

Response

{
  "success": true,
  "data": {
    "fileId": "file_abc123def456",
    "url": "https://cdn.platformxe.com/org_123/products/photo.jpg",
    "filename": "photo.jpg",
    "format": "jpeg",
    "size": 154320,
    "width": 1200,
    "height": 800,
    "folder": "products",
    "access": "public",
    "tags": ["product", "featured"],
    "versions": 3,
    "createdAt": "2026-04-05T14:30:00.000Z",
    "updatedAt": "2026-04-05T16:00:00.000Z"
  }
}

curl

curl https://api.platformxe.com/api/v1/storage/media/files/file_abc123def456 \
  -H "x-api-key: pxk_live_your_api_key_here"

Delete a file

Permanently delete a file from storage.

DELETE /api/v1/storage/media/files/:fileId

Scope: storage:delete

Response

{
  "success": true,
  "data": {
    "fileId": "file_abc123def456",
    "deleted": true
  }
}

File deletion is permanent and cannot be undone. CDN-cached copies may take up to 15 minutes to propagate.

curl

curl -X DELETE https://api.platformxe.com/api/v1/storage/media/files/file_abc123def456 \
  -H "x-api-key: pxk_live_your_api_key_here"

Reorder files

Update the display order of files within a folder. Useful for gallery or carousel ordering.

POST /api/v1/storage/media/files/reorder

Scope: storage:read

Request body

FieldTypeRequiredDescription
folderstringYesThe folder whose files to reorder
orderArray<string>YesOrdered array of file IDs

Request example

{
  "folder": "products/gallery",
  "order": [
    "file_third_item",
    "file_first_item",
    "file_second_item"
  ]
}

Response

{
  "success": true,
  "data": {
    "folder": "products/gallery",
    "reordered": 3
  }
}

SDK

await px.storage.files.reorder({
  folder: 'products/gallery',
  order: ['file_third_item', 'file_first_item', 'file_second_item'],
});

Error responses

CodeDescription
NOT_FOUNDFile or folder does not exist
FORBIDDENAPI key does not have the required scope
RATE_LIMITEDRate limit exceeded for this API key