📁 File Management API

File Management

Upload, download, and manage files in your projects with secure cloud storage.

Overview
Secure file management with cloud storage and CDN

Upload

Secure file upload with validation

Download

Fast CDN-powered downloads

Manage

Organize and delete files

API Endpoints

POST
/api/files/upload
Upload a file to the project

Parameters

file
file
Required
File to upload (max 50MB)
project_id
string
Required
Project ID to upload to
folder
string
Target folder path (default: root)
description
string
File description

Headers

AuthorizationBearer <token>
Required

Example Request

curl -X POST "/api/files/upload" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@example.js" \
-F "project_id=proj_123"

Response

Success
Status: 201
Response:
{
  "file": {
    "id": "file_uuid",
    "name": "example.js",
    "size": 1024,
    "type": "application/javascript",
    "url": "https://cdn.aura.com/files/file_uuid",
    "created_at": "2024-01-01T00:00:00Z"
  }
}
Error
Status: 400
Response:
{
  "error": "File too large or invalid type"
}
GET
/api/files/:id
Get file information and download URL

Parameters

id
string
Required
File ID

Headers

AuthorizationBearer <token>
Required

Example Request

curl -X GET "/api/files/:id" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@example.js" \
-F "project_id=proj_123"

Response

Success
Status: 200
Response:
{
  "file": {
    "id": "file_uuid",
    "name": "example.js",
    "size": 1024,
    "type": "application/javascript",
    "url": "https://cdn.aura.com/files/file_uuid",
    "download_url": "https://api.aura.com/files/file_uuid/download",
    "created_at": "2024-01-01T00:00:00Z"
  }
}
Error
Status: 404
Response:
{
  "error": "File not found"
}
GET
/api/files/:id/download
Download a file

Parameters

id
string
Required
File ID

Headers

AuthorizationBearer <token>
Required

Example Request

curl -X GET "/api/files/:id/download" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@example.js" \
-F "project_id=proj_123"

Response

Success
Status: 200
Response:
"File binary content"
Error
Status: 404
Response:
{
  "error": "File not found"
}
GET
/api/files
List all files in a project

Parameters

project_id
string
Required
Project ID
folder
string
Folder path to list
type
string
Filter by file type
page
number
Page number (default: 1)
limit
number
Items per page (default: 20)

Headers

AuthorizationBearer <token>
Required

Example Request

curl -X GET "/api/files" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@example.js" \
-F "project_id=proj_123"

Response

Success
Status: 200
Response:
{
  "files": [
    {
      "id": "file_uuid",
      "name": "example.js",
      "size": 1024,
      "type": "application/javascript",
      "created_at": "2024-01-01T00:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 1
  }
}
Error
Status: 401
Response:
{
  "error": "Unauthorized"
}
DELETE
/api/files/:id
Delete a file

Parameters

id
string
Required
File ID

Headers

AuthorizationBearer <token>
Required

Example Request

curl -X DELETE "/api/files/:id" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@example.js" \
-F "project_id=proj_123"

Response

Success
Status: 200
Response:
{
  "message": "File deleted successfully"
}
Error
Status: 404
Response:
{
  "error": "File not found"
}
Supported File Types
Various file types supported for upload and management
Code Files
Images
Archives
Documents

Note: Maximum file size is 50MB. Files are automatically scanned for security.