{"info":{"_postman_id":"037fae41-910c-433a-bbd8-744c576529a3","name":"Zorvyn_Assignment","description":"<html><head></head><body><h2 id=\"zorvyn-finance-dashboard-api-collection\"><strong>Zorvyn Finance Dashboard API Collection</strong>.</h2>\n<p>This API powers a secure, role-based financial dashboard system designed to manage users, process financial records, and generate analytics. The system follows a clean and structured approach, with endpoints grouped into logical modules for better usability and scalability.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"34605710","collectionId":"037fae41-910c-433a-bbd8-744c576529a3","publishedId":"2sBXiqDo8e","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2026-04-04T19:06:51.000Z"},"item":[{"name":"Authentication","item":[{"name":"login","id":"4bfa7d5f-bfbf-4a8c-915a-dfe9efcb2e66","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\" : \"gugulothsammaiah5@gmail.com\",\n    \"password\" : \"Sammaiah@004\"\n}\n\n// {\n//     \"email\" : \"sammaiahguguloth3@gmail.com\",\n//     \"password\" : \"2q0rmqym\"\n// }\n\n// {\n//     \"email\" : \"sammaiahguguloth3@gmail.com\",\n//     \"password\" : \"2q0rmqym\"\n// }\n\n// {\n//     \"email\" : \"sammaiahguguloth.connect@gmail.com\",\n//     \"password\" : \"7dcgwzez\"\n// }\n\n\n\n","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/auth/login","description":"<h2 id=\"endpoint-description\">Endpoint Description</h2>\n<p>This endpoint is used to authenticate a user into the Finance Dashboard system and securely issue an HTTP-only JWT session cookie. Access is public, but the user's account status in the database must be 'active' for successful authentication.</p>\n<h3 id=\"request\">Request</h3>\n<ul>\n<li><p><strong>Method:</strong> POST</p>\n</li>\n<li><p><strong>Endpoint:</strong> <code>http://localhost:5000/api/v1/auth/login</code></p>\n</li>\n</ul>\n<h4 id=\"request-body\">Request Body</h4>\n<p>The request body must be in JSON format and should contain the following parameters:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>email</td>\n<td>string</td>\n<td>The user's registered email address (required).</td>\n</tr>\n<tr>\n<td>password</td>\n<td>string</td>\n<td>The user's password (required).</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Example Request Body:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"email\": \"user@example.com\",\n  \"password\": \"your_password\"\n}\n\n</code></pre>\n<h3 id=\"response\">Response</h3>\n<p>Upon a successful login, the server responds with a status code of <code>200 OK</code> and attaches a <code>jwt</code> cookie (HTTP-only) directly to the response headers. The JSON response body will contain the following structure:</p>\n<ul>\n<li><p><strong>status</strong> (string): Indicates the status of the request, typically 'success'.</p>\n</li>\n<li><p><strong>data</strong> (object): Contains the user's profile information:</p>\n<ul>\n<li><p><strong>name</strong> (string): The name of the user.</p>\n</li>\n<li><p><strong>email</strong> (string): The email address of the user.</p>\n</li>\n<li><p><strong>role</strong> (string): The role of the user within the application.</p>\n</li>\n<li><p><strong>isPasswordReset</strong> (boolean): Indicates if the user has reset their password.</p>\n</li>\n</ul>\n</li>\n</ul>\n<p><strong>Example Response:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"status\": \"success\",\n  \"data\": {\n    \"name\": \"User Name\",\n    \"email\": \"user@example.com\",\n    \"role\": \"user_role\",\n    \"isPasswordReset\": true\n  }\n}\n\n</code></pre>\n<h3 id=\"error-responses\">Error Responses</h3>\n<ul>\n<li><p><strong>400 Bad Request:</strong> Triggered if the request body is missing required fields or if the data types mismatch.</p>\n</li>\n<li><p><strong>401 Unauthorized:</strong> Triggered for invalid email/password combinations.</p>\n</li>\n<li><p><strong>403 Forbidden:</strong> Triggered if the user exists and credentials are correct, but their account status is marked as 'inactive'.</p>\n</li>\n</ul>\n<h3 id=\"notes\">Notes</h3>\n<ul>\n<li><p>The password hash will <strong>never</strong> be returned in the payload.</p>\n</li>\n<li><p>Authorization is handled statelessly via cookies rather than Bearer tokens in the response headers.</p>\n</li>\n</ul>\n<p>This endpoint is used for user authentication, allowing users to log in to the application. It accepts user credentials and returns an authentication token along with user details upon successful login.</p>\n<h3 id=\"request-1\">Request</h3>\n<ul>\n<li><p><strong>Method</strong>: POST</p>\n</li>\n<li><p><strong>Endpoint</strong>: <code>http://localhost:5000/api/v1/auth/login</code></p>\n</li>\n</ul>\n<h3 id=\"headers\">Headers</h3>\n<ul>\n<li><strong>Content-Type</strong>: application/json<br />  Ensure that the request body is formatted as JSON.</li>\n</ul>\n<h4 id=\"request-body-1\">Request Body</h4>\n<p>The request body must be in JSON format and should contain the following parameters:</p>\n<ul>\n<li><p><strong>email</strong> (string): The email address of the user attempting to log in.</p>\n</li>\n<li><p><strong>password</strong> (string): The password associated with the user's account.</p>\n</li>\n</ul>\n<p><strong>Example Request Body:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"email\": \"user@example.com\",\n  \"password\": \"your_password\"\n}\n\n</code></pre>\n<h3 id=\"response-1\">Response</h3>\n<p>Upon a successful login, the server responds with a status code of <code>200</code> and a JSON object containing the following structure:</p>\n<ul>\n<li><p><strong>status</strong> (string): Status of the request (usually empty on success).</p>\n</li>\n<li><p><strong>token</strong> (string): A JWT token that can be used for subsequent authenticated requests.</p>\n</li>\n<li><p><strong>data</strong> (object): Contains user information, structured as follows:</p>\n<ul>\n<li><p><strong>user</strong> (object): Details about the authenticated user:</p>\n<ul>\n<li><p><strong>_id</strong> (string): Unique identifier for the user.</p>\n</li>\n<li><p><strong>name</strong> (string): The name of the user.</p>\n</li>\n<li><p><strong>email</strong> (string): The email address of the user.</p>\n</li>\n<li><p><strong>role</strong> (string): The role of the user within the application.</p>\n</li>\n<li><p><strong>status</strong> (string): The current status of the user account.</p>\n</li>\n<li><p><strong>isPasswordReset</strong> (boolean): Indicates if the user has reset their password.</p>\n</li>\n<li><p><strong>createdAt</strong> (string): Timestamp of when the user was created.</p>\n</li>\n<li><p><strong>updatedAt</strong> (string): Timestamp of the last update to the user information.</p>\n</li>\n<li><p><strong>__v</strong> (number): Version key for the user document.</p>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<p><strong>Example Response:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"status\": \"\",\n  \"token\": \"your_jwt_token\",\n  \"data\": {\n    \"user\": {\n      \"_id\": \"user_id\",\n      \"name\": \"User Name\",\n      \"email\": \"user@example.com\",\n      \"role\": \"user_role\",\n      \"status\": \"active\",\n      \"isPasswordReset\": true,\n      \"createdAt\": \"timestamp\",\n      \"updatedAt\": \"timestamp\",\n      \"__v\": 0\n    }\n  }\n}\n\n</code></pre>\n<h3 id=\"notes-1\">Notes</h3>\n<ul>\n<li><p>Ensure that the email and password are correct to receive a successful response.</p>\n</li>\n<li><p>The token returned in the response should be stored securely for use in subsequent requests that require authentication.</p>\n</li>\n</ul>\n<p>This endpoint allows users to authenticate and obtain a token for accessing protected resources. It requires the user's email and password to be sent in the request body.</p>\n","urlObject":{"path":["auth","login"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"4bfa7d5f-bfbf-4a8c-915a-dfe9efcb2e66"},{"name":"Change password","id":"022b2704-4d11-4aaa-aee0-b45d25e1a359","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"currentPassword\" : \"2q0rmqym\",\n    \"newPassword\" : \"Sammaiah@004\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/auth/change-password","description":"<h2 id=\"change-password-endpoint\">Change Password Endpoint</h2>\n<p>This endpoint allows users to change their account password. It requires the current password and the new password as part of the request payload.</p>\n<h3 id=\"request\">Request</h3>\n<ul>\n<li><p><strong>Method:</strong> POST</p>\n</li>\n<li><p><strong>Endpoint:</strong> <code>http://localhost:5000/api/v1/auth/change-password</code></p>\n</li>\n<li><p><strong>Content-Type:</strong> application/json</p>\n</li>\n</ul>\n<h3 id=\"request-body-parameters\">Request Body Parameters</h3>\n<p>The request body must be sent in JSON format and should include the following parameters:</p>\n<ul>\n<li><p><strong>currentPassword</strong> (string): The user's current password that needs to be verified.</p>\n</li>\n<li><p><strong>newPassword</strong> (string): The new password that the user wishes to set.</p>\n</li>\n</ul>\n<h3 id=\"example-request-body\">Example Request Body</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"currentPassword\": \"your_current_password\",\n  \"newPassword\": \"your_new_password\"\n}\n\n</code></pre>\n<h3 id=\"expected-response\">Expected Response</h3>\n<p>Upon a successful password change, the API will return a response indicating the success of the operation. The exact structure of the response may vary, but it typically includes a status message confirming that the password has been updated.</p>\n<h3 id=\"notes\">Notes</h3>\n<ul>\n<li><p>Ensure that the new password meets any security requirements set by the application (e.g., minimum length, complexity).</p>\n</li>\n<li><p>If the current password is incorrect, the API will return an error response indicating the failure of the password change attempt.</p>\n</li>\n</ul>\n","urlObject":{"path":["auth","change-password"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"022b2704-4d11-4aaa-aee0-b45d25e1a359"}],"id":"c1bdf0c5-ca77-48f4-9100-8787f9856fdf","description":"<p>This folder handles all user session management, identity verification, and credential updates for the Finance Dashboard system.</p>\n<p>The API relies on <strong>stateless JWT tokens</strong> securely passed via <strong>HTTP-only cookies</strong>. Once authenticated, Postman will automatically save and attach the <code>jwt</code> cookie to your subsequent requests, avoiding the need to manually pass Bearer tokens to access the protected Admin, Records, and Analytics routes.</p>\n<p><strong>Key constraints:</strong></p>\n<ul>\n<li><p><strong>Access Control:</strong> Only users with an <code>active</code> status can log in; suspended users will be immediately rejected.</p>\n</li>\n<li><p><strong>Onboarding:</strong> New users logging in with a system-generated password are required to change their credentials upon their first successful login.</p>\n</li>\n</ul>\n","_postman_id":"c1bdf0c5-ca77-48f4-9100-8787f9856fdf"},{"name":"Admin","item":[{"name":"Add user","id":"01f53162-0857-4ba0-9677-bb81af067fb8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"// {\n//     \"name\" : \"Sam Analyst\",\n//     \"email\" : \"sammaiahguguloth3@gmail.com\",\n//     \"role\" : \"analyst\"\n// }\n\n\n{\n    \"name\" : \"Sam Viewver\",\n    \"email\" : \"sammaiahguguloth.connect@gmail.com\",\n    \"role\" : \"viewer\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/admin/users","description":"<h2 id=\"add-user-endpoint\">Add User Endpoint</h2>\n<p>This endpoint allows you to add a new user to the system. It accepts a POST request to the specified URL.</p>\n<h3 id=\"request-method\">Request Method</h3>\n<ul>\n<li><strong>POST</strong></li>\n</ul>\n<h3 id=\"endpoint\">Endpoint</h3>\n<ul>\n<li><code>http://localhost:5000/api/v1/admin/users</code></li>\n</ul>\n<h3 id=\"request-body-parameters\">Request Body Parameters</h3>\n<p>The request body must be a JSON object containing the following parameters:</p>\n<ul>\n<li><p><strong>name</strong> (string): The full name of the user being added.</p>\n</li>\n<li><p><strong>email</strong> (string): The email address of the user being added. This should be a valid email format.</p>\n</li>\n<li><p><strong>role</strong> (string): The role assigned to the user. This could be values such as \"viewer\", \"editor\", \"admin\", etc.</p>\n</li>\n</ul>\n<h3 id=\"expected-response-format\">Expected Response Format</h3>\n<p>Upon a successful request, the API will return a response indicating the status of the operation, typically including the newly created user's details or a confirmation message. The response will be in JSON format.</p>\n<p>Ensure that all required fields are included in the request body to avoid errors.</p>\n","urlObject":{"path":["admin","users"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"01f53162-0857-4ba0-9677-bb81af067fb8"},{"name":"Get users","id":"78774627-ebeb-4ba7-aaae-773df2ef321e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/v1/admin/users","description":"<h3 id=\"overview\">Overview</h3>\n<ul>\n<li><p><strong>Name:</strong> Get All Users</p>\n</li>\n<li><p><strong>Endpoint:</strong> <code>GET /api/v1/admin/users</code></p>\n</li>\n<li><p><strong>Access Control:</strong> Private &amp; Restricted. Requires a valid JWT token of a user with the <code>admin</code> role.</p>\n</li>\n<li><p><strong>Description:</strong> This endpoint retrieves a complete list of all users registered on the platform. It is strictly reserved for administrative auditing and user management purposes.</p>\n</li>\n</ul>\n<h3 id=\"request-details\">Request Details</h3>\n<ul>\n<li><p><strong>Headers:</strong></p>\n<ul>\n<li><code>Authorization: Bearer</code></li>\n</ul>\n</li>\n<li><p><strong>Body:</strong> None (GET request)</p>\n</li>\n</ul>\n<h3 id=\"responses\">Responses</h3>\n<ol>\n<li><p><strong>200 OK (Success)</strong></p>\n<ul>\n<li><p>Triggered when the request is authorized and the list of users is successfully fetched.</p>\n</li>\n<li><p>{ \"status\": \"success\", \"results\": 2, \"data\": { \"users\": [ { \"_id\": \"\", \"name\": \"\", \"email\": \"\", \"role\": \"\", \"status\": \"\", \"isPasswordReset\": , \"createdAt\": \"\" }, { \"_id\": \"\", \"name\": \"\", \"email\": \"\", \"role\": \"\", \"status\": \"\", \"isPasswordReset\": , \"createdAt\": \"\" } ] }}</p>\n</li>\n</ul>\n</li>\n<li><p><strong>401 Unauthorized (Authentication Failed)</strong></p>\n<ul>\n<li>Triggered if the JWT token is missing from the headers, expired, or invalid.</li>\n</ul>\n</li>\n<li><p><strong>403 Forbidden (Role Restriction)</strong></p>\n<ul>\n<li>Triggered if a logged-in user who is <em>not</em> an Admin (e.g., Analyst or Viewer) attempts to access this endpoint.</li>\n</ul>\n</li>\n</ol>\n<p>This endpoint retrieves a list of users from the admin panel. It is primarily used for administrative purposes, allowing administrators to view all registered users in the system.</p>\n<h3 id=\"request\">Request</h3>\n<ul>\n<li><p><strong>Method</strong>: GET</p>\n</li>\n<li><p><strong>URL</strong>: <code>http://localhost:5000/api/v1/admin/users</code></p>\n</li>\n</ul>\n<h3 id=\"response\">Response</h3>\n<p>The response will contain a JSON object with the following structure:</p>\n<ul>\n<li><p><strong>users</strong>: An array of user objects, each containing details about a user. The user object may include the following fields:</p>\n<ul>\n<li><p><code>id</code>: Unique identifier for the user.</p>\n</li>\n<li><p><code>name</code>: The name of the user.</p>\n</li>\n<li><p><code>email</code>: The email address of the user.</p>\n</li>\n<li><p><code>role</code>: The role assigned to the user (e.g., admin, user).</p>\n</li>\n<li><p><code>status</code>: The current status of the user account (e.g., active, inactive).</p>\n</li>\n</ul>\n</li>\n</ul>\n<h3 id=\"example-response\">Example Response</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"users\": [\n    {\n      \"id\": \"123\",\n      \"name\": \"John Doe\",\n      \"email\": \"john.doe@example.com\",\n      \"role\": \"admin\",\n      \"status\": \"active\"\n    },\n    {\n      \"id\": \"124\",\n      \"name\": \"Jane Smith\",\n      \"email\": \"jane.smith@example.com\",\n      \"role\": \"user\",\n      \"status\": \"inactive\"\n    }\n  ]\n}\n\n</code></pre>\n<h3 id=\"notes\">Notes</h3>\n<ul>\n<li><p>This endpoint does not require any request body.</p>\n</li>\n<li><p>Ensure that appropriate authentication and authorization are in place to access this endpoint, as it deals with sensitive user data.</p>\n</li>\n</ul>\n","urlObject":{"path":["admin","users"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"78774627-ebeb-4ba7-aaae-773df2ef321e"},{"name":"Update user status","id":"984f29f8-a49d-40ed-b8c6-787cc9cb49bd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"status\" : \"inactive\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/admin/users/69cf925456810aeefcd78981/status","description":"<h3 id=\"overview\">Overview</h3>\n<ul>\n<li><p><strong>Name:</strong> Update User Status</p>\n</li>\n<li><p><strong>Endpoint:</strong> PATCH /api/v1/admin/users/:id/status</p>\n</li>\n<li><p><strong>Access Control:</strong> Private &amp; Restricted. Requires a valid JWT token of a user with the admin role.</p>\n</li>\n<li><p><strong>Description:</strong> This endpoint allows administrators to activate or deactivate a user's account. Setting a user's status to 'inactive' will instantly restrict them from logging in or making any verified requests.</p>\n</li>\n</ul>\n<h3 id=\"request-details\">Request Details</h3>\n<ul>\n<li><p><strong>Headers:</strong></p>\n<ul>\n<li><p><code>Content-Type</code>: application/json</p>\n</li>\n<li><p><code>Authorization</code>: Bearer</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Path Parameters:</strong></p>\n<ul>\n<li><code>id</code> (string, required): The unique MongoDB ObjectId of the target user.</li>\n</ul>\n</li>\n<li><p><strong>Body (raw JSON):</strong></p>\n<ul>\n<li><code>status</code> (string, required): The target status of the user's account. Acceptable enum values are typically 'active' and 'inactive'.</li>\n</ul>\n</li>\n</ul>\n<h3 id=\"responses\">Responses</h3>\n<ol>\n<li><p><strong>200 OK (Success)</strong></p>\n<ul>\n<li><p>Triggered when the user's status is successfully updated.</p>\n</li>\n<li><p>{ \"status\": \"success\", \"data\": { \"user\": { \"_id\": \"60d0fe4f5311236168a109ca\", \"name\": \"Jane Smith\", \"email\": \"<a href=\"https://mailto:janesmith@example.com\">janesmith@example.com</a>\", \"role\": \"analyst\", \"status\": \"inactive\", \"updatedAt\": \"2023-11-03T14:20:00.000Z\" } } }</p>\n</li>\n</ul>\n</li>\n<li><p><strong>400 Bad Request (Validation Error)</strong></p>\n<ul>\n<li><p>Triggered if the status field is missing from the body or contains an invalid value (e.g., trying to set it to 'pending' instead of 'active' or 'inactive').</p>\n</li>\n<li><p>Triggered if the id in the URL is not a valid MongoDB ObjectId format.</p>\n</li>\n</ul>\n</li>\n<li><p><strong>404 Not Found</strong></p>\n<ul>\n<li>Triggered if the provided id is valid but no user with that ID exists in the database.</li>\n</ul>\n</li>\n<li><p><strong>401 Unauthorized (Authentication Failed)</strong></p>\n<ul>\n<li>Triggered if the JWT token is missing, expired, or invalid.</li>\n</ul>\n</li>\n<li><p><strong>403 Forbidden (Role Restriction)</strong></p>\n<ul>\n<li>Triggered if a logged-in user who is not an Admin attempts to access this endpoint.</li>\n</ul>\n</li>\n</ol>\n<p>This endpoint allows you to update the status of a specific user in the system. By sending a PATCH request to the designated URL, you can change the user's status to reflect their current state, such as \"active\" or \"inactive\".</p>\n<h4 id=\"request\">Request</h4>\n<ul>\n<li><p><strong>Method</strong>: PATCH</p>\n</li>\n<li><p><strong>URL</strong>: <code>http://localhost:5000/api/v1/admin/users/{user_id}/status</code></p>\n</li>\n</ul>\n<h5 id=\"path-parameters\">Path Parameters</h5>\n<ul>\n<li><code>user_id</code> (string): The unique identifier of the user whose status you want to update. In the example, it is <code>69cf925456810aeefcd78981</code>.</li>\n</ul>\n<h5 id=\"request-body\">Request Body</h5>\n<p>The request body must be a JSON object containing the following key:</p>\n<ul>\n<li><code>status</code> (string): The new status for the user. Possible values include \"active\", \"inactive\", etc.</li>\n</ul>\n<h5 id=\"example-request\">Example Request:</h5>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-http\">PATCH http://localhost:5000/api/v1/admin/users/69cf925456810aeefcd78981/status\nContent-Type: application/json\nAuthorization: Bearer {your_jwt_token}\n{\n  \"status\": \"inactive\"\n}\n\n</code></pre>\n<h4 id=\"response\">Response</h4>\n<p>Upon a successful request, the server will respond with a status code indicating the result of the operation. The response body typically includes a confirmation of the updated status.</p>\n<h5 id=\"response-structure\">Response Structure</h5>\n<ul>\n<li><p><strong>status</strong> (string): A message indicating the success or failure of the update operation.</p>\n</li>\n<li><p><strong>data</strong> (object): Contains the updated user information.</p>\n<ul>\n<li><p><strong>user</strong> (object): The user whose status was updated.</p>\n<ul>\n<li><p><strong>_id</strong> (string): The unique identifier of the user.</p>\n</li>\n<li><p><strong>status</strong> (string): The new status of the user.</p>\n</li>\n<li><p><strong>updatedAt</strong> (string): The timestamp of when the status was updated.</p>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<h5 id=\"example-response\">Example Response:</h5>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"status\": \"success\",\n  \"data\": {\n    \"user\": {\n      \"_id\": \"69cf925456810aeefcd78981\",\n      \"status\": \"inactive\",\n      \"updatedAt\": \"2023-11-03T14:20:00.000Z\"\n    }\n  }\n}\n\n</code></pre>\n<h3 id=\"summary\">Summary</h3>\n<p>This API endpoint is essential for managing user statuses within the application, allowing administrators to effectively control user access and activity based on their current status.</p>\n<ul>\n<li><p><strong>Name:</strong> Update User Status</p>\n</li>\n<li><p><strong>Endpoint:</strong> PATCH /api/v1/admin/users/:id/status</p>\n</li>\n<li><p><strong>Access Control:</strong> Private &amp; Restricted. Requires a valid JWT token of a user with the admin role.</p>\n</li>\n<li><p><strong>Description:</strong> This endpoint allows administrators to activate or deactivate a user's account. Setting a user's status to 'inactive' will instantly restrict them from logging in or making any verified requests.</p>\n</li>\n</ul>\n<h3 id=\"request-details-1\">Request Details</h3>\n<ul>\n<li><p><strong>Headers:</strong></p>\n<ul>\n<li><p><code>Content-Type</code>: application/json</p>\n</li>\n<li><p><code>Authorization</code>: Bearer</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Path Parameters:</strong></p>\n<ul>\n<li><code>id</code> (string, required): The unique MongoDB ObjectId of the target user.</li>\n</ul>\n</li>\n<li><p><strong>Body (raw JSON):</strong></p>\n<ul>\n<li><code>status</code> (string, required): The target status of the user's account. Acceptable enum values are typically 'active' and 'inactive'.</li>\n</ul>\n</li>\n</ul>\n<h3 id=\"responses-1\">Responses</h3>\n<ol>\n<li><p><strong>200 OK (Success)</strong></p>\n<ul>\n<li><p>Triggered when the user's status is successfully updated.</p>\n</li>\n<li><p>{ \"status\": \"success\", \"data\": { \"user\": { \"_id\": \"60d0fe4f5311236168a109ca\", \"name\": \"Jane Smith\", \"email\": \"<a href=\"https://mailto:janesmith@example.com\">janesmith@example.com</a>\", \"role\": \"analyst\", \"status\": \"inactive\", \"updatedAt\": \"2023-11-03T14:20:00.000Z\" } } }</p>\n</li>\n</ul>\n</li>\n<li><p><strong>400 Bad Request (Validation Error)</strong></p>\n<ul>\n<li><p>Triggered if the status field is missing from the body or contains an invalid value (e.g., trying to set it to 'pending' instead of 'active' or 'inactive').</p>\n</li>\n<li><p>Triggered if the id in the URL is not a valid MongoDB ObjectId format.</p>\n</li>\n</ul>\n</li>\n<li><p><strong>404 Not Found</strong></p>\n<ul>\n<li>Triggered if the provided id is valid but no user with that ID exists in the database.</li>\n</ul>\n</li>\n<li><p><strong>401 Unauthorized (Authentication Failed)</strong></p>\n<ul>\n<li>Triggered if the JWT token is missing, expired, or invalid.</li>\n</ul>\n</li>\n<li><p><strong>403 Forbidden (Role Restriction)</strong></p>\n<ul>\n<li>Triggered if a logged-in user who is not an Admin attempts to access this endpoint.</li>\n</ul>\n</li>\n</ol>\n<p>This endpoint allows you to update the status of a specific user in the system. By sending a PATCH request to the designated URL, you can change the user's status to reflect their current state, such as \"active\" or \"inactive\".</p>\n<h4 id=\"request-1\">Request</h4>\n<ul>\n<li><p><strong>Method</strong>: PATCH</p>\n</li>\n<li><p><strong>URL</strong>: <code>http://localhost:5000/api/v1/admin/users/{user_id}/status</code></p>\n</li>\n</ul>\n<h5 id=\"path-parameters-1\">Path Parameters</h5>\n<ul>\n<li><code>user_id</code> (string): The unique identifier of the user whose status you want to update. In the example, it is <code>69cf925456810aeefcd78981</code>.</li>\n</ul>\n<h5 id=\"request-body-1\">Request Body</h5>\n<p>The request body must be a JSON object containing the following key:</p>\n<ul>\n<li><code>status</code> (string): The new status for the user. Possible values include \"active\", \"inactive\", etc.</li>\n</ul>\n<p><strong>Example Request</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-http\">PATCH http://localhost:5000/api/v1/admin/users/69cf925456810aeefcd78981/status\nContent-Type: application/json\n{\n  \"status\": \"inactive\"\n}\n\n</code></pre>\n<h4 id=\"response-1\">Response</h4>\n<p>Upon a successful request, the server will respond with a status code indicating the result of the operation. The response body typically includes a confirmation of the updated status.</p>\n<h5 id=\"response-structure-1\">Response Structure</h5>\n<ul>\n<li><p><strong>status</strong> (string): A message indicating the success or failure of the update operation.</p>\n</li>\n<li><p><strong>user_id</strong> (string): The unique identifier of the user whose status was updated.</p>\n</li>\n<li><p><strong>updated_status</strong> (string): The new status of the user.</p>\n</li>\n</ul>\n<p><strong>Example Response</strong>:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"status\": \"success\",\n  \"user_id\": \"69cf925456810aeefcd78981\",\n  \"updated_status\": \"inactive\"\n}\n\n</code></pre>\n<h3 id=\"summary-1\">Summary</h3>\n<p>This API endpoint is essential for managing user statuses within the application, allowing administrators to effectively control user access and activity based on their current status.</p>\n","urlObject":{"path":["admin","users","69cf925456810aeefcd78981","status"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"984f29f8-a49d-40ed-b8c6-787cc9cb49bd"}],"id":"3a88cb3a-2d02-4d9d-9fe9-162bfa957946","description":"<p>Contains all restricted administrative APIs. Actions here require an Admin-level JWT token and include user creation, status toggling, and core record management.</p>\n","_postman_id":"3a88cb3a-2d02-4d9d-9fe9-162bfa957946"},{"name":"Records","item":[{"name":"Create record","id":"2bc039de-e643-4cd9-8e73-f48f8fcb5eea","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"description":"<h3 id=\"overview\">Overview</h3>\n<ul>\n<li><p><strong>Name:</strong> Create Record</p>\n</li>\n<li><p><strong>Endpoint:</strong> <code>POST /api/v1/records</code></p>\n</li>\n<li><p><strong>Access Control:</strong> Private &amp; Restricted. Requires a valid JWT token of a user with the <code>admin</code> role.</p>\n</li>\n<li><p><strong>Description:</strong> This endpoint allows administrators to add a new financial transaction (income or expense) to the system. Upon creation, the record is automatically linked to the administrator who created it via the <code>createdBy</code> field.</p>\n</li>\n</ul>\n<h3 id=\"request-details\">Request Details</h3>\n<h4 id=\"headers\">Headers:</h4>\n<ul>\n<li><p><code>Content-Type: application/json</code>: Specifies the media type of the resource.</p>\n</li>\n<li><p><code>Authorization: Bearer</code> : A valid JWT token for authentication, required for access.</p>\n</li>\n</ul>\n<h4 id=\"body-raw-json\">Body (raw JSON):</h4>\n<ul>\n<li><p><code>amount</code> (number, required): A positive numeric value representing the transaction amount.</p>\n</li>\n<li><p><code>type</code> (string, required): The transaction classification. Must be strictly either \"income\" or \"expense\".</p>\n</li>\n<li><p><code>category</code> (string, required): The category label for the record (e.g., \"Salary\", \"Equipment\", \"Office Rent\").</p>\n</li>\n<li><p><code>date</code> (string, optional): The transaction date in ISO 8601 format. Defaults to the current server time if omitted.</p>\n</li>\n<li><p><code>description</code> (string, optional): A brief note providing additional context for the transaction.</p>\n</li>\n</ul>\n<h3 id=\"examples\">Examples</h3>\n<h4 id=\"example-request-body\">Example Request Body:</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"amount\": 1250.75,\n  \"type\": \"expense\",\n  \"category\": \"Office Supplies\",\n  \"date\": \"2024-03-20T10:00:00.000Z\",\n  \"description\": \"Monthly stationery and printer ink restock\"\n}\n\n</code></pre>\n<h4 id=\"example-success-response-201-created\">Example Success Response (201 Created):</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"status\": \"success\",\n  \"data\": {\n    \"record\": {\n      \"_id\": \"65f9a2b3e4b0a12345678901\",\n      \"amount\": 1250.75,\n      \"type\": \"expense\",\n      \"category\": \"Office Supplies\",\n      \"date\": \"2024-03-20T10:00:00.000Z\",\n      \"description\": \"Monthly stationery and printer ink restock\",\n      \"createdBy\": \"65f9a1a2e4b0a12345678888\",\n      \"deletedAt\": null,\n      \"createdAt\": \"2024-03-20T14:30:15.123Z\",\n      \"updatedAt\": \"2024-03-20T14:30:15.123Z\"\n    }\n  }\n}\n\n</code></pre>\n<h4 id=\"example-error-response-400-bad-request\">Example Error Response (400 Bad Request):</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"status\": \"fail\",\n  \"message\": \"Amount must be positive\"\n}\n\n</code></pre>\n<h4 id=\"example-error-response-403-forbidden\">Example Error Response (403 Forbidden):</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"status\": \"fail\",\n  \"message\": \"You do not have permission to perform this action\"\n}\n\n</code></pre>\n<h3 id=\"overview-1\">Overview</h3>\n<p>This endpoint is designed to retrieve data from the specified resource. It utilizes the HTTP GET method, which is commonly used to request data from a server.</p>\n<h3 id=\"purpose\">Purpose</h3>\n<p>The primary purpose of this request is to fetch information related to the specified resource. This could include details such as user information, product details, or any other relevant data that the API is designed to provide.</p>\n<h3 id=\"request-parameters\">Request Parameters</h3>\n<p>The request does not require any input parameters as it is a simple GET request. However, if applicable, query parameters can be appended to the URL to filter or modify the data being retrieved.</p>\n<h3 id=\"example-request\">Example Request</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /api/resource\n\n</code></pre><h3 id=\"response-structure\">Response Structure</h3>\n<p>The response will typically be in JSON format and will contain the following fields:</p>\n<ul>\n<li><p><code>status</code>: Indicates the success or failure of the request.</p>\n</li>\n<li><p><code>data</code>: Contains the actual data retrieved from the server.</p>\n</li>\n<li><p><code>message</code>: Provides additional information about the request status.</p>\n</li>\n</ul>\n<h3 id=\"example-response\">Example Response</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"status\": \"success\",\n  \"data\": {\n    \"id\": 1,\n    \"name\": \"Sample Item\",\n    \"description\": \"This is a sample item description.\",\n    \"price\": 100.00\n  },\n  \"message\": \"Data retrieved successfully.\"\n}\n\n</code></pre>\n<h3 id=\"conclusion\">Conclusion</h3>\n<p>This endpoint is essential for accessing resource data efficiently. Ensure to handle the response appropriately based on the <code>status</code> field to determine if the request was successful or if there were any issues.</p>\n","urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"2bc039de-e643-4cd9-8e73-f48f8fcb5eea"},{"name":"Update record","id":"7089bb2d-e390-4d91-b2ca-41728c88bd11","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"description\" : \"Thi is updated description\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/records/69cfa2e96c616bc6da573539","description":"<h3 id=\"overview\">Overview</h3>\n<ul>\n<li><p><strong>Name:</strong> Update Record</p>\n</li>\n<li><p><strong>Endpoint:</strong> <code>PATCH /api/v1/records/:id</code></p>\n</li>\n<li><p><strong>Access Control:</strong> Private &amp; Restricted. Requires a valid JWT token of a user with the <code>admin</code> role.</p>\n</li>\n<li><p><strong>Description:</strong> This endpoint allows administrators to update the details of a specific financial record. Because it uses the PATCH method, only the fields provided in the payload will be updated; any omitted fields will retain their current values in the database.</p>\n</li>\n</ul>\n<h3 id=\"request-details\">Request Details</h3>\n<ul>\n<li><p><strong>Headers:</strong></p>\n<ul>\n<li><p><code>Content-Type: application/json</code></p>\n</li>\n<li><p><code>Authorization: Bearer</code></p>\n</li>\n</ul>\n</li>\n<li><p><strong>Path Parameters:</strong></p>\n<ul>\n<li><code>id</code> (string, required): The unique MongoDB ObjectId of the record to update.</li>\n</ul>\n</li>\n<li><p><strong>Body (raw JSON):</strong> <em>(All fields are optional)</em></p>\n<ul>\n<li><p><code>amount</code> (number): The financial value of the record. Must be a positive number.</p>\n</li>\n<li><p><code>type</code> (string): The financial transaction type. Must be either <code>income</code> or <code>expense</code>.</p>\n</li>\n<li><p><code>category</code> (string): The category of the record (e.g., \"Food\", \"Rent\"). Cannot be empty if provided.</p>\n</li>\n<li><p><code>date</code> (string): Record transaction date (ISO 8601 Datetime format).</p>\n</li>\n<li><p><code>description</code> (string): Additional context or notes for the transaction.</p>\n</li>\n</ul>\n</li>\n</ul>\n<h3 id=\"expected-responses\">Expected Responses</h3>\n<ol>\n<li><p><strong>200 OK (Success)</strong></p>\n<ul>\n<li><p>Triggered when the record is successfully updated.</p>\n</li>\n<li><p>{\"status\": \"success\",\"data\": { \"record\": { \"_id\": \"60d0fe4f5311236168a109ca\", \"amount\": 150.50, \"type\": \"expense\", \"category\": \"Utilities\", \"description\": \"Updated water bill amount\", \"date\": \"2023-11-04T09:00:00.000Z\", \"updatedAt\": \"2023-11-04T12:00:00.000Z\" }}}</p>\n</li>\n</ul>\n</li>\n<li><p><strong>400 Bad Request (Validation Error)</strong></p>\n<ul>\n<li>Triggered if <code>amount</code> is a negative number, <code>type</code> is invalid, or if the path <code>id</code> is not a valid MongoDB ObjectId.</li>\n</ul>\n</li>\n<li><p><strong>404 Not Found</strong></p>\n<ul>\n<li>Triggered if the provided <code>id</code> is valid but no financial record with that ID exists in the database.</li>\n</ul>\n</li>\n<li><p><strong>401 Unauthorized (Authentication Failed)</strong></p>\n<ul>\n<li>Triggered if the JWT token is missing, expired, or invalid.</li>\n</ul>\n</li>\n<li><p><strong>403 Forbidden (Role Restriction)</strong></p>\n<ul>\n<li>Triggered if a logged-in user who is <em>not</em> an Admin attempts to modify records.</li>\n</ul>\n</li>\n</ol>\n<p>This endpoint allows you to update the description of a specific record identified by its unique ID. By sending a PATCH request to the specified URL, you can modify the existing description of the record.</p>\n<h3 id=\"request-format\">Request Format</h3>\n<ul>\n<li><p><strong>Method:</strong> PATCH</p>\n</li>\n<li><p><strong>URL:</strong> <code>http://localhost:5000/api/v1/records/{recordId}</code></p>\n</li>\n<li><p><strong>Request Body:</strong> The request body must be in JSON format and should include the following key:</p>\n<ul>\n<li><code>description</code> (string): The new description for the record. This should be a concise string that describes the record's purpose or content.</li>\n</ul>\n</li>\n</ul>\n<p><strong>Example Request Body:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"description\": \"This is updated description\"\n}\n\n</code></pre>\n<h3 id=\"response-structure\">Response Structure</h3>\n<p>Upon a successful update, the server will respond with a JSON object that typically includes the updated record details. The response may contain the following fields:</p>\n<ul>\n<li><p><code>id</code> (string): The unique identifier of the updated record.</p>\n</li>\n<li><p><code>description</code> (string): The updated description of the record.</p>\n</li>\n<li><p><code>updated_at</code> (string): A timestamp indicating when the record was last updated.</p>\n</li>\n</ul>\n<h3 id=\"example-response\">Example Response:</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"id\": \"69cfa2e96c616bc6da573539\",\n  \"description\": \"This is updated description\",\n  \"updated_at\": \"2023-10-01T12:00:00Z\"\n}\n\n</code></pre>\n<p>Ensure that your request body is properly formatted as JSON to avoid errors during the update process.</p>\n","urlObject":{"path":["records","69cfa2e96c616bc6da573539"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"7089bb2d-e390-4d91-b2ca-41728c88bd11"},{"name":"Soft delete a record","id":"0b1c1ab3-0bf5-4736-be16-49c634c8724b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://localhost:5000/api/v1/records/69cfb122b39085b1c7edac81","description":"<h3 id=\"overview\">Overview</h3>\n<ul>\n<li><p><strong>Name:</strong> Delete Record (Soft Delete)</p>\n</li>\n<li><p><strong>Endpoint:</strong> DELETE /api/v1/records/:id</p>\n</li>\n<li><p><strong>Access Control:</strong> Private &amp; Restricted. Requires a valid JWT token of a user with the <code>admin</code> role.</p>\n</li>\n<li><p><strong>Description:</strong> This endpoint is used by administrators to delete a financial transaction record. The platform utilizes a 'soft delete' mechanism, meaning the record is not permanently removed from the database immediately. Instead, it is flagged as deleted (e.g., via a <code>deletedAt</code> timestamp or <code>isDeleted</code> boolean), ensuring it is excluded from dashboards and analysis, but preserving data integrity in case a restore is necessary.</p>\n</li>\n</ul>\n<h3 id=\"request-details\">Request Details</h3>\n<ul>\n<li><p><strong>Headers:</strong></p>\n<ul>\n<li><p><code>Content-Type: application/json</code></p>\n</li>\n<li><p><code>Authorization: Bearer</code></p>\n</li>\n</ul>\n</li>\n<li><p><strong>Path Parameters:</strong></p>\n<ul>\n<li><code>id</code> (string, required): The unique MongoDB ObjectId of the record to be deleted.</li>\n</ul>\n</li>\n<li><p><strong>Body:</strong> None</p>\n</li>\n</ul>\n<h3 id=\"responses\">Responses</h3>\n<ol>\n<li><p><strong>200 OK (or 204 No Content) (Success)</strong></p>\n<ul>\n<li><p>Triggered when the record is successfully soft-deleted.</p>\n</li>\n<li><p>{ \"status\": \"success\", \"message\": \"Record successfully deleted\" }</p>\n</li>\n</ul>\n</li>\n<li><p><strong>400 Bad Request (Validation Error)</strong></p>\n<ul>\n<li>Triggered if the path <code>id</code> is not a valid structured MongoDB ObjectId.</li>\n</ul>\n</li>\n<li><p><strong>404 Not Found</strong></p>\n<ul>\n<li>Triggered if the provided <code>id</code> is valid but no active financial record with that ID exists in the database (or if it has already been deleted).</li>\n</ul>\n</li>\n<li><p><strong>401 Unauthorized (Authentication Failed)</strong></p>\n<ul>\n<li>Triggered if the JWT token is missing, expired, or invalid.</li>\n</ul>\n</li>\n<li><p><strong>403 Forbidden (Role Restriction)</strong></p>\n<ul>\n<li>Triggered if a logged-in user who is <em>not</em> an Admin attempts to delete a record.</li>\n</ul>\n</li>\n</ol>\n<p>This endpoint is used to delete a specific record identified by its unique identifier (ID) from the database. The ID must be provided in the URL path.</p>\n<h3 id=\"request\">Request</h3>\n<ul>\n<li><p><strong>Method</strong>: DELETE</p>\n</li>\n<li><p><strong>URL</strong>: <code>http://localhost:5000/api/v1/records/{id}</code></p>\n</li>\n<li><p><strong>Path Parameter</strong>:</p>\n<ul>\n<li><code>id</code> (string): The unique identifier of the record to be deleted. In this example, the ID is <code>69cfb122b39085b1c7edac81</code>.</li>\n</ul>\n</li>\n</ul>\n<h3 id=\"response\">Response</h3>\n<p>Upon successful deletion of the record, the server will respond with a status code indicating the outcome of the request. The response body may contain a confirmation message or status details, but specific structure details are not provided in this documentation.</p>\n<h3 id=\"expected-behavior\">Expected Behavior</h3>\n<ul>\n<li><p><strong>Success</strong>: A successful deletion will typically return a <code>204 No Content</code> status code, indicating that the record has been successfully removed.</p>\n</li>\n<li><p><strong>Failure</strong>: If the record does not exist or if there are issues with the request, appropriate error codes (e.g., <code>404 Not Found</code>, <code>400 Bad Request</code>) will be returned.</p>\n</li>\n</ul>\n<p>Ensure to handle these responses appropriately in your application.</p>\n","urlObject":{"path":["records","69cfb122b39085b1c7edac81"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"0b1c1ab3-0bf5-4736-be16-49c634c8724b"},{"name":"Get records","id":"8d73f51f-86d7-494c-b9a7-a2c8122889cd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/v1/records/?page=1&limit=1&search=update&category=Salary","description":"<h3 id=\"overview\">Overview</h3>\n<ul>\n<li><p><strong>Name:</strong> Get All Records</p>\n</li>\n<li><p><strong>Endpoint:</strong> <code>GET /api/v1/records</code></p>\n</li>\n<li><p><strong>Access Control:</strong> Private. Requires a valid JWT token. Accessible by Admins, Analysts, and Viewers.</p>\n</li>\n<li><p><strong>Description:</strong> This endpoint retrieves the financial transaction records from the database. It supports advanced features such as pagination, searching, and filtering (by type and category) to allow Analysts and Viewers to drill down into specific financial data points. Soft-deleted records are automatically excluded from the results.</p>\n</li>\n</ul>\n<h3 id=\"request-details\">Request Details</h3>\n<ul>\n<li><p><strong>Headers:</strong></p>\n<ul>\n<li><p><code>Content-Type: application/json</code></p>\n</li>\n<li><p><code>Authorization: Bearer</code></p>\n</li>\n</ul>\n</li>\n<li><p><strong>Body:</strong> None (GET request)</p>\n</li>\n<li><p><strong>Query Parameters (Optional):</strong></p>\n<ul>\n<li><p><code>page</code> (number): The page number for pagination (e.g., <code>1</code>).</p>\n</li>\n<li><p><code>limit</code> (number): The amount of records to return per page (e.g., <code>10</code>).</p>\n</li>\n<li><p><code>type</code> (string): Filter records by transaction type (enum: <code>income</code>, <code>expense</code>).</p>\n</li>\n<li><p><code>category</code> (string): Filter records by a specific category (e.g., <code>food</code>, <code>rent</code>).</p>\n</li>\n<li><p><code>search</code> (string): Search text applied to record descriptions or titles (e.g., <code>rent</code>).</p>\n</li>\n</ul>\n</li>\n</ul>\n<h3 id=\"expected-responses\">Expected Responses</h3>\n<ol>\n<li><p><strong>200 OK (Success)</strong></p>\n<ul>\n<li><p>Triggered when the records are successfully retrieved based on the provided query filters.</p>\n</li>\n<li><p>{ \"status\": \"success\", \"results\": 2, \"data\": { \"records\": [ { \"_id\": \"60d0fe4f5311236168a109ca\", \"amount\": 5000, \"type\": \"income\", \"category\": \"Salary\", \"description\": \"Monthly Salary\", \"date\": \"2023-11-01T10:00:00.000Z\" }, { \"_id\": \"60d0fe4f5311236168a109cb\", \"amount\": 1500, \"type\": \"expense\", \"category\": \"Rent\", \"description\": \"Office Rent\", \"date\": \"2023-11-02T10:00:00.000Z\" } ] } }</p>\n</li>\n</ul>\n</li>\n<li><p><strong>401 Unauthorized (Authentication Failed)</strong></p>\n<ul>\n<li>Triggered if the JWT token is missing, expired, or invalid.</li>\n</ul>\n</li>\n</ol>\n<p>This endpoint allows users to retrieve a list of records based on specified search criteria. It supports pagination and filtering by category.</p>\n<h4 id=\"request\">Request</h4>\n<ul>\n<li><p><strong>Method</strong>: GET</p>\n</li>\n<li><p><strong>URL</strong>: <code>http://localhost:5000/api/v1/records/</code></p>\n</li>\n</ul>\n<h4 id=\"query-parameters\">Query Parameters</h4>\n<ul>\n<li><p><code>page</code> (integer): The page number of the results to retrieve. This is useful for pagination.</p>\n</li>\n<li><p><code>limit</code> (integer): The maximum number of records to return per page.</p>\n</li>\n<li><p><code>search</code> (string): A search term to filter the records. In this case, it is set to \"update\".</p>\n</li>\n<li><p><code>category</code> (string): The category to filter the records. In this case, it is set to \"Salary\".</p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response will contain a structured JSON object with the following properties:</p>\n<ul>\n<li><p><code>totalRecords</code> (integer): The total number of records that match the search criteria.</p>\n</li>\n<li><p><code>currentPage</code> (integer): The current page number of the results returned.</p>\n</li>\n<li><p><code>records</code> (array): An array of record objects that match the search criteria. Each record object may contain various attributes relevant to the records.</p>\n</li>\n</ul>\n<p>This endpoint is useful for applications that need to display or process records based on user-defined search and filter parameters.</p>\n","urlObject":{"path":["records",""],"host":["http://localhost:5000/api/v1"],"query":[{"key":"page","value":"1"},{"key":"limit","value":"1"},{"key":"search","value":"update"},{"key":"category","value":"Salary"}],"variable":[]}},"response":[],"_postman_id":"8d73f51f-86d7-494c-b9a7-a2c8122889cd"}],"id":"65a70433-0a2c-4a6b-a963-a686e5fd53f8","_postman_id":"65a70433-0a2c-4a6b-a963-a686e5fd53f8","description":""},{"name":"Analytics","item":[{"name":"Get summary","id":"dd74201c-9f0d-4895-8572-677292019650","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/v1/analytics/summary","description":"<h3 id=\"overview\">Overview</h3>\n<ul>\n<li><p><strong>Name:</strong> Get Analytics Summary</p>\n</li>\n<li><p><strong>Endpoint:</strong> <code>GET /api/v1/analytics/summary</code></p>\n</li>\n<li><p><strong>Access Control:</strong> Private &amp; Restricted. Requires a valid JWT token. Accessible strictly by Admins and Analysts (Viewers are blocked from this endpoint).</p>\n</li>\n<li><p><strong>Description:</strong> This endpoint runs an aggregation to calculate the platform's high-level financial overview. It returns the total calculated income, the total expense, and the resulting net balance. Soft-deleted records are completely ignored in these calculations.</p>\n</li>\n</ul>\n<h3 id=\"request-details\">Request Details</h3>\n<ul>\n<li><p><strong>Headers:</strong></p>\n<ul>\n<li><p><code>Content-Type: application/json</code></p>\n</li>\n<li><p><code>Authorization: Bearer</code></p>\n</li>\n</ul>\n</li>\n<li><p><strong>Body:</strong> None (GET request)</p>\n</li>\n</ul>\n<h3 id=\"responses\">Responses</h3>\n<ol>\n<li><p><strong>200 OK (Success)</strong></p>\n<ul>\n<li><p>Triggered when the aggregation is successful and the summary is returned.</p>\n</li>\n<li><p>{\"status\": \"success\",\"data\": { \"summary\": { \"totalIncome\": 150000.50, \"totalExpense\": 45000.25, \"netBalance\": 105000.25 }}}</p>\n</li>\n</ul>\n</li>\n<li><p><strong>401 Unauthorized (Authentication Failed)</strong></p>\n<ul>\n<li>Triggered if the JWT token is missing, expired, or invalid.</li>\n</ul>\n</li>\n<li><p><strong>403 Forbidden (Role Restriction)</strong></p>\n<ul>\n<li>Triggered if a logged-in user who strictly has the <code>viewer</code> role attempts to hit this endpoint, as it is restricted to <code>admin</code> and <code>analyst</code> only.</li>\n</ul>\n</li>\n</ol>\n<p>This endpoint retrieves a summary of analytics data from the Zorvyn platform. It is designed to provide users with a quick overview of key metrics and insights related to their analytics.</p>\n<h3 id=\"request-parameters\">Request Parameters</h3>\n<p>This is a <strong>GET</strong> request and does not require any input parameters in the query string. However, users may need to include authentication tokens or other headers as specified in the API documentation for authorization.</p>\n<h3 id=\"response-structure\">Response Structure</h3>\n<p>The response will be in JSON format and will include the following key fields:</p>\n<ul>\n<li><p><code>totalVisits</code>: Represents the total number of visits recorded.</p>\n</li>\n<li><p><code>uniqueVisitors</code>: Indicates the count of unique visitors.</p>\n</li>\n<li><p><code>pageViews</code>: The total number of pages viewed during the specified period.</p>\n</li>\n<li><p><code>averageSessionDuration</code>: The average duration of user sessions.</p>\n</li>\n<li><p><code>bounceRate</code>: The percentage of visitors who leave after viewing only one page.</p>\n</li>\n</ul>\n<p>This summary provides essential metrics that can help users assess the performance of their digital assets and make informed decisions based on user engagement data.</p>\n<h3 id=\"usage\">Usage</h3>\n<p>To effectively use this endpoint, ensure that you have the necessary authentication in place and be prepared to handle the JSON response to extract the relevant analytics data.</p>\n","urlObject":{"path":["analytics","summary"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"dd74201c-9f0d-4895-8572-677292019650"},{"name":"Get Stats","id":"8315ca87-5ca7-4efa-9fac-b5b324fb4878","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/v1/analytics/stats","description":"<h3 id=\"overview\">Overview</h3>\n<ul>\n<li><p><strong>Name:</strong> Get Analytics Stats</p>\n</li>\n<li><p><strong>Endpoint:</strong> <code>GET /api/v1/analytics/stats</code></p>\n</li>\n<li><p><strong>Access Control:</strong> Private &amp; Restricted. Requires a valid JWT token. Accessible strictly by Admins and Analysts (Viewers are blocked from this endpoint).</p>\n</li>\n<li><p><strong>Description:</strong> This endpoint runs specialized aggregation pipelines over the records to generate visualizable data for dashboards. It returns detailed statistical breakdowns, including category-wise spending/income totals and monthly financial trends. Soft-deleted records are automatically excluded from the aggregations.</p>\n</li>\n</ul>\n<h3 id=\"request-details\">Request Details</h3>\n<ul>\n<li><p><strong>Headers:</strong></p>\n<ul>\n<li><p><code>Content-Type: application/json</code></p>\n</li>\n<li><p><code>Authorization: Bearer</code></p>\n</li>\n</ul>\n</li>\n<li><p><strong>Body:</strong> None (GET request)</p>\n</li>\n</ul>\n<h3 id=\"responses\">Responses</h3>\n<ol>\n<li><p><strong>200 OK (Success)</strong></p>\n<ul>\n<li><p>Triggered when the aggregation is successful and the detailed statistics are returned.</p>\n</li>\n<li><p>{\"status\": \"success\",\"data\": { \"stats\": { \"categoryTotals\": [ { \"category\": \"Salary\", \"type\": \"income\", \"total\": 150000 }, { \"category\": \"Rent\", \"type\": \"expense\", \"total\": 15000 }, { \"category\": \"Food\", \"type\": \"expense\", \"total\": 4500 } ], \"monthlyTrends\": [ { \"month\": \"2023-10\", \"income\": 50000, \"expense\": 12000, \"net\": 38000 }, { \"month\": \"2023-11\", \"income\": 50000, \"expense\": 14500, \"net\": 35500 } ] }}}</p>\n</li>\n</ul>\n</li>\n<li><p><strong>401 Unauthorized (Authentication Failed)</strong></p>\n<ul>\n<li>Triggered if the JWT token is missing, expired, or invalid.</li>\n</ul>\n</li>\n<li><p><strong>403 Forbidden (Role Restriction)</strong></p>\n<ul>\n<li>Triggered if a logged-in user who strictly has the <code>viewer</code> role attempts to hit this endpoint, as it is restricted to <code>admin</code> and <code>analyst</code> only.</li>\n</ul>\n</li>\n</ol>\n<p>This endpoint retrieves analytics statistics for the application. It is designed to provide insights into various metrics that can help in understanding user engagement and application performance.</p>\n<h4 id=\"request-headers\">Request Headers</h4>\n<ul>\n<li><p><strong>Authorization</strong>: Required. This header should contain the bearer token for authentication. Ensure that you have the necessary permissions to access the analytics data.</p>\n</li>\n<li><p><strong>Content-Type</strong>: Optional. Typically set to <code>application/json</code>, but not required for GET requests.</p>\n</li>\n</ul>\n<h4 id=\"request-body\">Request Body</h4>\n<p>This is a <code>GET</code> request and does not require a request body.</p>\n<h4 id=\"response-structure\">Response Structure</h4>\n<p>The response will be in JSON format and will include the following fields:</p>\n<ul>\n<li><p><strong>status</strong>: A string indicating the success or failure of the request.</p>\n</li>\n<li><p><strong>data</strong>: An object containing the analytics statistics, which may include:</p>\n<ul>\n<li><p><strong>totalUsers</strong>: Integer representing the total number of users.</p>\n</li>\n<li><p><strong>activeUsers</strong>: Integer representing the number of active users.</p>\n</li>\n<li><p><strong>sessionDuration</strong>: Average session duration in seconds.</p>\n</li>\n<li><p><strong>pageViews</strong>: Total number of page views.</p>\n</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"example-response\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"status\": \"success\",\n  \"data\": {\n    \"totalUsers\": 1000,\n    \"activeUsers\": 300,\n    \"sessionDuration\": 120,\n    \"pageViews\": 5000\n  }\n}\n\n</code></pre>\n<p>Ensure to handle the response appropriately based on the status field to provide feedback or further action in your application.</p>\n","urlObject":{"path":["analytics","stats"],"host":["http://localhost:5000/api/v1"],"query":[],"variable":[]}},"response":[],"_postman_id":"8315ca87-5ca7-4efa-9fac-b5b324fb4878"}],"id":"3348f036-9637-4d98-85bd-678d6324da23","description":"<p>Data aggregation and reporting endpoints. Used to calculate net balances, category-wise spending, and visualize monthly financial trends.</p>\n","_postman_id":"3348f036-9637-4d98-85bd-678d6324da23"},{"name":"meida","item":[{"name":"New Request","id":"e8d2ec8a-c14b-4112-97bf-170e8a07df0a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"e8d2ec8a-c14b-4112-97bf-170e8a07df0a"}],"id":"fcb8e270-49ab-430c-83d7-5b901772ee41","_postman_id":"fcb8e270-49ab-430c-83d7-5b901772ee41","description":""}],"variable":[{"key":"ZORVYN_BASE_URL","value":"http://localhost:5000/api/v1","type":"default"}]}