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
| Field | Type | Default | Description |
|---|---|---|---|
provider | "cloudinary" or "supabase" | "cloudinary" | Storage backend for media uploads |
moderation.enabled | boolean | true | Whether uploaded files are scanned for policy violations |
moderation.autoReject | boolean | false | When true, flagged files are rejected immediately. When false, flagged files are held for manual review |
moderation.blockedMimeTypes | string[] | [] | MIME types that are rejected on upload (e.g., "application/x-executable") |
limits.maxImageSizeMb | number | 10 | Maximum image upload size in megabytes |
limits.maxDocumentSizeMb | number | 25 | Maximum document upload size in megabytes |
limits.maxVideoSizeMb | number | 100 | Maximum 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.enabledis true, every upload is scanned. IfautoRejectis true, flagged content returns aMODERATION_REJECTEDerror immediately. If false, flagged content is quarantined and requires admin review before becoming accessible. - Blocked MIME types: Files matching any type in
blockedMimeTypesare rejected at upload time with aBAD_REQUESTerror. Use this to prevent executable or archive uploads. - Size limits: Uploads exceeding the configured limit for their file type are rejected with a
BAD_REQUESTerror. 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
| Code | Description |
|---|---|
FORBIDDEN | API key does not have the storage:manage scope |
BAD_REQUEST | Invalid config (e.g., unknown provider, negative size limit) |
RATE_LIMITED | Rate limit exceeded |