Gen-Endpoint
Back to API List
File Upload & Management API
Handle file uploads, downloads, metadata, and bulk operations with validation.
Utilities
Internal API - Hosted by this App
API Endpoints & Usage
Explore and interact with the available endpoints for the File Upload & Management API. These API routes are live! The paths shown below are relative to your application's base URL. For example, if this application is hosted at https://gen-endpoint.com, an endpoint path for this API, such as /api/upload, would be accessible at https://gen-endpoint.com/api/upload. You can use the "Try it out" section for each endpoint or use tools like curl, Postman, or your browser's address bar (for GET requests) to interact with them.
POST

/api/upload

Upload single or multiple files with validation and metadata extraction.

Show Static Examples

Example Request Body:

FormData with "files" field containing one or more files (e.g., document.pdf, image.jpg). Max 10MB per file.

Example Response:

{
  "success": true,
  "files": [
    {
      "id": "file_abc123",
      "originalName": "document.pdf",
      "filename": "file_abc123_document.pdf",
      "size": 1024000,
      "mimeType": "application/pdf",
      "uploadedAt": "2024-08-16T10:00:00Z",
      "url": "/api/files/file_abc123",
      "downloadUrl": "/api/files/file_abc123/download"
    }
  ],
  "uploaded": 1,
  "message": "All 1 file(s) uploaded successfully"
}
Try it out

Select files to upload

Please select at least one file to upload.

GET

/api/files

List uploaded files with metadata and pagination support.

Show Static Examples

Example Request Parameters:

?page=1&limit=10&type=image&search=profile&sortBy=size&sortOrder=desc

Example Response:

{
  "files": [
    {
      "id": "file_456",
      "originalName": "profile-photo.jpg",
      "size": 2048000,
      "mimeType": "image/jpeg",
      "uploadedAt": "2024-08-16T09:30:00Z",
      "url": "/api/files/file_456",
      "description": "Profile photo image",
      "tags": [
        "image",
        "profile"
      ]
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 1,
    "pages": 1,
    "hasNext": false,
    "hasPrev": false
  },
  "statistics": {
    "totalFiles": 1,
    "totalSize": 2048000,
    "typeDistribution": {
      "image": 1
    },
    "averageSize": 2048000
  }
}
Try it out

You can add or change query parameters in the path above (e.g., ?name=User).

GET

/api/files/{fileId}

Get file metadata by ID. Replace {fileId} with an actual ID like `file_123`.

Show Static Examples

Example Response:

{
  "id": "file_123",
  "originalName": "sample-document.pdf",
  "filename": "file_123_sample-document.pdf",
  "size": 1024000,
  "mimeType": "application/pdf",
  "uploadedAt": "2024-08-16T10:00:00Z",
  "url": "/api/files/file_123",
  "downloadUrl": "/api/files/file_123/download",
  "description": "Sample PDF document for testing",
  "tags": [
    "document",
    "sample"
  ]
}
Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above. You can also add/edit query parameters (e.g., ?key=value).

PUT

/api/files/{fileId}

Update file metadata (description, tags). Replace {fileId} with an ID like `file_123`.

Show Static Examples

Example Request Body:

{
  "description": "Updated sample PDF document",
  "tags": ["document", "sample", "updated"]
}

Example Response:

{
  "id": "file_123",
  "originalName": "sample-document.pdf",
  "size": 1024000,
  "mimeType": "application/pdf",
  "description": "Updated sample PDF document",
  "tags": [
    "document",
    "sample",
    "updated"
  ],
  "updatedAt": "2024-08-17T10:00:00Z"
}
Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above.

DELETE

/api/files/{fileId}

Delete uploaded file by ID. Replace {fileId} with an actual ID like `file_abc`.

Show Static Examples

Example Response:

{
  "message": "File file_abc deleted successfully.",
  "timestamp": "2024-08-16T11:00:00Z"
}
Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above.

GET

/api/files/{fileId}/download

Download the actual file content. Replace {fileId} with an ID like `file_123`.

Show Static Examples

Example Response:

File content of "sample-document.pdf" (actual binary data or text based on MIME type will be returned with appropriate headers).
Try it out

Replace placeholders (e.g., {userId}) with actual values in the path above. You can also add/edit query parameters (e.g., ?key=value).

POST

/api/files/bulk

Perform bulk operations like delete or tag on multiple files.

Show Static Examples

Example Request Body:

{
  "operation": "delete",
  "fileIds": ["file_123", "file_456"]
}

Example Response:

{
  "operation": "delete",
  "totalFiles": 2,
  "successful": 2,
  "failed": 0,
  "errors": [],
  "message": "Bulk delete completed: 2 successful, 0 failed"
}
Try it out
GET

/api/files/bulk

Get information about available bulk operations and their parameters.

Show Static Examples

Example Response:

{
  "endpoint": "/api/files/bulk",
  "method": "POST",
  "supportedOperations": [
    {
      "operation": "delete",
      "description": "Delete multiple files"
    },
    {
      "operation": "tag",
      "description": "Add tags to multiple files"
    }
  ]
}
Try it out

You can add or change query parameters in the path above (e.g., ?name=User).