PlatformXeDocs
Get API Key

Storage Processor

Configuration reference for file storage provider, moderation, and size limits.

The storage processor controls which storage provider your organization uses, content moderation behaviour, and per-file-type size limits.

Endpoint

GET /api/v1/storage/processor -- Read current configuration.

PUT /api/v1/storage/processor -- Update configuration.

Scope: storage:manage

Configuration schema

{
  "config": {
    "provider": "cloudinary",
    "moderation": {
      "enabled": true,
      "autoReject": false,
      "blockedMimeTypes": []
    },
    "limits": {
      "maxImageSizeMb": 10,
      "maxDocumentSizeMb": 25,
      "maxVideoSizeMb": 100
    }
  }
}

Fields

FieldTypeDefaultDescription
provider"cloudinary" or "supabase""cloudinary"Storage backend for media uploads
moderation.enabledbooleantrueWhether uploaded files are scanned for policy violations
moderation.autoRejectbooleanfalseWhen true, flagged files are rejected immediately. When false, flagged files are held for manual review
moderation.blockedMimeTypesstring[][]MIME types that are rejected on upload (e.g., "application/x-executable")
limits.maxImageSizeMbnumber10Maximum image upload size in megabytes
limits.maxDocumentSizeMbnumber25Maximum document upload size in megabytes
limits.maxVideoSizeMbnumber100Maximum video upload size in megabytes

How it affects runtime

  • Provider selection: All new uploads are routed to the configured provider. Existing files remain on their original provider.
  • Moderation pipeline: When moderation.enabled is true, every upload is scanned. If autoReject is true, flagged content returns a MODERATION_REJECTED error immediately. If false, flagged content is quarantined and requires admin review before becoming accessible.
  • Blocked MIME types: Files matching any type in blockedMimeTypes are rejected at upload time with a BAD_REQUEST error. Use this to prevent executable or archive uploads.
  • Size limits: Uploads exceeding the configured limit for their file type are rejected with a BAD_REQUEST error. Size is checked before the file is transferred to the storage provider.

Examples

Enable auto-reject and block executables

curl

curl -X PUT https://api.platformxe.com/api/v1/storage/processor \
  -H "Content-Type: application/json" \
  -H "x-api-key: pxk_live_your_api_key_here" \
  -d '{
    "config": {
      "moderation": {
        "autoReject": true,
        "blockedMimeTypes": ["application/x-executable", "application/x-msdownload"]
      }
    }
  }'

TypeScript SDK

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

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

await px.storage.updateProcessor({
  config: {
    moderation: {
      autoReject: true,
      blockedMimeTypes: ['application/x-executable', 'application/x-msdownload'],
    },
  },
});

Python SDK

from platformxe import PlatformXe

px = PlatformXe(api_key="pxk_live_your_api_key_here")

px.storage.update_processor({
    "config": {
        "moderation": {
            "autoReject": True,
            "blockedMimeTypes": ["application/x-executable", "application/x-msdownload"]
        }
    }
})

Increase document size limit

await px.storage.updateProcessor({
  config: {
    limits: { maxDocumentSizeMb: 50 },
  },
});

Error responses

CodeDescription
FORBIDDENAPI key does not have the storage:manage scope
BAD_REQUESTInvalid config (e.g., unknown provider, negative size limit)
RATE_LIMITEDRate limit exceeded