Storage limits
Check your site's current file count and storage usage against your plan's quota. Useful before a bulk upload, or to surface "near limit" warnings in an admin dashboard.
GET /api/v1/files/storage-limits
Returns current usage and the active plan's limits.
cURL
curl "https://www.flexweg.com/api/v1/files/storage-limits" \
-H "X-API-Key: YOUR_API_KEY"
200 OK
{
"success": true,
"plan": {
"name": "Free plan",
"type": "free"
},
"usage": {
"files": {
"current": 5,
"limit": 10,
"percentage": 50,
"available": 5
},
"storage": {
"current": 2048000,
"current_formatted": "2.00 MB",
"limit": 10485760,
"limit_formatted": "10.00 MB",
"percentage": 19.53,
"available": 8437760,
"available_formatted": "8.00 MB"
}
},
"warnings": {
"files_near_limit": false,
"storage_near_limit": false
}
}
Response fields
| Field | Description |
|---|---|
plan.name / plan.type | Human name and internal identifier of the active plan. |
usage.files.current / limit / available | File count metrics. |
usage.files.percentage | 0–100, how full the file slot is. |
usage.storage.current / limit / available | Byte-level metrics. _formatted variants are provided for display. |
usage.storage.percentage | 0–100, how full the storage quota is. |
warnings.files_near_limit | true when you've used 80% or more of your file count. |
warnings.storage_near_limit | true when you've used 80% or more of your storage. |
Pre-flight check before bulk uploads
Call this endpoint before a batch upload from a CI job — if you're close to the limit, fail fast with a clear error instead of hitting the quota mid-upload.