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.

Every endpoint reaches the files of a caller service within the key's organisation: the files your key's caller service uploaded with your organisation, and files uploaded before PlatformXe recorded organisations (until Caldera assigns them). Another organisation's file is never listed or reordered, and reading or deleting it answers 404 NOT_FOUND, even under the same caller service name; a file of another caller service answers 403 FORBIDDEN. A reorder that names a file outside that scope is refused whole.

List files

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

GET /api/v1/storage/media/files

Scope: storage:upload

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 { PlatformXeClient } from '@caldera/platformxe-sdk';

const px = new PlatformXeClient({ 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:upload

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:upload

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

Set the display order of files. Useful for gallery or carousel ordering: each file's position in fileIds becomes its display order.

PATCH /api/v1/storage/media/files/reorder

Scope: storage:upload

Request body

FieldTypeRequiredDescription
fileIdsArray<string>YesFile IDs in their new order (non-empty)

Every file must be one your key's caller service uploaded with your organisation. If any is not (another caller service's or organisation's file, or a deleted one), nothing is reordered and the request is refused.

List every live file of one entity (the same module and entityId), in its new order. Positions are unique per entity, so leaving one of its files out, or mixing files of two entities, can put two files at the same position: the whole reorder is then refused with the same 403 REORDER_FAILED ("Failed to reorder files") and nothing changes.

Request example

{
  "fileIds": [
    "file_third_item",
    "file_first_item",
    "file_second_item"
  ]
}

Response

{
  "success": true,
  "data": {
    "reordered": true
  }
}

SDK

client.storage.reorder_files(["file_third_item", "file_first_item", "file_second_item"])
result, err := client.Storage.ReorderFiles([]string{"file_third_item", "file_first_item", "file_second_item"})

The Python and Go SDKs send PATCH from 1.13.0 / v1.13.0 (earlier versions sent POST, which this route does not take).

Error responses

CodeDescription
BAD_REQUESTReorder: fileIds is missing, not an array, or empty (400)
REORDER_FAILEDReorder: a file in fileIds is not one your key may reorder, or the new order puts two of an entity's files at one position (list every live file of one entity); nothing was reordered (403)
NOT_FOUNDFile or folder does not exist, or the file is another organisation's
FORBIDDENAPI key does not have the required scope, or the file is another caller service's
RATE_LIMITEDRate limit exceeded for this API key