Storage
Learn how to manage your project's storage via API.
Update Storage Size
Changes the storage capacity of the project.
PATCH /project/:id/storage/sizePath Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Project ID (ObjectId) |
Body
| Field | Type | Required | Description |
|---|---|---|---|
size | number | Yes | Storage size in GB (minimum 1, maximum 250) |
Example
{
"size": 20
}Response
{
"status": "success",
"data": {
"storage_size": 20
}
}Get Storage Usage
Returns information about the current storage usage of the project.
GET /project/:id/storage/usagePath Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Project ID (ObjectId) |
Response
{
"status": "success",
"data": {
"used_gb": 5.2,
"limit_gb": 10,
"usage_percentage": 52
}
}Examples
Update Storage Size
curl -X PATCH "https://api.zenifra.com/v1/project/507f1f77bcf86cd799439011/storage/size" \
-H "x-api-key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"size": 20}'Get Storage Usage
curl -X GET "https://api.zenifra.com/v1/project/507f1f77bcf86cd799439011/storage/usage" \
-H "x-api-key: your-api-key"Python
import requests
API_KEY = "your-api-key"
PROJECT_ID = "507f1f77bcf86cd799439011"
headers = {"x-api-key": API_KEY}
# Update storage size
requests.patch(
f"https://api.zenifra.com/v1/project/{PROJECT_ID}/storage/size",
headers=headers,
json={"size": 20}
)
# Get storage usage
usage = requests.get(
f"https://api.zenifra.com/v1/project/{PROJECT_ID}/storage/usage",
headers=headers
).json()
print(usage)Limits
- Minimum: 1 GB
- Maximum: 250 GB
Notes
- For hourly payment models, storage can be increased at any time
- Additional cost will be calculated proportionally
- For monthly or yearly contracts, there may be restrictions on changes