{"info":{"_postman_id":"8b26fbd8-3747-482d-a504-ed3e5d3d15b0","name":"CodeQuery","description":"<html><head></head><body><p><strong>CodeQuery</strong> is a full-stack MERN Developer Q&amp;A platform inspired by community-driven knowledge-sharing websites like Stack Overflow. The platform enables developers to ask questions, share solutions, engage in discussions, and collaborate within a structured technical community.</p>\n<p>Built with React, Node.js, Express.js, and MongoDB Atlas, CodeQuery incorporates an AI-powered moderation system using Groq LLM to automatically detect abusive, toxic, and spam content. To maintain a healthy community environment, the platform includes an automated strike-based enforcement system that permanently blocks users after repeated violations.</p>\n<p>The application features secure JWT authentication, bcrypt password hashing, custom rate limiting for abuse prevention, full-text search, real-time notifications, and a comprehensive admin dashboard for content moderation and user management. Designed with scalability, security, and real-world community management principles in mind, CodeQuery demonstrates the implementation of modern full-stack development practices, AI integration, and platform moderation systems.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"39216679","collectionId":"8b26fbd8-3747-482d-a504-ed3e5d3d15b0","publishedId":"2sBXwnsrid","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2026-05-29T14:07:24.000Z"},"item":[{"name":"Auth","item":[{"name":"Register User","id":"e3209d45-966e-4df8-bf75-8369f501501b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n  \"name\": \"John Doe\",\r\n  \"username\": \"johndoe\",\r\n  \"email\": \"john@gmail.com\",\r\n  \"password\": \"<password>\",\r\n  \"profileImage\": \"\"\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/auth/register","description":"<p>Creates a new user account. Returns a JWT token on success. Fails if the email or username is already taken, or if the password does not meet the complexity requirements.</p>\n<p><strong>Note:</strong> Password must be at least 8 characters, contain at least one uppercase letter and one number.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","auth","register"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"971ec63e-d09e-4347-9e2a-cc7ff04a15e0","name":"Register User","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n  \"name\": \"John Doe\",\r\n  \"username\": \"johndoe\",\r\n  \"email\": \"john@gmail.com\",\r\n  \"password\": \"<password>\",\r\n  \"profileImage\": \"\"\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/auth/register"},"status":"Created","code":201,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"294"},{"key":"ETag","value":"W/\"126-M2XJbGkqOCySzkMudzL0v2WVEcs\""},{"key":"Date","value":"Fri, 29 May 2026 07:28:51 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"_id\": \"id\",\n    \"name\": \"John Doe\",\n    \"username\": \"johndoe\",\n    \"email\": \"john@gmail.com\",\n    \"role\": \"user\",\n    \"token\": \"<token>\"\n}"}],"_postman_id":"e3209d45-966e-4df8-bf75-8369f501501b"},{"name":"Login User","id":"1a746000-4c9b-44bf-ba42-f5ce48e97dd9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n  \"email\": \"john@gmail.com\",\r\n  \"password\": \"<password>\"\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/auth/login","description":"<p>Authenticates a user and returns a JWT token. Blocked accounts receive a <code>403</code> error. Rate-limited to prevent brute-force attacks.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","auth","login"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"50c7679c-272c-404c-b750-c7e427c8c9b9","name":"Login User","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n  \"email\": \"john@gmail.com\",\r\n  \"password\": \"<password>\"\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/auth/login"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"RateLimit-Policy","value":"10;w=300"},{"key":"RateLimit-Limit","value":"10"},{"key":"RateLimit-Remaining","value":"8"},{"key":"RateLimit-Reset","value":"284"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"312"},{"key":"ETag","value":"W/\"138-+ycjjeKAIgTntlmt2gCdINBRFMw\""},{"key":"Date","value":"Fri, 29 May 2026 07:30:28 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"_id\": \"id\",\n    \"name\": \"John Doe\",\n    \"username\": \"johndoe\",\n    \"email\": \"john@gmail.com\",\n    \"role\": \"user\",\n    \"profileImage\": \"\",\n    \"token\": \"<token>\"\n}"}],"_postman_id":"1a746000-4c9b-44bf-ba42-f5ce48e97dd9"},{"name":"Logout User","id":"1c4d9c25-5c30-4191-9aed-d9e35f05f278","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"http://localhost:5000/api/auth/logout","description":"<p>Stateless logout. The client should discard the stored JWT token on their end.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","auth","logout"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"850b0262-facf-4f0b-a3f9-37e52d640326","name":"Logout User","originalRequest":{"method":"POST","header":[],"url":"http://localhost:5000/api/auth/logout"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"37"},{"key":"ETag","value":"W/\"25-71uUsMgZY3FdZp9j1h5YMrBIOgg\""},{"key":"Date","value":"Fri, 29 May 2026 07:31:33 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Logged out successfully\"\n}"}],"_postman_id":"1c4d9c25-5c30-4191-9aed-d9e35f05f278"}],"id":"c419dd25-3fae-4161-805a-ea52a24409b0","description":"<p>Authentication and account management endpoints for user registration, login, and secure access control using JWT.</p>\n","_postman_id":"c419dd25-3fae-4161-805a-ea52a24409b0"},{"name":"Posts","item":[{"name":"Get All Posts","id":"0c9c0e6c-c2cd-4b04-971e-629b95da743a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/posts?page=1&sort=latest&tag=javascript","description":"<p>Returns a paginated list of all non-flagged posts. Supports sorting and filtering by tag.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","posts"],"host":["localhost"],"query":[{"description":{"content":"<p>Page number for pagination</p>\n","type":"text/plain"},"key":"page","value":"1"},{"description":{"content":"<p>Sort by: latest, mostViewed, mostReplied</p>\n","type":"text/plain"},"key":"sort","value":"latest"},{"description":{"content":"<p>Filter posts by a specific tag</p>\n","type":"text/plain"},"key":"tag","value":"javascript"}],"variable":[]}},"response":[{"id":"5b0f15d8-d367-4a44-bdd2-9c8498687d0f","name":"Get All Posts","originalRequest":{"method":"GET","header":[],"url":"http://localhost:5000/api/posts"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1053"},{"key":"ETag","value":"W/\"41d-F30/HYjpv9/xzGEJJ/CwBeruLQk\""},{"key":"Date","value":"Fri, 29 May 2026 07:32:45 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"posts\": [\n        {\n            \"_id\": \"id\",\n            \"title\": \"how to merge two strings in c++ ?\",\n            \"description\": \"i have two strings and i want to know how to merge them into one.\",\n            \"tags\": [\n                \"javascript\"\n            ],\n            \"images\": [],\n            \"author\": {\n                \"_id\": \"id\",\n                \"username\": \"khushbu\",\n                \"profileImage\": \"https://res.cloudinary.com/ddbya1gnh/image/upload/v1738645506/cld-sample.jpg\"\n            },\n            \"viewCount\": 3,\n            \"replyCount\": 0,\n            \"isFlagged\": false,\n            \"createdAt\": \"2026-04-27T09:27:00.309Z\",\n            \"updatedAt\": \"2026-05-29T07:10:24.239Z\",\n            \"__v\": 0\n        },\n        {\n            \"_id\": \"id\",\n            \"title\": \"how to create a component in react ?\",\n            \"description\": \"how do i create a component in react ?\",\n            \"tags\": [\n                \"react\"\n            ],\n            \"images\": [\n                \"https://res.cloudinary.com/ddbya1gnh/image/upload/v1738645506/cld-sample.jpg\"\n            ],\n            \"author\": {\n                \"_id\": \"id\",\n                \"username\": \"khushbu\",\n                \"profileImage\": \"https://res.cloudinary.com/ddbya1gnh/image/upload/v1738645506/cld-sample.jpg\"\n            },\n            \"viewCount\": 7,\n            \"replyCount\": 1,\n            \"isFlagged\": false,\n            \"createdAt\": \"2026-04-27T09:21:44.957Z\",\n            \"updatedAt\": \"2026-05-29T07:10:35.856Z\",\n            \"__v\": 0\n        }\n    ],\n    \"page\": 1,\n    \"pages\": 1\n}"},{"id":"9f31d06f-d57f-40fa-a5b0-51b16b0167a6","name":"Get All Posts with filters","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:5000/api/posts?page=1&sort=latest&tag=javascript","protocol":"http","host":["localhost"],"port":"5000","path":["api","posts"],"query":[{"key":"page","value":"1","description":"Page number for pagination"},{"key":"sort","value":"latest","description":"Sort by: latest, mostViewed, mostReplied"},{"key":"tag","value":"javascript","description":"Filter posts by a specific tag"}]}},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"517"},{"key":"ETag","value":"W/\"205-lROrwFZeE8ylA9c9uqbnXDgivIM\""},{"key":"Date","value":"Fri, 29 May 2026 07:35:53 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"posts\": [\n        {\n            \"_id\": \"id\",\n            \"title\": \"how to merge two strings in c++ ?\",\n            \"description\": \"i have two strings and i want to know how to merge them into one.\",\n            \"tags\": [\n                \"javascript\"\n            ],\n            \"images\": [],\n            \"author\": {\n                \"_id\": \"id\",\n                \"username\": \"khushbu\",\n                \"profileImage\": \"https://res.cloudinary.com/ddbya1gnh/image/upload/v1738645506/cld-sample.jpg\"\n            },\n            \"viewCount\": 3,\n            \"replyCount\": 0,\n            \"isFlagged\": false,\n            \"createdAt\": \"2026-04-27T09:27:00.309Z\",\n            \"updatedAt\": \"2026-05-29T07:10:24.239Z\",\n            \"__v\": 0\n        }\n    ],\n    \"page\": 1,\n    \"pages\": 1\n}"}],"_postman_id":"0c9c0e6c-c2cd-4b04-971e-629b95da743a"},{"name":"Get Post By Id","id":"a264de4e-ff31-4a22-b56a-b8925ffeef15","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/posts/:id","description":"<p>Returns a single post by its ID. Each call increments the post's <code>viewCount</code> by 1.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","posts",":id"],"host":["localhost"],"query":[],"variable":[{"description":{"content":"<p>MongoDB ObjectId of the post</p>\n","type":"text/plain"},"type":"any","value":"id","key":"id"}]}},"response":[{"id":"dd87e9c3-69bb-4b80-aefd-70ae5a641f80","name":"Get Post By Id","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:5000/api/posts/:id","protocol":"http","host":["localhost"],"port":"5000","path":["api","posts",":id"],"variable":[{"key":"id","value":"id","description":"MongoDB ObjectId of the post"}]}},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"535"},{"key":"ETag","value":"W/\"217-IJzMsj2fYv97HPdRlhby7ZO/vLg\""},{"key":"Date","value":"Fri, 29 May 2026 07:38:31 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"_id\": \"id\",\n    \"title\": \"how to create a component in react ?\",\n    \"description\": \"how do i create a component in react ?\",\n    \"tags\": [\n        \"react\"\n    ],\n    \"images\": [\n        \"https://res.cloudinary.com/ddbya1gnh/image/upload/v1738645506/cld-sample.jpg\"\n    ],\n    \"author\": {\n        \"_id\": \"id\",\n        \"username\": \"khushbu\",\n        \"profileImage\": \"https://res.cloudinary.com/ddbya1gnh/image/upload/v1738645506/cld-sample.jpg\"\n    },\n    \"viewCount\": 8,\n    \"replyCount\": 1,\n    \"isFlagged\": false,\n    \"createdAt\": \"2026-04-27T09:21:44.957Z\",\n    \"updatedAt\": \"2026-05-29T07:38:31.585Z\",\n    \"__v\": 0\n}"}],"_postman_id":"a264de4e-ff31-4a22-b56a-b8925ffeef15"},{"name":"Create a Post","id":"b66f7a6a-afef-40ac-a5ac-a0e675e1518b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"title\": \"How do I reverse a string in Python?\",\r\n  \"description\": \"I tried using a for loop but it seems inefficient. Any better approach?\",\r\n  \"tags\": [\"python\", \"strings\"],\r\n  \"images\": [\"https://example.com/screenshot.png\"]\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/posts","description":"<p>Creates a new post. Content is passed through AI moderation before saving. If flagged as abusive, the post is rejected, the user's abuse count is incremented, and a notification is sent. After 3 violations the user's account is permanently blocked. Rate-limited per user.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","posts"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"4b91ac3c-6faf-413c-b0b1-c7d58b4d61fb","name":"Create a Post","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"title\": \"How do I reverse a string in Python?\",\r\n  \"description\": \"I tried using a for loop but it seems inefficient. Any better approach?\",\r\n  \"tags\": [\"python\", \"strings\"],\r\n  \"images\": [\"https://example.com/screenshot.png\"]\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/posts"},"status":"Created","code":201,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"RateLimit-Policy","value":"5;w=60"},{"key":"RateLimit-Limit","value":"5"},{"key":"RateLimit-Remaining","value":"4"},{"key":"RateLimit-Reset","value":"60"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"414"},{"key":"ETag","value":"W/\"19e-4O19B9VYohnL+A+2eCqkS46PGk4\""},{"key":"Date","value":"Fri, 29 May 2026 07:48:02 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"title\": \"How do I reverse a string in Python?\",\n    \"description\": \"I tried using a for loop but it seems inefficient. Any better approach?\",\n    \"tags\": [\n        \"python\",\n        \"strings\"\n    ],\n    \"images\": [\n        \"https://example.com/screenshot.png\"\n    ],\n    \"author\": \"id\",\n    \"viewCount\": 0,\n    \"replyCount\": 0,\n    \"isFlagged\": false,\n    \"_id\": \"id\",\n    \"createdAt\": \"2026-05-29T07:48:01.960Z\",\n    \"updatedAt\": \"2026-05-29T07:48:01.960Z\",\n    \"__v\": 0\n}"},{"id":"25f3e063-f467-46e2-8087-4f64ec1e445d","name":"Create Abusive Post","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"title\": \"You're the Worst Developer I've Ever Seen\",\r\n  \"description\": \"Your code is garbage and clearly shows that you have no idea what you're doing. Every post you make lowers the quality of this community. Stop embarrassing yourself and learn the basics before asking more questions.\",\r\n  \"tags\": [\"python\", \"strings\"],\r\n  \"images\": [\"https://example.com/screenshot.png\"]\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/posts"},"status":"Bad Request","code":400,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"RateLimit-Policy","value":"5;w=60"},{"key":"RateLimit-Limit","value":"5"},{"key":"RateLimit-Remaining","value":"4"},{"key":"RateLimit-Reset","value":"60"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"127"},{"key":"ETag","value":"W/\"7f-yTYNXCkKGOXp7/BX/yAOtMb4opk\""},{"key":"Date","value":"Fri, 29 May 2026 07:52:16 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Content flagged as abusive.\",\n    \"reason\": \"contains derogatory language, insults, and aggressive tone\",\n    \"abuse_count\": 1\n}"}],"_postman_id":"b66f7a6a-afef-40ac-a5ac-a0e675e1518b"},{"name":"Delete a Post","id":"3f0c4591-7140-456c-899c-fdf4388de69d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"body":{"mode":"raw","raw":""},"url":"http://localhost:5000/api/posts/:id","description":"<p>Deletes a post. Only the original author or an admin can delete it. Returns <code>401</code> if the requesting user is neither.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","posts",":id"],"host":["localhost"],"query":[],"variable":[{"description":{"content":"<p>MongoDB ObjectId of the post to delete</p>\n","type":"text/plain"},"type":"any","value":"id","key":"id"}]}},"response":[{"id":"8164a9b2-ee80-4872-b6b8-91f444fd18cb","name":"Delete a Post","originalRequest":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":{"raw":"http://localhost:5000/api/posts/:id","protocol":"http","host":["localhost"],"port":"5000","path":["api","posts",":id"],"variable":[{"key":"id","value":"id","description":"MongoDB ObjectId of the post to delete"}]}},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"26"},{"key":"ETag","value":"W/\"1a-xjtL9DrpJUon0s/GGpVx5HsVysY\""},{"key":"Date","value":"Fri, 29 May 2026 08:01:03 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Post removed\"\n}"}],"_postman_id":"3f0c4591-7140-456c-899c-fdf4388de69d"}],"id":"86772a7b-76ad-47d4-9e7b-a13865c81f0b","description":"<p>Endpoints for creating, retrieving, updating, and managing developer questions and posts on the platform.</p>\n","_postman_id":"86772a7b-76ad-47d4-9e7b-a13865c81f0b"},{"name":"Replies","item":[{"name":"Get Replies for a Post","id":"12848320-caae-478b-830a-d5ffd34013fa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/posts/:id/replies","description":"<p>Returns all non-flagged replies for a specific post, sorted by oldest first.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","posts",":id","replies"],"host":["localhost"],"query":[],"variable":[{"description":{"content":"<p>MongoDB ObjectId of the parent post</p>\n","type":"text/plain"},"type":"any","value":"id","key":"id"}]}},"response":[{"id":"f9931703-e2b5-48a4-bd8c-cbe19ec50205","name":"Get Replies for a Post","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:5000/api/posts/:id/replies","protocol":"http","host":["localhost"],"port":"5000","path":["api","posts",":id","replies"],"variable":[{"key":"id","value":"id","description":"MongoDB ObjectId of the parent post"}]}},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"401"},{"key":"ETag","value":"W/\"191-a2qptWIy5qGjNWV+JsE9JeK+yW0\""},{"key":"Date","value":"Fri, 29 May 2026 08:06:35 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"_id\": \"id\",\n        \"post\": \"id\",\n        \"author\": {\n            \"_id\": \"id\",\n            \"username\": \"admin123\",\n            \"profileImage\": \"https://res.cloudinary.com/ddbya1gnh/image/upload/v1738645506/cld-sample-2.jpg\"\n        },\n        \"content\": \"its easy to create a component in react.\",\n        \"images\": [],\n        \"isFlagged\": false,\n        \"createdAt\": \"2026-04-27T09:23:30.360Z\",\n        \"updatedAt\": \"2026-04-27T09:23:30.360Z\",\n        \"__v\": 0\n    }\n]"}],"_postman_id":"12848320-caae-478b-830a-d5ffd34013fa"},{"name":"Create a Reply","id":"43bdad7b-031d-46f3-956b-108d4c005f1f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"content\": \"You can use + operator\",\r\n  \"images\": [\"https://example.com/code-screenshot.png\"]\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/posts/:id/replies","description":"<p>Creates a reply on a post. Content is AI-moderated. The post author receives a notification when someone replies (unless they reply to their own post). Rate-limited per user.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","posts",":id","replies"],"host":["localhost"],"query":[],"variable":[{"description":{"content":"<p>MongoDB ObjectId of the parent post</p>\n","type":"text/plain"},"type":"any","value":"id","key":"id"}]}},"response":[{"id":"991ba7e7-44ff-4446-a300-fc307e1ba12c","name":"Create a Reply","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"content\": \"You can use + operator\",\r\n  \"images\": [\"https://example.com/code-screenshot.png\"]\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:5000/api/posts/:id/replies","protocol":"http","host":["localhost"],"port":"5000","path":["api","posts",":id","replies"],"variable":[{"key":"id","value":"id","description":"MongoDB ObjectId of the parent post"}]}},"status":"Created","code":201,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"RateLimit-Policy","value":"5;w=60"},{"key":"RateLimit-Limit","value":"5"},{"key":"RateLimit-Remaining","value":"4"},{"key":"RateLimit-Reset","value":"60"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"296"},{"key":"ETag","value":"W/\"128-R4rvLN0oKqk/h0mjl2ZaHwBtnpM\""},{"key":"Date","value":"Fri, 29 May 2026 08:09:35 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"post\": \"id\",\n    \"author\": \"id\",\n    \"content\": \"You can use + operator\",\n    \"images\": [\n        \"https://example.com/code-screenshot.png\"\n    ],\n    \"isFlagged\": false,\n    \"_id\": \"id\",\n    \"createdAt\": \"2026-05-29T08:09:34.835Z\",\n    \"updatedAt\": \"2026-05-29T08:09:34.835Z\",\n    \"__v\": 0\n}"}],"_postman_id":"43bdad7b-031d-46f3-956b-108d4c005f1f"},{"name":"Delete a Reply","id":"9a8d3a25-7f3c-4610-a132-8a0c7113526a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"http://localhost:5000/api/replies/:id","description":"<p>Deletes a reply and decrements the parent post's <code>replyCount</code>. Only the reply author or an admin can perform this action.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","replies",":id"],"host":["localhost"],"query":[],"variable":[{"description":{"content":"<p>MongoDB ObjectId of the reply to delete</p>\n","type":"text/plain"},"type":"any","value":"id","key":"id"}]}},"response":[{"id":"49d38aa2-80df-4804-bba7-3b941c8c51f2","name":"Delete a Reply","originalRequest":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":{"raw":"http://localhost:5000/api/replies/:id","protocol":"http","host":["localhost"],"port":"5000","path":["api","replies",":id"],"variable":[{"key":"id","value":"id","description":"MongoDB ObjectId of the reply to delete"}]}},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"27"},{"key":"ETag","value":"W/\"1b-rKOQLcYkloGk9ZRcMjR/ASS4Hpo\""},{"key":"Date","value":"Fri, 29 May 2026 08:13:23 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Reply removed\"\n}"}],"_postman_id":"9a8d3a25-7f3c-4610-a132-8a0c7113526a"}],"id":"2a6361d0-9cbf-4504-9b93-c9263a3c3341","description":"<p>Endpoints for adding, viewing, and managing replies to developer questions and discussions.</p>\n","_postman_id":"2a6361d0-9cbf-4504-9b93-c9263a3c3341"},{"name":"Notifications","item":[{"name":"Get Notifications","id":"dae59ce3-be07-4127-87b7-03ff74ac0834","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"http://localhost:5000/api/notifications","description":"<p>Returns the 20 most recent notifications for the logged-in user, sorted newest first. Notification types include: <code>reply</code>, <code>abuse_warning</code>, <code>account_blocked</code>, <code>account_unblocked</code>.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","notifications"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"79ef80fc-ef29-486f-8a0e-16afb9bea5d7","name":"Get Notifications","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"http://localhost:5000/api/notifications"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"325"},{"key":"ETag","value":"W/\"145-J5CWoP7/FwUKfjcm9IeRylXi+6k\""},{"key":"Date","value":"Fri, 29 May 2026 08:15:57 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"_id\": \"id\",\n        \"recipient\": \"id\",\n        \"type\": \"abuse_warning\",\n        \"message\": \"Warning: Your post was flagged for: contains derogatory language, insults, and aggressive tone. Abuse count: 1/3.\",\n        \"isRead\": false,\n        \"createdAt\": \"2026-05-29T07:52:15.932Z\",\n        \"updatedAt\": \"2026-05-29T07:52:15.932Z\",\n        \"__v\": 0\n    }\n]"}],"_postman_id":"dae59ce3-be07-4127-87b7-03ff74ac0834"},{"name":"Mark Notification as Read","id":"e8bda037-6684-446c-9237-7ee0e8921ebe","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"http://localhost:5000/api/notifications/:id/read","description":"<p>Marks a specific notification as read. Only the notification's recipient can mark it as read.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","notifications",":id","read"],"host":["localhost"],"query":[],"variable":[{"description":{"content":"<p>MongoDB ObjectId of the notification</p>\n","type":"text/plain"},"type":"any","value":"id","key":"id"}]}},"response":[{"id":"acea0888-ff8d-4f3d-961a-b2fae8314b09","name":"Mark Notification as Read","originalRequest":{"method":"PATCH","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":{"raw":"http://localhost:5000/api/notifications/:id/read","protocol":"http","host":["localhost"],"port":"5000","path":["api","notifications",":id","read"],"variable":[{"key":"id","value":"id","description":"MongoDB ObjectId of the notification"}]}},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"322"},{"key":"ETag","value":"W/\"142-BLPfjjf9cG/wDdNowxm0a1Rz7jg\""},{"key":"Date","value":"Fri, 29 May 2026 08:19:04 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"_id\": \"id\",\n    \"recipient\": \"id\",\n    \"type\": \"abuse_warning\",\n    \"message\": \"Warning: Your post was flagged for: contains derogatory language, insults, and aggressive tone. Abuse count: 1/3.\",\n    \"isRead\": true,\n    \"createdAt\": \"2026-05-29T07:52:15.932Z\",\n    \"updatedAt\": \"2026-05-29T08:19:04.688Z\",\n    \"__v\": 0\n}"}],"_postman_id":"e8bda037-6684-446c-9237-7ee0e8921ebe"}],"id":"0b0abb96-7dfe-4ba2-a6b2-b4ebb1f5deea","description":"<p>User-specific endpoints for retrieving and managing notifications related to replies, moderation actions, and platform activity.</p>\n","_postman_id":"0b0abb96-7dfe-4ba2-a6b2-b4ebb1f5deea"},{"name":"Admin","item":[{"name":"Get All Users","id":"45b87881-7480-4675-933e-968dfd3d0774","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"http://localhost:5000/api/admin/users","description":"<p>Returns all registered users (passwords excluded). Useful for the admin dashboard to monitor and manage users.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","admin","users"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"03b8f8df-a0f9-4754-85f2-46a00e820ebb","name":"Get All Users","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"http://localhost:5000/api/admin/users"},"status":"OK","code":200,"_postman_previewlanguage":"","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1177"},{"key":"ETag","value":"W/\"499-LRBfgEqL6/83pLUFBZz4a2qQCAU\""},{"key":"Date","value":"Fri, 29 May 2026 08:23:38 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[{"expires":"Invalid Date","domain":"","path":""}],"responseTime":null,"body":"[\n    {\n        \"_id\": \"id\",\n        \"name\": \"Khushbu Patel\",\n        \"username\": \"khushbu\",\n        \"email\": \"khushbu@gmail.com\",\n        \"profileImage\": \"https://res.cloudinary.com/ddbya1gnh/image/upload/v1738645506/cld-sample.jpg\",\n        \"role\": \"user\",\n        \"abuse_count\": 1,\n        \"is_blocked\": false,\n        \"createdAt\": \"2026-04-27T09:20:51.028Z\",\n        \"updatedAt\": \"2026-04-27T09:42:35.136Z\",\n        \"__v\": 0\n    },\n    {\n        \"_id\": \"id\",\n        \"name\": \"Admin\",\n        \"username\": \"admin123\",\n        \"email\": \"admin@gmail.com\",\n        \"profileImage\": \"https://res.cloudinary.com/ddbya1gnh/image/upload/v1738645506/cld-sample-2.jpg\",\n        \"role\": \"admin\",\n        \"abuse_count\": 0,\n        \"is_blocked\": false,\n        \"createdAt\": \"2026-04-27T09:23:04.719Z\",\n        \"updatedAt\": \"2026-04-27T09:23:04.719Z\",\n        \"__v\": 0\n    },\n    {\n        \"_id\": \"id\",\n        \"name\": \"Pooja Pooju\",\n        \"username\": \"Prince\",\n        \"email\": \"pooju661@gmail.com\",\n        \"profileImage\": \"\",\n        \"role\": \"user\",\n        \"abuse_count\": 0,\n        \"is_blocked\": false,\n        \"createdAt\": \"2026-05-04T17:03:16.236Z\",\n        \"updatedAt\": \"2026-05-04T17:03:16.236Z\",\n        \"__v\": 0\n    },\n    {\n        \"_id\": \"id\",\n        \"name\": \"John Doe\",\n        \"username\": \"johndoe\",\n        \"email\": \"john@gmail.com\",\n        \"profileImage\": \"\",\n        \"role\": \"user\",\n        \"abuse_count\": 1,\n        \"is_blocked\": false,\n        \"createdAt\": \"2026-05-29T07:28:47.265Z\",\n        \"updatedAt\": \"2026-05-29T07:52:15.873Z\",\n        \"__v\": 0\n    }\n]"}],"_postman_id":"45b87881-7480-4675-933e-968dfd3d0774"},{"name":"Block a User","id":"38d92c9d-254d-4ffa-b913-a81a0d44badb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"http://localhost:5000/api/admin/users/:id/block","description":"<p>Sets <code>is_blocked: true</code> on the user account, preventing future logins. Sends a notification to the affected user.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","admin","users",":id","block"],"host":["localhost"],"query":[],"variable":[{"description":{"content":"<p>MongoDB ObjectId of the user to block</p>\n","type":"text/plain"},"type":"any","value":"id","key":"id"}]}},"response":[{"id":"89292788-face-40d2-aa35-9267cdcd3246","name":"Block a User","originalRequest":{"method":"PATCH","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":{"raw":"http://localhost:5000/api/admin/users/:id/block","protocol":"http","host":["localhost"],"port":"5000","path":["api","admin","users",":id","block"],"variable":[{"key":"id","value":"id","description":"MongoDB ObjectId of the user to block\n"}]}},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"26"},{"key":"ETag","value":"W/\"1a-kT9xstnkpeXeNfCIwKkW4wGSKFs\""},{"key":"Date","value":"Fri, 29 May 2026 08:27:37 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"User blocked\"\n}"}],"_postman_id":"38d92c9d-254d-4ffa-b913-a81a0d44badb"},{"name":"Unblock a User","id":"e8810e91-5748-4597-92fe-4a9dcdfd139a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"http://localhost:5000/api/admin/users/:id/unblock","description":"<p>Sets <code>is_blocked: false</code> and resets <code>abuse_count</code> to <code>0</code>. Sends a notification to the user that their account has been restored.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","admin","users",":id","unblock"],"host":["localhost"],"query":[],"variable":[{"description":{"content":"<p>MongoDB ObjectId of the user to unblock</p>\n","type":"text/plain"},"type":"any","value":"id","key":"id"}]}},"response":[{"id":"4bb2692c-62a5-4018-bc7a-40d8d8dd92f9","name":"Unblock a User","originalRequest":{"method":"PATCH","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":{"raw":"http://localhost:5000/api/admin/users/:id/unblock","protocol":"http","host":["localhost"],"port":"5000","path":["api","admin","users",":id","unblock"],"variable":[{"key":"id","value":"id","description":"MongoDB ObjectId of the user to unblock"}]}},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"28"},{"key":"ETag","value":"W/\"1c-p3sJUPIgu6KdqbyvhTMhn44+wsc\""},{"key":"Date","value":"Fri, 29 May 2026 08:28:59 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"User unblocked\"\n}"}],"_postman_id":"e8810e91-5748-4597-92fe-4a9dcdfd139a"},{"name":"Get Flagged Content","id":"dad1036f-82e2-4c11-b507-7c1a1f9c9d0a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"http://localhost:5000/api/admin/flagged","description":"<p>Returns all abuse logs (AI-flagged content entries), sorted newest first. Used by admins to review and take action on reported content.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","admin","flagged"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"0b836b80-d586-4c16-b33c-2867a66cbd54","name":"Get Flagged Content","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"http://localhost:5000/api/admin/flagged"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"877"},{"key":"ETag","value":"W/\"36d-TCO9IdMogyuI5lLOgybXknGKr48\""},{"key":"Date","value":"Fri, 29 May 2026 08:30:47 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"_id\": \"id\",\n        \"user\": {\n            \"_id\": \"id\",\n            \"username\": \"johndoe\",\n            \"email\": \"john@gmail.com\"\n        },\n        \"contentId\": \"id\",\n        \"contentType\": \"Post\",\n        \"reason\": \"contains derogatory language, insults, and aggressive tone\",\n        \"confidence\": 0.8,\n        \"contentSnippet\": \"You're the Worst Developer I've Ever Seen\",\n        \"createdAt\": \"2026-05-29T07:52:15.813Z\",\n        \"updatedAt\": \"2026-05-29T07:52:15.813Z\",\n        \"__v\": 0\n    },\n    {\n        \"_id\": \"id\",\n        \"user\": {\n            \"_id\": \"id\",\n            \"username\": \"khushbu\",\n            \"email\": \"khushbu@gmail.com\"\n        },\n        \"contentId\": \"id\",\n        \"contentType\": \"Post\",\n        \"reason\": \"Hate speech and abusive language towards a group of people.\",\n        \"confidence\": 0.9,\n        \"contentSnippet\": \"This platform is useless and everyone here is stupid. I hate all of you idiots.\",\n        \"createdAt\": \"2026-04-27T09:42:35.038Z\",\n        \"updatedAt\": \"2026-04-27T09:42:35.038Z\",\n        \"__v\": 0\n    }\n]"}],"_postman_id":"dad1036f-82e2-4c11-b507-7c1a1f9c9d0a"},{"name":"Delete Content (Post or Reply)","id":"03a662c0-87ae-49d9-86eb-0b134420c19f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"http://localhost:5000/api/admin/content/:type/:id","description":"<p>Allows an admin to permanently delete any post or reply by specifying the content type and its ID.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","admin","content",":type",":id"],"host":["localhost"],"query":[],"variable":[{"description":{"content":"<p>Content type: post or reply</p>\n","type":"text/plain"},"type":"any","value":"post","key":"type"},{"description":{"content":"<p>MongoDB ObjectId of the post or reply to delete</p>\n","type":"text/plain"},"type":"any","value":"id","key":"id"}]}},"response":[{"id":"e0062215-81c5-4865-b69a-bfad98b62454","name":"Delete Content (Post or Reply)","originalRequest":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":{"raw":"http://localhost:5000/api/admin/content/:type/:id","protocol":"http","host":["localhost"],"port":"5000","path":["api","admin","content",":type",":id"],"variable":[{"key":"type","value":"post","description":"Content type: post or reply"},{"key":"id","value":"id","description":"MongoDB ObjectId of the post or reply to delete"}]}},"status":"OK","code":200,"_postman_previewlanguage":"","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"29"},{"key":"ETag","value":"W/\"1d-wOgXd73UXjedjB1v9evpBOiBVgY\""},{"key":"Date","value":"Fri, 29 May 2026 13:01:23 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[{"expires":"Invalid Date","domain":"","path":""}],"responseTime":null,"body":"{\n    \"message\": \"Content deleted\"\n}"}],"_postman_id":"03a662c0-87ae-49d9-86eb-0b134420c19f"},{"name":"Get Platform Statistics","id":"34f3c1d0-c4a7-4b0f-9835-020b1c3fbbec","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"http://localhost:5000/api/admin/stats","description":"<p>Returns platform-wide statistics including total users, posts, replies, flagged content count, blocked users, and a time-series breakdown of posts per day (for chart rendering in the admin dashboard).</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","admin","stats"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"d7dcd0f9-8786-4dc5-8207-63cc03d0a70e","name":"Get Platform Statistics","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"http://localhost:5000/api/admin/stats"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"131"},{"key":"ETag","value":"W/\"83-4Oj/yeBHZmKT6ouIUqS2uMZb8YQ\""},{"key":"Date","value":"Fri, 29 May 2026 13:02:49 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"totalUsers\": 4,\n    \"totalPosts\": 1,\n    \"totalReplies\": 1,\n    \"flaggedCount\": 2,\n    \"blockedUsers\": 0,\n    \"postsOverTime\": [\n        {\n            \"_id\": \"2026-04-27\",\n            \"count\": 1\n        }\n    ]\n}"}],"_postman_id":"34f3c1d0-c4a7-4b0f-9835-020b1c3fbbec"}],"id":"1eecf7da-ab6a-4105-b245-3e680be3a69c","description":"<p>Administrative endpoints for content moderation, user management, platform analytics, and abuse-control operations.</p>\n<p>IMPORTANT</p>\n<p>All admin routes require the user to be authenticated <strong>AND</strong> have <code>role: \"admin\"</code>.</p>\n","_postman_id":"1eecf7da-ab6a-4105-b245-3e680be3a69c"},{"name":"Search","item":[{"name":"Search Posts","id":"381d669e-4fc4-4260-8318-f8786507e767","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/search?q=string&page=1","description":"<p>Performs a full-text search across posts using MongoDB's <code>$text</code> index. Returns a paginated list of matching posts. Returns an empty list if <code>q</code> is not provided.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","search"],"host":["localhost"],"query":[{"description":{"content":"<p>Search keyword(s)</p>\n","type":"text/plain"},"key":"q","value":"string"},{"description":{"content":"<p>Page number (default: 1)</p>\n","type":"text/plain"},"key":"page","value":"1"}],"variable":[]}},"response":[{"id":"43895774-cc1a-4362-99f7-22ded281fcbd","name":"Search Posts","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:5000/api/search?q=string&page=1","protocol":"http","host":["localhost"],"port":"5000","path":["api","search"],"query":[{"key":"q","value":"string","description":"Search keyword(s)"},{"key":"page","value":"1","description":"Page number (default: 1)"}]}},"status":"OK","code":200,"_postman_previewlanguage":"","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"517"},{"key":"ETag","value":"W/\"205-lROrwFZeE8ylA9c9uqbnXDgivIM\""},{"key":"Date","value":"Fri, 29 May 2026 13:07:06 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[{"expires":"Invalid Date","domain":"","path":""}],"responseTime":null,"body":"{\n    \"posts\": [\n        {\n            \"_id\": \"id\",\n            \"title\": \"how to merge two strings in c++ ?\",\n            \"description\": \"i have two strings and i want to know how to merge them into one.\",\n            \"tags\": [\n                \"javascript\"\n            ],\n            \"images\": [],\n            \"author\": {\n                \"_id\": \"id\",\n                \"username\": \"khushbu\",\n                \"profileImage\": \"https://res.cloudinary.com/ddbya1gnh/image/upload/v1738645506/cld-sample.jpg\"\n            },\n            \"viewCount\": 3,\n            \"replyCount\": 0,\n            \"isFlagged\": false,\n            \"createdAt\": \"2026-04-27T09:27:00.309Z\",\n            \"updatedAt\": \"2026-05-29T07:10:24.239Z\",\n            \"__v\": 0\n        }\n    ],\n    \"page\": 1,\n    \"pages\": 1\n}"}],"_postman_id":"381d669e-4fc4-4260-8318-f8786507e767"}],"id":"c51ffb20-8749-440d-81db-1f83418d214c","description":"<p>Endpoints for performing full-text searches across questions, posts, and tags to quickly find relevant content.</p>\n","_postman_id":"c51ffb20-8749-440d-81db-1f83418d214c"}]}