{ "openapi": "3.0.0", "paths": { "/api/auth/login": { "post": { "operationId": "Auth_login", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginDto" } } } }, "responses": { "200": { "description": "User logged in successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginResponseDto" } } } }, "401": { "description": "The email or password you entered is incorrect." } }, "summary": "User login", "tags": [ "auth" ] } }, "/api/auth/logout": { "get": { "operationId": "Auth_logout", "parameters": [], "responses": { "200": { "description": "User logged out successfully" } }, "summary": "User logout", "tags": [ "auth" ] } }, "/api/auth/change-password": { "post": { "operationId": "Auth_changePassword", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChangePasswordDto" } } } }, "responses": { "200": { "description": "Password changed successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChangePasswordResponseDto" } } } }, "400": { "description": "Current password is incorrect!" } }, "summary": "Change current password", "tags": [ "auth" ] } }, "/api/auth/forgot-password": { "post": { "operationId": "Auth_forgotPassword", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ForgotPasswordDto" } } } }, "responses": { "200": { "description": "Password reset email sent if user exists" } }, "summary": "Request password reset", "tags": [ "auth" ] } }, "/api/auth/reset-password": { "post": { "operationId": "Auth_resetPassword", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResetPasswordDto" } } } }, "responses": { "204": { "description": "Password reset successfully" }, "400": { "description": "Invalid or expired token" } }, "summary": "Reset password with token", "tags": [ "auth" ] } }, "/api/auth/reset-password/token-status": { "post": { "operationId": "Auth_validateResetToken", "parameters": [], "responses": { "202": { "description": "Token is valid" } }, "summary": "Validate reset token", "tags": [ "auth" ] } }, "/api/me": { "get": { "operationId": "CurrentUser_get", "parameters": [], "responses": { "200": { "description": "Current user profile", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserDto" } } } } }, "summary": "Get current user profile", "tags": [ "me" ] }, "patch": { "operationId": "CurrentUser_update", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateProfileDto" } } } }, "responses": { "200": { "description": "Updated user profile", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserDto" } } } } }, "summary": "Update user profile", "tags": [ "me" ] } }, "/api/users": { "get": { "operationId": "User_fetch", "parameters": [ { "name": "email", "required": false, "in": "query", "description": "Find by exact email", "schema": { "example": "admin@example.com", "type": "string" } }, { "name": "search", "required": false, "in": "query", "description": "Search term for email, first name, or last name", "schema": { "example": "john", "type": "string" } }, { "name": "includeArchived", "required": false, "in": "query", "description": "Include soft-deleted users", "schema": { "default": false, "example": false, "type": "boolean" } }, { "name": "page", "required": false, "in": "query", "description": "Page number", "schema": { "minimum": 1, "default": 1, "type": "number" } }, { "name": "limit", "required": false, "in": "query", "description": "Number of items per page", "schema": { "minimum": 1, "maximum": 100, "default": 20, "type": "number" } }, { "name": "sortBy", "required": false, "in": "query", "description": "Field to sort by", "schema": { "default": "createdAt", "type": "string", "enum": [ "id", "email", "firstName", "lastName", "createdAt", "updatedAt" ] } }, { "name": "sortOrder", "required": false, "in": "query", "description": "Sort order", "schema": { "default": "DESC", "type": "string", "enum": [ "ASC", "DESC" ] } } ], "responses": { "200": { "description": "List of users", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaginatedUsersDto" } } } } }, "summary": "List users", "tags": [ "users" ] }, "post": { "operationId": "User_create", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateUserDto" } } } }, "responses": { "201": { "description": "User created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserDto" } } } }, "409": { "description": "User already exists" } }, "summary": "Create or invite user (Admin only)", "tags": [ "users" ] } }, "/api/users/{id}": { "get": { "operationId": "User_get", "parameters": [ { "name": "id", "required": true, "in": "path", "description": "User ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "User found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserDto" } } } }, "404": { "description": "User not found" } }, "summary": "Get user by ID (Admin only)", "tags": [ "users" ] }, "patch": { "operationId": "User_update", "parameters": [ { "name": "id", "required": true, "in": "path", "description": "User ID", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateUserDto" } } } }, "responses": { "200": { "description": "User updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserDto" } } } }, "403": { "description": "Forbidden" }, "404": { "description": "User not found" } }, "summary": "Update user by ID", "tags": [ "users" ] }, "delete": { "operationId": "User_remove", "parameters": [ { "name": "id", "required": true, "in": "path", "description": "User ID", "schema": { "type": "string" } } ], "responses": { "204": { "description": "User deleted successfully" }, "404": { "description": "User not found" } }, "summary": "Delete user (Admin only)", "tags": [ "users" ] } }, "/api/users/{id}/restore": { "post": { "operationId": "User_restore", "parameters": [ { "name": "id", "required": true, "in": "path", "description": "User ID", "schema": { "type": "string" } } ], "responses": { "200": { "description": "User restored successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserDto" } } } }, "404": { "description": "User not found" } }, "summary": "Restore soft-deleted user (Admin only)", "tags": [ "users" ] } }, "/api/users/{id}/reinvite": { "post": { "operationId": "User_reinvite", "parameters": [ { "name": "id", "required": true, "in": "path", "description": "User ID", "schema": { "type": "string" } } ], "responses": { "202": { "description": "Invitation sent" }, "404": { "description": "User not found" } }, "summary": "Reinvite user (Admin only)", "tags": [ "users" ] } }, "/api/healthcheck": { "get": { "operationId": "Health_healthCheck", "parameters": [], "responses": { "200": { "description": "Service is healthy" } }, "summary": "Basic health check", "tags": [ "health" ] } }, "/api/health/live": { "get": { "operationId": "Health_liveness", "parameters": [], "responses": { "200": { "description": "Service is alive" } }, "summary": "Liveness probe", "tags": [ "health" ] } }, "/api/health/ready": { "get": { "operationId": "Health_readiness", "parameters": [], "responses": { "200": { "description": "Service is ready" }, "503": { "description": "Service is not ready" } }, "summary": "Readiness probe", "tags": [ "health" ] } }, "/api/sentry/debug": { "get": { "operationId": "Health_sentryDebug", "parameters": [], "responses": { "500": { "description": "Test error thrown for Sentry" } }, "summary": "Test Sentry error capture (development only)", "tags": [ "health" ] } }, "/api/sentry/message": { "get": { "operationId": "Health_sentryMessage", "parameters": [], "responses": { "200": { "description": "Test message sent to Sentry" } }, "summary": "Test Sentry message capture (development only)", "tags": [ "health" ] } }, "/api/seed/reset": { "post": { "description": "Clears all data and reseeds with base admin user. Only in non prod env.", "operationId": "Seed_resetDatabase", "parameters": [], "responses": { "200": { "description": "Database reset successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SeedResponseDto" } } } }, "403": { "description": "Forbidden - not available in production" } }, "summary": "Reset database with base seed data", "tags": [ "seed" ] } }, "/api/seed/user": { "post": { "description": "Creates a test user with random data", "operationId": "Seed_seedUser", "parameters": [], "responses": { "201": { "description": "Test user created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SeedResponseDto" } } } } }, "summary": "Create a single test user", "tags": [ "seed" ] } } }, "info": { "title": "API", "description": "API documentation", "version": "1.0", "contact": {} }, "tags": [ { "name": "auth", "description": "Authentication endpoints" }, { "name": "me", "description": "Current user profile endpoints" }, { "name": "users", "description": "User management endpoints" }, { "name": "health", "description": "Health check endpoints" } ], "servers": [], "components": { "securitySchemes": { "bearer": { "scheme": "bearer", "bearerFormat": "JWT", "type": "http" } }, "schemas": { "LoginDto": { "type": "object", "properties": { "email": { "type": "string", "description": "User email address", "example": "user@example.com" }, "password": { "type": "string", "description": "User password", "example": "password123", "minLength": 8 } }, "required": [ "email", "password" ] }, "UserDto": { "type": "object", "properties": { "id": { "type": "number" }, "email": { "type": "string" }, "role": { "type": "string", "enum": [ "ADMIN", "USER" ] }, "firstName": { "type": "string" }, "lastName": { "type": "string" }, "fullName": { "type": "string" }, "label": { "type": "string" }, "imgUrl": { "type": "string" }, "createdAt": { "format": "date-time", "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "deletedAt": { "format": "date-time", "type": "string" } }, "required": [ "id", "email", "role", "firstName", "lastName", "fullName", "label", "imgUrl", "createdAt", "updatedAt", "deletedAt" ] }, "LoginResponseDto": { "type": "object", "properties": { "user": { "$ref": "#/components/schemas/UserDto" }, "accessToken": { "type": "string", "description": "JWT access token" }, "expiresInMs": { "type": "number", "description": "Token expiration time in milliseconds" } }, "required": [ "user", "accessToken", "expiresInMs" ] }, "ChangePasswordDto": { "type": "object", "properties": { "currentPassword": { "type": "string", "description": "Current password", "example": "OldPassword123" }, "newPassword": { "type": "string", "description": "New password", "minLength": 8, "example": "NewSecureP@ssw0rd" } }, "required": [ "currentPassword", "newPassword" ] }, "ChangePasswordResponseDto": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" } }, "required": [ "message" ] }, "ForgotPasswordDto": { "type": "object", "properties": { "email": { "type": "string", "description": "Email address to send reset link to", "example": "user@example.com" } }, "required": [ "email" ] }, "ResetPasswordDto": { "type": "object", "properties": { "token": { "type": "string", "description": "Password reset token", "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." }, "newPassword": { "type": "string", "description": "New password", "example": "NewSecureP@ssw0rd", "minLength": 8 } }, "required": [ "token", "newPassword" ] }, "UpdateProfileDto": { "type": "object", "properties": { "email": { "type": "string", "description": "User email address", "example": "user@example.com" }, "firstName": { "type": "string", "description": "User first name", "example": "John" }, "lastName": { "type": "string", "description": "User last name", "example": "Doe" }, "imgUrl": { "type": "string", "description": "User avatar as data URL (base64 encoded image)", "example": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAApgAAAKYB3X3/OAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAANCSURBVEiJtZZPbBtFFMZ/M7ubXdtdb1xSFyeilBapySVU8h8OoFaooFSqiihIVIpQBKci6KEg9Q6H9kovIHoCIVQJJCKE1ENFjnAgcaSGC6rEnxBwA04Tx43t2FnvDAfjkNibxgHxnWb2e/u992bee7tCa00YFsffekFY+nUzFtjW0LrvjRXrCDIAaPLlW0nHL0SsZtVoaF98mLrx3pdhOqLtYPHChahZcYYO7KvPFxvRl5XPp1sN3adWiD1ZAqD6XYK1b/dvE5IWryTt2udLFedwc1+9kLp+vbbpoDh+6TklxBeAi9TL0taeWpdmZzQDry0AcO+jQ12RyohqqoYoo8RDwJrU+qXkjWtfi8Xxt58BdQuwQs9qC/afLwCw8tnQbqYAPsgxE1S6F3EAIXux2oQFKm0ihMsOF71dHYx+f3NND68ghCu1YIoePPQN1pGRABkJ6Bus96CutRZMydTl+TvuiRW1m3n0eDl0vRPcEysqdXn+jsQPsrHMquGeXEaY4Yk4wxWcY5V/9scqOMOVUFthatyTy8QyqwZ+kDURKoMWxNKr2EeqVKcTNOajqKoBgOE28U4tdQl5p5bwCw7BWquaZSzAPlwjlithJtp3pTImSqQRrb2Z8PHGigD4RZuNX6JYj6wj7O4TFLbCO/Mn/m8R+h6rYSUb3ekokRY6f/YukArN979jcW+V/S8g0eT/N3VN3kTqWbQ428m9/8k0P/1aIhF36PccEl6EhOcAUCrXKZXXWS3XKd2vc/TRBG9O5ELC17MmWubD2nKhUKZa26Ba2+D3P+4/MNCFwg59oWVeYhkzgN/JDR8deKBoD7Y+ljEjGZ0sosXVTvbc6RHirr2reNy1OXd6pJsQ+gqjk8VWFYmHrwBzW/n+uMPFiRwHB2I7ih8ciHFxIkd/3Omk5tCDV1t+2nNu5sxxpDFNx+huNhVT3/zMDz8usXC3ddaHBj1GHj/As08fwTS7Kt1HBTmyN29vdwAw+/wbwLVOJ3uAD1wi/dUH7Qei66PfyuRj4Ik9is+hglfbkbfR3cnZm7chlUWLdwmprtCohX4HUtlOcQjLYCu+fzGJH2QRKvP3UNz8bWk1qMxjGTOMThZ3kvgLI5AzFfo379UAAAAASUVORK5CYII=" } } }, "PaginatedUsersDto": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/UserDto" } }, "total": { "type": "number", "description": "Total number of items", "example": 100 }, "limit": { "type": "number", "description": "Number of items per page", "example": 20 }, "page": { "type": "number", "description": "Current page number", "example": 1 }, "totalPages": { "type": "number", "description": "Total number of pages", "example": 5 }, "hasPrevious": { "type": "boolean", "description": "Has previous page", "example": false }, "hasNext": { "type": "boolean", "description": "Has next page", "example": true } }, "required": [ "data", "total", "limit", "page", "totalPages", "hasPrevious", "hasNext" ] }, "CreateUserDto": { "type": "object", "properties": { "email": { "type": "string", "description": "User email address", "example": "user@example.com" }, "firstName": { "type": "string", "description": "User first name", "example": "John" }, "lastName": { "type": "string", "description": "User last name", "example": "Doe" }, "role": { "type": "string", "description": "User role", "enum": [ "ADMIN", "USER" ], "example": "USER" } }, "required": [ "email" ] }, "UpdateUserDto": { "type": "object", "properties": { "email": { "type": "string", "description": "User email address", "example": "user@example.com" }, "firstName": { "type": "string", "description": "User first name", "example": "John" }, "lastName": { "type": "string", "description": "User last name", "example": "Doe" }, "imgUrl": { "type": "string", "description": "User avatar as data URL (base64 encoded image)", "example": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAApgAAAKYB3X3/OAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAANCSURBVEiJtZZPbBtFFMZ/M7ubXdtdb1xSFyeilBapySVU8h8OoFaooFSqiihIVIpQBKci6KEg9Q6H9kovIHoCIVQJJCKE1ENFjnAgcaSGC6rEnxBwA04Tx43t2FnvDAfjkNibxgHxnWb2e/u992bee7tCa00YFsffekFY+nUzFtjW0LrvjRXrCDIAaPLlW0nHL0SsZtVoaF98mLrx3pdhOqLtYPHChahZcYYO7KvPFxvRl5XPp1sN3adWiD1ZAqD6XYK1b/dvE5IWryTt2udLFedwc1+9kLp+vbbpoDh+6TklxBeAi9TL0taeWpdmZzQDry0AcO+jQ12RyohqqoYoo8RDwJrU+qXkjWtfi8Xxt58BdQuwQs9qC/afLwCw8tnQbqYAPsgxE1S6F3EAIXux2oQFKm0ihMsOF71dHYx+f3NND68ghCu1YIoePPQN1pGRABkJ6Bus96CutRZMydTl+TvuiRW1m3n0eDl0vRPcEysqdXn+jsQPsrHMquGeXEaY4Yk4wxWcY5V/9scqOMOVUFthatyTy8QyqwZ+kDURKoMWxNKr2EeqVKcTNOajqKoBgOE28U4tdQl5p5bwCw7BWquaZSzAPlwjlithJtp3pTImSqQRrb2Z8PHGigD4RZuNX6JYj6wj7O4TFLbCO/Mn/m8R+h6rYSUb3ekokRY6f/YukArN979jcW+V/S8g0eT/N3VN3kTqWbQ428m9/8k0P/1aIhF36PccEl6EhOcAUCrXKZXXWS3XKd2vc/TRBG9O5ELC17MmWubD2nKhUKZa26Ba2+D3P+4/MNCFwg59oWVeYhkzgN/JDR8deKBoD7Y+ljEjGZ0sosXVTvbc6RHirr2reNy1OXd6pJsQ+gqjk8VWFYmHrwBzW/n+uMPFiRwHB2I7ih8ciHFxIkd/3Omk5tCDV1t+2nNu5sxxpDFNx+huNhVT3/zMDz8usXC3ddaHBj1GHj/As08fwTS7Kt1HBTmyN29vdwAw+/wbwLVOJ3uAD1wi/dUH7Qei66PfyuRj4Ik9is+hglfbkbfR3cnZm7chlUWLdwmprtCohX4HUtlOcQjLYCu+fzGJH2QRKvP3UNz8bWk1qMxjGTOMThZ3kvgLI5AzFfo379UAAAAASUVORK5CYII=" }, "role": { "type": "string", "description": "User role (admin only)", "enum": [ "ADMIN", "USER" ], "example": "USER" } } }, "SeedResponseDto": { "type": "object", "properties": { "message": { "type": "string", "description": "Result message" }, "data": { "type": "object", "description": "Response data" } }, "required": [ "message" ] } } } }