{"info":{"_postman_id":"17157c89-af67-4659-9677-d6ced5bd489a","name":"keyvia-backend","description":"<html><head></head><body><p>This is the official API documentation for KeyVia, a secure file vault and sharing platform built with Go and React.</p>\n<h3 id=\"authentication\">Authentication</h3>\n<p>All endpoints under the <code>/api</code> prefix are protected and require a JSON Web Token (JWT).</p>\n<p>To authenticate:</p>\n<ol>\n<li><p>Call the <strong><code>POST /auth/login</code></strong> endpoint with your credentials.</p>\n</li>\n<li><p>A JWT will be returned in the response body.</p>\n</li>\n<li><p>For all subsequent protected requests, include this token in the <strong>Authorization</strong> header.</p>\n</li>\n</ol>\n<p><strong>Format:</strong> <code>Authorization: Bearer</code></p>\n<h3 id=\"base-url\">Base URL</h3>\n<p>This collection uses a <code>{{baseURL}}</code> variable. Set this in your environment to point to the correct server (e.g., <code>http://localhost:8080</code> for local development).</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"39857190","collectionId":"17157c89-af67-4659-9677-d6ced5bd489a","publishedId":"2sB3HtFwWi","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2025-09-21T21:54:32.000Z"},"item":[{"name":"publicroutes","item":[{"name":"Health Check","id":"237c5d8b-f7ff-49eb-9ef8-3a5b7807068c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{baseURL}}/health","urlObject":{"path":["health"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"237c5d8b-f7ff-49eb-9ef8-3a5b7807068c"},{"name":"Public files download","id":"7d8d8357-2e20-4eb6-8669-1a49089af1aa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{baseURL}}/files/public/7","urlObject":{"path":["files","public","7"],"host":["{{baseURL}}"],"query":[{"disabled":true,"description":{"content":"<p>Public ID of the file to be downloaded</p>\n","type":"text/plain"},"key":"id","value":"7"}],"variable":[]}},"response":[],"_postman_id":"7d8d8357-2e20-4eb6-8669-1a49089af1aa"}],"id":"8bef6c0f-2af1-4e81-b727-e43567c445e8","description":"<h3 id=\"public-routes\">Public Routes</h3>\n<p>This folder contains endpoints that are publicly accessible and do not require any authentication. They are primarily used for system health checks and accessing publicly shared resources.</p>\n<p><strong>Endpoints:</strong></p>\n<ul>\n<li><p><strong><code>GET /health</code></strong>: A simple endpoint to verify that the API server is running and can successfully connect to the database. Essential for monitoring and uptime checks.</p>\n</li>\n<li><p><strong><code>GET /files/public/:id</code></strong>: Provides a direct download link for a file that has been explicitly made public by its owner. This is the primary mechanism for sharing files with non-users.</p>\n</li>\n</ul>\n","_postman_id":"8bef6c0f-2af1-4e81-b727-e43567c445e8"},{"name":"Authentication","item":[{"name":"Add A New User","id":"33e9f7a4-53fb-4068-bf18-a2d3ba2c46e7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"John Doe\",\r\n    \"username\": \"johndoe\",\r\n    \"password\": \"a-very-strong-password123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/auth/signup","urlObject":{"path":["auth","signup"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"980bce18-7e63-44e3-a3c8-161096bb9cb9","name":"Successful Creation","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"John Doe\",\r\n    \"username\": \"johndoe\",\r\n    \"password\": \"a-very-strong-password123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/auth/signup"},"status":"Created","code":201,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:10:11 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"36"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"09d5d3fd-36aa-4b87"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982c8c3c0aa79361-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Signup successful\"\n}"},{"id":"5441cd1d-d21c-4f44-a775-04ff774d279e","name":"User Already Exists","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"John Doe\",\r\n    \"username\": \"johndoe\",\r\n    \"password\": \"a-very-strong-password123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/auth/signup"},"status":"Conflict","code":409,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:10:59 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"40"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"0b19bc5a-7025-4e94"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982c8d6a6b3c9361-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Username already exists\"\n}"}],"_postman_id":"33e9f7a4-53fb-4068-bf18-a2d3ba2c46e7"},{"name":"Sign In User","event":[{"listen":"test","script":{"id":"e4f47e59-bbb9-45c4-a986-63554454ef0d","exec":["const response = pm.response.json();\r","if (response.token) {\r","    pm.environment.set(\"jwt_token\", response.token);\r","}"],"type":"text/javascript","packages":{}}}],"id":"5a5f9064-973a-4966-8740-9d875e91f146","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"johndoe\",\r\n    \"password\": \"wrongpassword\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/auth/login","urlObject":{"path":["auth","login"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"93fe7175-5519-47ac-8739-8329b3c06cbb","name":"Successful Login","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"johndoe\",\r\n    \"password\": \"a-very-strong-password123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/auth/login"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:13:37 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"225"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"15f5943a-cc72-4c21"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982c9142cac19368-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Login successful\",\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjYsInJvbGUiOiJ1c2VyIiwiZXhwIjoxNzU4NTc1NjE3LCJpYXQiOjE3NTg0ODkyMTd9.DNxME4c7ZbAeb6nZVhhenTxvDH7Lz0eR4M7B6YF3nNs\",\n    \"user\": {\n        \"id\": 6,\n        \"name\": \"John Doe\",\n        \"role\": \"user\",\n        \"username\": \"johndoe\"\n    }\n}"},{"id":"5a6930b8-8852-4242-9663-fa5b59f5ab2e","name":"Wrong Credentials","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"johndoe\",\r\n    \"password\": \"wrongpassword\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/auth/login"},"status":"Unauthorized","code":401,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:14:18 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"44"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"f2495226-bbc8-4460"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982c92456b829368-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Invalid username or password\"\n}"}],"_postman_id":"5a5f9064-973a-4966-8740-9d875e91f146"}],"id":"59c672dc-a0d3-4d8d-a76a-213bce429f59","description":"<h3 id=\"authentication\">Authentication</h3>\n<p>This folder contains the essential endpoints for user identity management. These are the entry points for any user wanting to interact with the platform.</p>\n<p><strong>Endpoints:</strong></p>\n<ul>\n<li><p><strong><code>POST /auth/signup</code></strong>: Handles the registration of new users. It requires a unique <code>username</code>, a <code>password</code>, and the user's <code>name</code>. The password is automatically hashed for secure storage.</p>\n</li>\n<li><p><strong><code>POST /auth/login</code></strong>: Authenticates a user based on their <code>username</code> and <code>password</code>. Upon successful authentication, it returns a JSON Web Token (JWT) which is required for accessing all protected routes under the <code>/api</code> prefix. It also updates the user's <code>last_login</code> timestamp.</p>\n</li>\n</ul>\n","_postman_id":"59c672dc-a0d3-4d8d-a76a-213bce429f59"},{"name":"File Management","item":[{"name":"Upload Files","id":"1596be19-0a6e-4d4e-b8aa-b371fa0f9feb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"<p>JWT token after Successful Login from a User (Required for all the Endpoints Operations)</p>\n","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"files","description":"<p>File Needed to be Uploaded</p>\n","type":"file","uuid":"f8853446-6c27-4ec6-bbe7-499c397dc24f","src":["postman-cloud:///1f09730b-9c40-40e0-a25b-e08807855e34","/C:/Users/jaina/Desktop/Resume/AbhishekJain-Resume.pdf"]}]},"url":"{{baseURL}}/api/files/upload","urlObject":{"path":["api","files","upload"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"221d118f-bb94-4e7c-89b6-9ab312ea652b","name":"Successful File Upload","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"JWT token after Successful Login from a User (Required for all the Endpoints Operations)","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"files","description":"File Needed to be Uploaded","type":"file","uuid":"f8853446-6c27-4ec6-bbe7-499c397dc24f","src":"/C:/Users/jaina/Desktop/Resume/Resume-AbhishekJain-SDE-1.pdf"}]},"url":"{{baseURL}}/api/files/upload"},"status":"Created","code":201,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:18:56 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"171"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"d1077f6a-8f53-4d47"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982c990ace32937a-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"files\": [\n        {\n            \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\",\n            \"size\": 245021,\n            \"uploadedAt\": \"2025-09-21T21:18:55.827905Z\",\n            \"userFileId\": 18,\n            \"wasDeduplicated\": true\n        }\n    ],\n    \"message\": \"Files uploaded successfully\",\n    \"uploadedCount\": 1\n}"}],"_postman_id":"1596be19-0a6e-4d4e-b8aa-b371fa0f9feb"},{"name":"Search and List Files","id":"5fcb6898-a236-4c90-8cd7-164a29c7369d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"<p>Authentication JWT Token for User Auth after Login for API Endpoint Operations</p>\n","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"filters\": {\r\n        \"filename\": \"\",\r\n        \"mimeType\": \"application/image\",\r\n        \"minSize\": 0,\r\n        \"maxSize\": 5242880,\r\n        \"startDate\": null,\r\n        \"endDate\": null\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/files/search","urlObject":{"path":["api","files","search"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"b4e7b3e7-bf10-40f0-8cfb-7cf9ca7cf700","name":"Successful File Fetching with Filters","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"Authentication JWT Token for User Auth after Login for API Endpoint Operations\n","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"filters\": {\r\n        \"filename\": null,\r\n        \"mimeType\": \"application/pdf\",\r\n        \"minSize\": 0,\r\n        \"maxSize\": 5242880,\r\n        \"startDate\": null,\r\n        \"endDate\": null\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/files/search"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:27:43 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"228"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"3473c607-951c-490f"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982ca5efda719374-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": 18,\n        \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\",\n        \"size\": 245021,\n        \"mimeType\": \"application/pdf\",\n        \"isPublic\": false,\n        \"downloadCount\": 0,\n        \"uploadedAt\": \"2025-09-21T21:18:55.827905Z\",\n        \"url\": \"https://res.cloudinary.com/dc2oyeaqi/v1758439299/mtuyizaec8zli61z3cmm.pdf\",\n        \"ownerName\": \"John Doe\",\n        \"refCount\": 3\n    }\n]"},{"id":"2f6deec9-d275-463c-a291-ea9a22501ad6","name":"No File Available","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"Authentication JWT Token for User Auth after Login for API Endpoint Operations\n","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"filters\": {\r\n        \"filename\": \"\",\r\n        \"mimeType\": \"application/image\",\r\n        \"minSize\": 0,\r\n        \"maxSize\": 5242880,\r\n        \"startDate\": null,\r\n        \"endDate\": null\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/files/search"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:28:26 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"9"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"9bcf35e6-4a3d-4f07"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982ca6fdec119374-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"null"}],"_postman_id":"5fcb6898-a236-4c90-8cd7-164a29c7369d"},{"name":"Authenticated File Download","id":"d66bacaa-755a-4730-8fca-5319989d7671","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"<p>Authentication JWT Token for User Auth after Login for API Endpoint Operations</p>\n","type":"text"}],"url":"{{baseURL}}/api/files/18/download","urlObject":{"path":["api","files","18","download"],"host":["{{baseURL}}"],"query":[{"disabled":true,"key":"","value":null}],"variable":[]}},"response":[{"id":"aba387a8-2847-401b-8598-c237a4a75c84","name":"Permission Denied","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"Authentication JWT Token for User Auth after Login for API Endpoint Operations\n","type":"text"}],"url":{"raw":"{{baseURL}}/api/files/7/download","host":["{{baseURL}}"],"path":["api","files","7","download"],"query":[{"key":"","value":null,"type":"text","disabled":true}]}},"status":"Forbidden","code":403,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:30:02 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"47"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"5de7e3ff-a8dd-4f20"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982ca9556c53937a-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"You do not have permission to download this file\"\n}"}],"_postman_id":"d66bacaa-755a-4730-8fca-5319989d7671"},{"name":"Delete a File","id":"bfc40b07-01ae-40e1-9525-733a24e0b133","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"<p>Authentication JWT Token for User Auth after Login for API Endpoint Operations</p>\n","type":"text"}],"url":"{{baseURL}}/api/files/7","urlObject":{"path":["api","files","7"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"80be49a2-9752-4b13-8dd0-0dea6fe790ed","name":"Successfully File Deleted","originalRequest":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"Authentication JWT Token for User Auth after Login for API Endpoint Operations\n","type":"text"}],"url":"{{baseURL}}/api/files/21"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:35:55 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"43"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"94e7dd05-f387-416b"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982cb1f078a89373-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"File deleted successfully\"\n}"},{"id":"10f7d81a-2331-4bbe-a299-29fc361ba87b","name":"Access Denied for File Deletion","originalRequest":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"Authentication JWT Token for User Auth after Login for API Endpoint Operations\n","type":"text"}],"url":"{{baseURL}}/api/files/7"},"status":"Forbidden","code":403,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:36:25 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"48"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"a3a37d8f-37a3-418b"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982cb2ad28e69373-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"You do not have permission to delete this file\"\n}"}],"_postman_id":"bfc40b07-01ae-40e1-9525-733a24e0b133"}],"id":"39a12563-e3a9-4b06-9250-9a7045be644f","description":"<h3 id=\"file-management\">File Management</h3>\n<p>This folder contains the core endpoints for interacting with files. All routes in this section are protected and require a valid JWT in the <code>Authorization</code> header.</p>\n<p><strong>Endpoints:</strong></p>\n<ul>\n<li><p><strong><code>POST /api/files/upload</code></strong>: The primary endpoint for adding files to the vault. It supports multiple file uploads in a single <code>multipart/form-data</code> request. Key features include SHA-256 content hashing for <strong>deduplication</strong> and enforcement of the user's <strong>storage quota</strong>.</p>\n</li>\n<li><p><strong><code>POST /api/files/search</code></strong>: A powerful and flexible endpoint to list and filter files. It returns all files owned by the user as well as any files that have been shared with them. The request body can include various filters like filename, MIME type, size, and date range. An empty request body will return all accessible files.</p>\n</li>\n<li><p><strong><code>GET /api/files/:id/download</code></strong>: Provides a secure, authenticated download link for a specific file. It verifies that the user is either the owner of the file or that the file has been explicitly shared with them.</p>\n</li>\n<li><p><strong><code>DELETE /api/files/:id</code></strong>: Deletes a user's file. The logic respects deduplication: it first removes the user's reference to the file and decrements the physical file's reference counter. The physical file is only deleted from cloud storage when its reference count reaches zero.</p>\n</li>\n</ul>\n","_postman_id":"39a12563-e3a9-4b06-9250-9a7045be644f"},{"name":"Sharing","item":[{"name":"Share File with a User","id":"c503a3ff-08f5-40e0-a560-842d9b53c70c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"<p>Authentication JWT Token for User Auth after Login for API Endpoint Operations</p>\n","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"shareWithUsername\": \"jainabhishek1904@gmail.com\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/files/18/share-with","urlObject":{"path":["api","files","18","share-with"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"91706434-2a7b-4676-a62d-11bcb22086b0","name":"Successfully Shared with A User","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"Authentication JWT Token for User Auth after Login for API Endpoint Operations\n","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"shareWithUsername\": \"jainabhishek1904@gmail.com\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/files/18/share-with"},"status":"Created","code":201,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:38:03 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"72"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"212a7cc6-2cff-4ad4"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982cb50fad539361-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"File successfully shared with jainabhishek1904@gmail.com\"\n}"},{"id":"f6f398e7-c3eb-4834-b1b4-e9f6df2a2850","name":"No User Found","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"Authentication JWT Token for User Auth after Login for API Endpoint Operations\n","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"shareWithUsername\": \"nouser\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/files/18/share-with"},"status":"Not Found","code":404,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:38:30 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"40"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"8ba5df60-7f9b-461e"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982cb5baff6e9361-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"User to share with not found\"\n}"},{"id":"e3629bac-69b7-4f9e-9f72-fcaf7f74eb5a","name":"File Already Shared","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"Authentication JWT Token for User Auth after Login for API Endpoint Operations\n","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"shareWithUsername\": \"jainabhishek1904@gmail.com\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/api/files/18/share-with"},"status":"Conflict","code":409,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:38:59 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"52"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"137ca0e5-52b1-4c6d"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982cb671e9b69361-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"File already shared with this user\"\n}"}],"_postman_id":"c503a3ff-08f5-40e0-a560-842d9b53c70c"},{"name":"Make File Public","id":"ee7966cd-5678-405f-8826-e3ba3cc51036","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"<p>Authentication JWT Token for User Auth after Login for API Endpoint Operations</p>\n","type":"text"}],"url":"{{baseURL}}/api/files/18/share-public","urlObject":{"path":["api","files","18","share-public"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"152401ac-3b72-4a3e-a999-34101c7010ee","name":"File Set Public Successfully","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"Authentication JWT Token for User Auth after Login for API Endpoint Operations\n","type":"text"}],"url":"{{baseURL}}/api/files/18/share-public"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:39:50 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"90"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"6a09fb8f-7036-40ac"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982cb7aead509361-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"File is now public\",\n    \"publicLink\": \"http://keyvia-backend.onrender.com/files/public/18\"\n}"},{"id":"a0b1a6dc-f5b4-4789-a02c-108d3e74d6ec","name":"File Not Found","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"Authentication JWT Token for User Auth after Login for API Endpoint Operations\n","type":"text"}],"url":"{{baseURL}}/api/files/1654645646/share-public"},"status":"Not Found","code":404,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:40:15 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"31"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"bc6e30cd-6f1c-4f91"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982cb84b9b569361-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"File not found\"\n}"}],"_postman_id":"ee7966cd-5678-405f-8826-e3ba3cc51036"},{"name":"Make File Private","id":"0757a986-1577-41f0-9a09-0118cdb300fa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"<p>Authentication JWT Token for User Auth after Login for API Endpoint Operations</p>\n","type":"text"}],"url":"{{baseURL}}/api/files/18/share-public","urlObject":{"path":["api","files","18","share-public"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"18bd98f8-58ad-4c39-b3ac-43067dc3be55","name":"File Successfully made Private from Public","originalRequest":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"Authentication JWT Token for User Auth after Login for API Endpoint Operations\n","type":"text"}],"url":"{{baseURL}}/api/files/18/share-public"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:41:14 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"38"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"02c5fd6a-37b5-4d33"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982cb9bdfde49361-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"File is now private\"\n}"}],"_postman_id":"0757a986-1577-41f0-9a09-0118cdb300fa"},{"name":"List Files Shared By Me","id":"5434a593-c4e9-48a9-bd17-5b516808062e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"<p>Authentication JWT Token for User Auth after Login for API Endpoint Operations</p>\n","type":"text"}],"url":"{{baseURL}}/api/files/shared-by-me","urlObject":{"path":["api","files","shared-by-me"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"95ea8727-ee34-4e26-a3c8-8bda0833eecc","name":"Successfully Retrieved File Shared by me","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"Authentication JWT Token for User Auth after Login for API Endpoint Operations\n","type":"text"}],"url":"{{baseURL}}/api/files/shared-by-me"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:42:23 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"275"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"98685816-cf25-463c"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982cbb684d139361-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": 18,\n        \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\",\n        \"size\": 245021,\n        \"mimeType\": \"application/pdf\",\n        \"isPublic\": false,\n        \"downloadCount\": 2,\n        \"uploadedAt\": \"2025-09-21T21:18:55.827905Z\",\n        \"url\": \"https://res.cloudinary.com/dc2oyeaqi/v1758439299/mtuyizaec8zli61z3cmm.pdf\",\n        \"ownerName\": \"John Doe\",\n        \"sharedWith\": [\n            {\n                \"id\": 2,\n                \"name\": \"Abhishek Jain\",\n                \"username\": \"jainabhishek1904@gmail.com\"\n            }\n        ]\n    }\n]"}],"_postman_id":"5434a593-c4e9-48a9-bd17-5b516808062e"}],"id":"f1180b21-0e2d-4452-a6f4-ddb26ca56d68","description":"<h3 id=\"sharing\">Sharing</h3>\n<p>This folder contains all endpoints related to the sharing and visibility of files. All routes are protected.</p>\n<p><strong>Endpoints:</strong></p>\n<ul>\n<li><p><strong><code>POST /api/files/:id/share-with</code></strong>: Allows a file owner to share a file directly and privately with another registered user by specifying their username.</p>\n</li>\n<li><p><strong><code>POST /api/files/:id/share-public</code></strong>: Makes a file publicly accessible to anyone with the generated link.</p>\n</li>\n<li><p><strong><code>DELETE /api/files/:id/share-public</code></strong>: Revokes public access for a file, making it private again. Only the file owner can perform this action.</p>\n</li>\n<li><p><strong><code>GET /api/files/shared-by-me</code></strong>: Retrieves a list of all files owned by the authenticated user that are currently being shared, either publicly or with specific users. It includes details on exactly who the files are shared with.</p>\n</li>\n<li><p><strong><code>DELETE /api/files/:id/share</code></strong>: This endpoint is for <strong>recipients</strong> of a shared file. It allows a user to \"unshare\" a file from themselves, effectively removing it from their view without deleting the original file for the owner.</p>\n</li>\n</ul>\n","_postman_id":"f1180b21-0e2d-4452-a6f4-ddb26ca56d68"},{"name":"User Analytics","item":[{"name":"Get User Analytics","id":"629e527e-2c82-4090-84e2-a942090e9f22","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"<p>Authentication JWT Token for User Auth after Login for API Endpoint Operations</p>\n","type":"text"}],"url":"{{baseURL}}/api/files/analytics","urlObject":{"path":["api","files","analytics"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"71394ca9-5585-4d00-b6ac-9023c5ffaa58","name":"Complete User Analytics","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"Authentication JWT Token for User Auth after Login for API Endpoint Operations\n","type":"text"}],"url":"{{baseURL}}/api/files/analytics"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:43:24 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"358"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"7573081a-b8bc-4608"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982cbce6dcbc9377-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"fileSizeAnalytics\": {\n        \"largestFiles\": [\n            {\n                \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\",\n                \"size\": 245021\n            },\n            {\n                \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\",\n                \"size\": 245021\n            },\n            {\n                \"filename\": \"Tech_JD-Software Engineer Intern_2026.pdf\",\n                \"size\": 88875\n            }\n        ]\n    },\n    \"fileTypeBreakdown\": [\n        {\n            \"mimeType\": \"application/pdf\",\n            \"count\": 3\n        }\n    ],\n    \"sharingAnalytics\": {\n        \"mostSharedFiles\": [\n            {\n                \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\",\n                \"share_count\": 1\n            }\n        ],\n        \"topCollaborators\": [\n            {\n                \"recipientName\": \"Abhishek Jain\",\n                \"files_shared_with_count\": 1\n            }\n        ]\n    },\n    \"storageStatistics\": {\n        \"deduplicatedUsageBytes\": 333896,\n        \"originalUsageBytes\": 578917,\n        \"savingsBytes\": 245021,\n        \"savingsPercentage\": 42.32402917862146\n    },\n    \"topDownloadedFiles\": [\n        {\n            \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\",\n            \"downloadCount\": 2\n        }\n    ],\n    \"uploadsByDay\": [\n        {\n            \"day\": \"2025-09-21T00:00:00Z\",\n            \"count\": 3\n        }\n    ]\n}"}],"_postman_id":"629e527e-2c82-4090-84e2-a942090e9f22"},{"name":"User Audit Logs(History)","id":"62aae09f-39f6-4469-a91a-cbd4f0a0234c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"<p>Authentication JWT Token for User Auth after Login for API Endpoint Operations</p>\n","type":"text"}],"url":"{{baseURL}}/api/logs","urlObject":{"path":["api","logs"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"a3f7e577-6013-4a01-a6d7-3ca8c797a67f","name":"History of User Actions","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"Authentication JWT Token for User Auth after Login for API Endpoint Operations\n","type":"text"}],"url":"{{baseURL}}/api/logs"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:44:29 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"f5c22d8c-6bc6-41a9"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982cbe7c0ffe9371-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": 54,\n        \"action\": \"FILE_UNSHARE_PUBLIC\",\n        \"targetId\": 18,\n        \"details\": {\n            \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\"\n        },\n        \"createdAt\": \"2025-09-21T21:41:38.593062Z\"\n    },\n    {\n        \"id\": 53,\n        \"action\": \"FILE_UNSHARE_PUBLIC\",\n        \"targetId\": 18,\n        \"details\": {\n            \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\"\n        },\n        \"createdAt\": \"2025-09-21T21:41:14.887002Z\"\n    },\n    {\n        \"id\": 52,\n        \"action\": \"FILE_SHARE_PUBLIC\",\n        \"targetId\": 18,\n        \"details\": {\n            \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\"\n        },\n        \"createdAt\": \"2025-09-21T21:40:32.740061Z\"\n    },\n    {\n        \"id\": 51,\n        \"action\": \"FILE_SHARE_PUBLIC\",\n        \"targetId\": 18,\n        \"details\": {\n            \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\"\n        },\n        \"createdAt\": \"2025-09-21T21:39:50.440065Z\"\n    },\n    {\n        \"id\": 50,\n        \"action\": \"FILE_SHARE_USER\",\n        \"targetId\": 18,\n        \"details\": {\n            \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\",\n            \"recipientUsername\": \"jainabhishek1904@gmail.com\"\n        },\n        \"createdAt\": \"2025-09-21T21:38:03.25506Z\"\n    },\n    {\n        \"id\": 49,\n        \"action\": \"FILE_DELETE\",\n        \"targetId\": 21,\n        \"details\": {\n            \"filename\": \"AbhishekJain-Resume.pdf\"\n        },\n        \"createdAt\": \"2025-09-21T21:35:55.91175Z\"\n    },\n    {\n        \"id\": 48,\n        \"action\": \"FILE_UPLOAD\",\n        \"targetId\": 21,\n        \"details\": {\n            \"size\": 123493,\n            \"filename\": \"AbhishekJain-Resume.pdf\",\n            \"deduplicated\": false\n        },\n        \"createdAt\": \"2025-09-21T21:34:41.860413Z\"\n    },\n    {\n        \"id\": 47,\n        \"action\": \"FILE_UPLOAD\",\n        \"targetId\": 20,\n        \"details\": {\n            \"size\": 245021,\n            \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\",\n            \"deduplicated\": true\n        },\n        \"createdAt\": \"2025-09-21T21:34:39.085344Z\"\n    },\n    {\n        \"id\": 46,\n        \"action\": \"FILE_UPLOAD\",\n        \"targetId\": 19,\n        \"details\": {\n            \"size\": 88875,\n            \"filename\": \"Tech_JD-Software Engineer Intern_2026.pdf\",\n            \"deduplicated\": false\n        },\n        \"createdAt\": \"2025-09-21T21:32:44.968177Z\"\n    },\n    {\n        \"id\": 45,\n        \"action\": \"FILE_UNSHARE_PUBLIC\",\n        \"targetId\": 18,\n        \"details\": {\n            \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\"\n        },\n        \"createdAt\": \"2025-09-21T21:32:09.307981Z\"\n    },\n    {\n        \"id\": 44,\n        \"action\": \"FILE_DOWNLOAD_AUTH\",\n        \"targetId\": 18,\n        \"details\": {\n            \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\"\n        },\n        \"createdAt\": \"2025-09-21T21:31:10.467923Z\"\n    },\n    {\n        \"id\": 43,\n        \"action\": \"FILE_SHARE_PUBLIC\",\n        \"targetId\": 18,\n        \"details\": {\n            \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\"\n        },\n        \"createdAt\": \"2025-09-21T21:30:40.95575Z\"\n    },\n    {\n        \"id\": 42,\n        \"action\": \"FILE_DOWNLOAD_AUTH\",\n        \"targetId\": 18,\n        \"details\": {\n            \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\"\n        },\n        \"createdAt\": \"2025-09-21T21:30:20.323193Z\"\n    },\n    {\n        \"id\": 41,\n        \"action\": \"FILE_UPLOAD\",\n        \"targetId\": 18,\n        \"details\": {\n            \"size\": 245021,\n            \"filename\": \"Resume-AbhishekJain-SDE-1.pdf\",\n            \"deduplicated\": true\n        },\n        \"createdAt\": \"2025-09-21T21:18:56.152923Z\"\n    }\n]"}],"_postman_id":"62aae09f-39f6-4469-a91a-cbd4f0a0234c"}],"id":"27e6b975-374d-4ad0-91a5-c5d29c822b3c","description":"<h3 id=\"user-analytics\">User Analytics</h3>\n<p>This folder contains endpoints that provide data and insights into a user's activity. All routes are protected.</p>\n<p><strong>Endpoints:</strong></p>\n<ul>\n<li><p><strong><code>POST /api/files/analytics</code></strong>: A comprehensive data-gathering endpoint that returns a detailed report for the authenticated user. This includes storage usage statistics (showing savings from deduplication), a timeline of uploads, a breakdown of file types, lists of top downloaded and shared files, and more.</p>\n</li>\n<li><p><strong><code>GET /api/logs</code></strong>: Retrieves the personal audit trail for the authenticated user. This provides a chronological history of their actions on the platform, such as <code>FILE_UPLOAD</code>, <code>FILE_DELETE</code>, and <code>FILE_SHARE_USER</code>.</p>\n</li>\n</ul>\n","_postman_id":"27e6b975-374d-4ad0-91a5-c5d29c822b3c"},{"name":"Admin","item":[{"name":"List All Files (Admin)","id":"2dc1b171-8df4-4af5-87d9-49238cc43710","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"<p>Authentication JWT Token for User Auth after Login for API Endpoint Operations</p>\n","type":"text"}],"url":"{{baseURL}}/api/admin/files/all","urlObject":{"path":["api","admin","files","all"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"b22747c8-8051-4516-b09d-4d9632c45ee0","name":"Retrieve All FIles(Only Admin)","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","description":"Authentication JWT Token for User Auth after Login for API Endpoint Operations\n","type":"text"}],"url":"{{baseURL}}/api/admin/files/all"},"status":"Forbidden","code":403,"_postman_previewlanguage":null,"header":[{"key":"Date","value":"Sun, 21 Sep 2025 21:45:51 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"36"},{"key":"Connection","value":"keep-alive"},{"key":"Content-Encoding","value":"br"},{"key":"rndr-id","value":"7328288a-ed05-4f19"},{"key":"vary","value":"Accept-Encoding"},{"key":"x-render-origin-server","value":"Render"},{"key":"cf-cache-status","value":"DYNAMIC"},{"key":"Server","value":"cloudflare"},{"key":"CF-RAY","value":"982cc0809efe9373-MAA"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Admin access required\"\n}"}],"_postman_id":"2dc1b171-8df4-4af5-87d9-49238cc43710"}],"id":"33c01dd9-649f-457f-827c-33d4346b0491","description":"<h3 id=\"admin\">Admin</h3>\n<p>This folder contains endpoints that are restricted to users with the <code>admin</code> role. These routes provide system-wide administrative capabilities.</p>\n<p><strong>Endpoints:</strong></p>\n<ul>\n<li><strong><code>POST /api/admin/files/all</code></strong>: A powerful administrative endpoint that retrieves a complete list of every file from every user across the entire system. This is intended for administrative oversight and content management. Access is strictly forbidden for non-admin users.</li>\n</ul>\n","_postman_id":"33c01dd9-649f-457f-827c-33d4346b0491"}]}