Get Authenticated User
GET /api/auth/me
Verifies the userToken cookie and returns the authenticated user's information.
Headers:
Cookie: must include userToken
Response (JSON):
{
"id": "string",
"name": "string",
"username": "string",
"role": number,
"avatar": {
"bgColor": "string",
"profileImage": "string | null",
"shadowFilter": number
}
}
Error Responses:
400: missing or invalid token, or user not found
Resources
Upload Files
POST /api/resources/upload
Uploads one or more files to the server.
Parameters (form-data):
files[] (file[], required): files to upload
Response:
Status 200 if successful. Empty response body.
Rename Resource
PATCH /api/resources/rename
Renames a file or directory.
Parameters (query or form-data):
source (string, required): original path
newName (string, required): new name for the resource
Response:
200: renamed successfully
400: missing parameters
404: access denied or path not found
500: server error
Delete Resource
DELETE /api/resources
Deletes a file or directory.
Parameters (query or form-data):
resourceUrl (string, required): path to delete
Response:
200: deleted successfully
400: missing parameters
404: access denied or not found
500: error during deletion
Get Resource Info
GET /api/resources/info
Returns metadata and MIME type for a resource.
Query Parameters:
resourcePath (string, required): path of the resource
Response (JSON):
File system stats with an added mimeType field.
Get Directories
GET /api/resources/directories
Returns the contents of a directory. Supports public and private directories.
Query Parameters:
directory (string, optional): path to list. Defaults to
directories/publicDirectories.
To access a private directory, set it to directories/<userId>
recursive (boolean, optional): include subdirectories
privateDir (boolean, optional): include user's private directory if
authenticated
Response:
Array of directory/file objects.
Create Directory
POST /api/resources/directories
Creates a new directory.
Parameters (query or form-data):
path (string, required): full path to create
Response:
200: directory created
400: path too long or missing
403: access denied
500: already exists or other error
Move Resource
PATCH /api/resources/move
Moves a file or directory to a new location.
Parameters (query or form-data):
source (string, required): current path
newLocation (string, required): target destination path
Response:
200: moved successfully
400: missing parameters
404: access denied
500: error moving resource