A robust file upload and management API service that allows users to securely upload, manage, and retrieve files.
https://api.foruploads.com/v1
token headerapiKey headerPOST /v1/auth/register
Request Body:
{
"username": "string",
"email": "string",
"password": "string"
}
Response:
{
"message": "Registration successful",
"token": "jwt_token",
"apiKey": "api_key",
"user": {
"id": "user_id",
"username": "username",
"email": "email"
}
}
POST /v1/auth/login
Request Body:
{
"email": "string",
"password": "string"
}
GET /v1/auth/api-key
Headers: token: jwt_token
POST /v1/auth/regenerate-api-key
Headers: token: jwt_token
apiKey header.POST /v1/files/upload
Headers: apiKey: your_api_key
Content-Type: multipart/form-data
Body: file: [file]
GET /v1/files
Headers: apiKey: your_api_key
GET /v1/files/:fileId
Headers: apiKey: your_api_key
DELETE /v1/files/:fileId
Headers: apiKey: your_api_key
GET /v1/files/deleted
Headers: apiKey: your_api_key
POST /v1/files/restore/:fileId
Headers: apiKey: your_api_key
GET /v1/files/stats
Headers: apiKey: your_api_key
Response:
{
"totalFiles": 12340,
"filesToday": 120,
"filesThisMonth": 2340,
"totalStorage": 51712000000,
"storageUsed": 51712000000,
"storageAvailable": 107374182400,
"successRate": 99.2,
"failedRate": 0.8,
"retries": 25
}
PUT /v1/settings/username
Headers: token: jwt_token
Request Body:
{
"newUsername": "new_username"
}
PUT /v1/settings/email
Headers: token: jwt_token
Request Body:
{
"newEmail": "new.email@example.com"
}
PUT /v1/settings/password
Headers: token: jwt_token
Request Body:
{
"currentPassword": "current_password",
"newPassword": "new_password"
}
uploads directoryError Response Format:
{
"error": "Error message",
"details": "Additional error details (in development mode)"
}
| Code | Description |
|---|---|
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 500 | Internal Server Error |