Files API
Upload, manage, and share files stored in secure cloud storage. All Files endpoints require authentication with a Silver or Gold API key. Storage quotas are enforced per subscription tier (Free: 100 MB, Bronze: 1 GB, Silver: 5 GB, Gold: 6 TB).
Base path: /api/flamenet/v1/files
Returns a paginated list of the authenticated user's files, newest first.
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number. |
per_page | integer | 20 | Files per page (max 100). |
Example request
curl https://flamenet.io/api/flamenet/v1/files \ -H "Authorization: Bearer YOUR_API_KEY"
Example response
{
"files": [
{
"id": 42,
"file_name": "report.pdf",
"size_bytes": 204800,
"size_display": "200 KB",
"mime_type": "application/pdf",
"is_shared": false,
"share_token": null,
"share_url": null,
"share_expires":null,
"created_at": "2026-03-01 10:00:00",
"updated_at": "2026-03-01 10:00:00"
}
],
"page": 1,
"per_page": 20,
"total": 1
}
Uploads a file to your cloud storage. Send the file as multipart/form-data using the field name file. Maximum file size is 50 MB per upload. Returns 413 if the file exceeds the per-file limit or your storage quota.
Request
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | The file to upload (multipart/form-data). |
Example request
curl -X POST https://flamenet.io/api/flamenet/v1/files \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@/path/to/report.pdf"
Example response — 201 Created
{
"id": 42,
"file_name": "report.pdf",
"size_bytes": 204800,
"size_display": "200 KB",
"mime_type": "application/pdf",
"is_shared": false,
"share_token": null,
"share_url": null,
"share_expires":null,
"created_at": "2026-03-02 09:15:00",
"updated_at": "2026-03-02 09:15:00"
}
413 Payload Too Large with error code quota_exceeded.Returns metadata for a single file. Only the file's owner can access it.
Example request
curl https://flamenet.io/api/flamenet/v1/files/42 \ -H "Authorization: Bearer YOUR_API_KEY"
Example response
{
"id": 42,
"file_name": "report.pdf",
"size_bytes": 204800,
"size_display": "200 KB",
"mime_type": "application/pdf",
"is_shared": true,
"share_token": "a3f8c2...",
"share_url": "https://flamenet.io/files/?fnf_share=a3f8c2...",
"share_expires":"2026-04-01 00:00:00",
"created_at": "2026-03-02 09:15:00",
"updated_at": "2026-03-02 10:00:00"
}
Permanently deletes a file from cloud storage and removes its database record. This action cannot be undone.
Example request
curl -X DELETE https://flamenet.io/api/flamenet/v1/files/42 \ -H "Authorization: Bearer YOUR_API_KEY"
Example response
{
"deleted": true,
"id": 42
}
Renames a file. Only the display name is changed — the underlying storage key and any existing share or download links are unaffected.
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | New file name (sanitized automatically). |
Example request
curl -X PATCH https://flamenet.io/api/flamenet/v1/files/42/rename \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"final-report.pdf"}'
Example response
{
"id": 42,
"file_name": "final-report.pdf",
...
}
Creates or refreshes a public share link for the file. Anyone with the link can download the file without an account. Only one share link can be active per file at a time.
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
expires | string | No | Expiry date in YYYY-MM-DD format. Omit for no expiry. |
Example request
curl -X POST https://flamenet.io/api/flamenet/v1/files/42/share \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"expires":"2026-04-01"}'
Example response
{
"id": 42,
"shared": true,
"token": "a3f8c2d1...",
"share_url": "https://flamenet.io/files/?fnf_share=a3f8c2d1...",
"expires": "2026-04-01 00:00:00"
}
Revokes the file's share link immediately. Any existing share URLs will return 404.
Example request
curl -X DELETE https://flamenet.io/api/flamenet/v1/files/42/share \ -H "Authorization: Bearer YOUR_API_KEY"
Example response
{
"id": 42,
"shared": false
}
Returns a presigned download URL for the file. The URL is valid for 5 minutes and grants direct access to the file in cloud storage. Follow the URL to begin the download.
Example request
curl https://flamenet.io/api/flamenet/v1/files/42/download \ -H "Authorization: Bearer YOUR_API_KEY"
Example response
{
"download_url": "https://your-bucket.s3.us-east-1.amazonaws.com/flamenet-files/...",
"expires_in": 300
}
Fetch download_url directly to stream the file. The URL cannot be used after expires_in seconds — call this endpoint again to get a fresh URL.