Azure Functions Layer
Serverless API layer providing HTTP triggers and cloud-based business logic.
REQUEST PIPELINEHow an inbound HTTP request traverses the Azure Functions middleware pipeline to the service layer.
rendering diagram…
flowchart LR
CLIENT[Client<br/>Blazor - MAUI]:::app
MW1{Rate Limiter<br/>Middleware}:::sec
MW2{Auth<br/>Middleware}:::sec
FN[Azure Function<br/>HTTP Trigger]:::app
SVC[Gmi.Services<br/>Business Logic]:::svc
DB[(MySQL)]:::data
BLOB[(Blob Storage)]:::data
EXT[External APIs<br/>Stripe - FMP]:::ext
CLIENT -->|HTTPS request| MW1
MW1 -->|within limits| MW2
MW2 -->|token valid| FN
FN -->|invokes| SVC
SVC -->|EF Core| DB
SVC -->|file ops| BLOB
SVC -->|integration| EXT
MW1 -->|429 Too Many Requests| CLIENT
MW2 -->|401 Unauthorized| CLIENT
classDef app fill:#1f2630,stroke:#C0894E,color:#F3EFE8;
classDef svc fill:#241c14,stroke:#E2B583,color:#F3EFE8;
classDef data fill:#22201a,stroke:#C0894E,color:#EBD3AE;
classDef ext fill:#1b1f27,stroke:#5A616B,color:#C4C0B8;
classDef sec fill:#1d2733,stroke:#5cc8e0,color:#eafaff;Gmi.Api.AzureFunctions
The serverless API layer built on Azure Functions provides:
- RESTful API endpoints
- Authentication & authorization
- Data validation
- Business logic processing
- External service integration
- Scalable execution
API Endpoints
Complete list of 312 HTTP endpoints organized by functional area
Account Management (17 endpoints)
POST/accounts | Create new account |
POST/accounts/validate-email | Validate email address |
POST/accounts/{accountId}/resend-email-validation | Resend email validation |
PUT/accounts | Update account details |
PATCH/accounts/{accountId}/enable | Enable/disable account |
POST/accounts/search | Search accounts |
GET/accounts/paged | Get paginated accounts |
PATCH/accounts/{accountId}/validate | Validate account for use |
PATCH/accounts/{accountId}/set-email-validated | Set email as validated |
PATCH/accounts/{accountId}/unvalidate | Remove account validation |
PATCH/accounts/{accountId}/complete-web-onboarding | Complete web onboarding |
PATCH/accounts/{accountId}/reset-web-onboarding | Reset web onboarding |
PATCH/accounts/{accountId}/complete-mobile-onboarding | Complete mobile onboarding |
PATCH/accounts/{accountId}/reset-mobile-onboarding | Reset mobile onboarding |
GET/accounts/{accountId} | Get account details |
GET/accounts/external/{externalKey} | Get account by external key |
PATCH/accounts/{id}/set-free-status | Set free account status |
Contact Management - Email & SMS (6 endpoints)
GET/accounts/{accountId}/emails | Get account email addresses |
POST/accounts/{accountId}/emails | Add email to account |
DELETE/accounts/emails/{emailId} | Remove email address |
GET/accounts/{accountId}/sms | Get SMS numbers |
POST/accounts/{accountId}/sms | Add SMS number |
DELETE/accounts/sms/{smsId} | Remove SMS number |
Billing & Charges (11 endpoints)
POST/accounts/{accountId}/credits | Issue credit for account |
POST/accounts/{accountId}/charges | Record account charge |
GET/accounts/{accountId}/charges/count | Get charge count with date span |
GET/accounts/{accountId}/charges | Get account charges (paged) |
GET/charges/{chargeId} | Get charge by ID |
GET/accounts/{accountId}/charges/uninvoiced | Get uninvoiced charges |
GET/accounts/{accountId}/billing/dashboard | Billing dashboard |
POST/accounts/{accountId}/creditcards | Add credit card |
DELETE/creditcards/{creditCardId} | Remove credit card |
GET/accounts/{accountId}/creditcards | Get credit cards |
PATCH/creditcards/{creditCardId}/set-default | Set default card |
File Management (7 endpoints)
GET/folders/{folderId}/files | Get files in folder |
DELETE/files/{fileId} | Delete file |
GET/files/{fileId}/download | Download file |
PATCH/files/{fileId}/rename | Rename file |
PATCH/files/{fileId}/color | Change file color |
POST/accounts/{accountId}/folders/{folderId}/files | Upload file to folder |
GET/files/{fileId}/properties | Get file properties |
Folder Management (16 endpoints)
GET/accounts/{accountId}/folders | Get account folders |
POST/accounts/{accountId}/folders | Create folder for account |
GET/folders/{parentFolderId}/subfolders | Get subfolders |
GET/folders/{folderId} | Get folder by ID |
GET/folders | Get folders by parent |
GET/folders/{currentFolderId}/next | Get next folder in order |
GET/folders/{currentFolderId}/previous | Get previous folder |
PATCH/folders/{folderId}/movetoroot | Move folder to root |
PATCH/folders/{folderId}/moveup | Move folder up in order |
PATCH/folders/{folderId}/movedown | Move folder down |
PATCH/folders/{folderId}/rename | Rename folder |
PATCH/folders/{folderId}/color | Change folder color |
GET/folders/{folderId}/size | Get folder size |
GET/folders/{folderId}/properties | Get folder properties |
DELETE/folders/{folderId} | Delete folder and contents |
GET/accounts/{accountId}/folder-tree | Get folder tree with files |
Download Management (3 endpoints)
POST/accounts/{accountId}/downloads | Request download |
GET/accounts/{accountId}/downloads | Get downloads |
DELETE/accounts/{accountId}/downloads/{downloadId} | Delete download |
Job Management (12 endpoints)
POST/jobs | Create new job |
GET/accounts/{accountId}/jobs | Get jobs by account and status |
GET/jobs/{jobId} | Get job by ID |
GET/jobstatustypes/{jobStatusTypeId} | Get job status type |
GET/jobstatustypes | Get all job status types |
POST/jobs/{jobId}/symbollists | Add symbol list to job |
DELETE/jobs/symbollists/{jobSymbolListId} | Remove symbol list from job |
GET/jobs/{jobId}/symbollists | Get job symbol lists |
GET/jobs/{jobId}/charges/{accountId} | Get job charge details |
GET/jobs/{jobId}/folder | Get job top folder |
GET/accounts/{accountId}/jobs/filtered | Get filtered jobs |
GET/accounts/{accountId}/jobs/count | Get job count |
Account Folders (3 endpoints)
GET/accounts/{accountId}/account-folders | Get account folders |
POST/accounts/{accountId}/account-folders | Add folder to account |
DELETE/account-folders/{accountFolderId} | Remove folder from account |
Job Notifications (7 endpoints)
GET/jobs/{jobId}/notifications/emails | Get notification emails for job |
GET/jobs/{jobId}/notifications/sms | Get notification SMS for job |
POST/job-notifications/{jobNotificationSettingsId}/emails | Add email to job notification |
DELETE/job-notifications/{jobNotificationSettingsId}/emails/{accountEmailAddressId} | Remove email from job notification |
POST/job-notifications/{jobNotificationSettingsId}/sms | Add SMS to job notification |
DELETE/job-notifications/{jobNotificationSettingsId}/sms/{accountSmsNumberId} | Remove SMS from job notification |
POST/jobs/{jobId}/notifications/configure | Configure job notification settings |
Payments (1 endpoint)
POST/accounts/{accountId}/payments | Record payment for account |
Position Reports (9 endpoints)
GET/accounts/{accountId}/position-reports | Get position reports for account |
POST/accounts/{accountId}/position-reports | Create position report |
PUT/position-reports/{positionReportId} | Update position report |
DELETE/position-reports/{positionReportId} | Delete position report |
GET/position-reports/{positionReportId}/items | Get position report items |
POST/position-reports/{positionReportId}/items | Add position report item |
DELETE/position-report-items/{positionReportListItemId} | Delete position report item |
PUT/position-report-items | Update position report item |
POST/accounts/{accountId}/position-reports/upload-csv | Upload CSV position report |
Report Generation Schedules (4 endpoints)
POST/report-generation-schedules | Create report generation schedule |
GET/accounts/{accountId}/report-generation-schedules | Get schedules for account |
PUT/report-generation-schedules | Update report generation schedule |
DELETE/report-generation-schedules/{scheduleId} | Delete report generation schedule |
Symbol Lists (8 endpoints)
GET/accounts/{accountId}/symbol-lists | Get symbol lists by account |
GET/symbol-lists/{symbolListId} | Get symbol list |
POST/accounts/{accountId}/symbol-lists | Create symbol list for account |
PUT/symbol-lists/{symbolListId} | Update symbol list |
POST/symbol-lists | Create symbol list |
PATCH/symbol-lists/{symbolListId}/rename | Rename symbol list |
DELETE/symbol-lists/{symbolListId} | Delete symbol list |
PATCH/symbol-lists/{symbolListId}/description | Update symbol list description |
Symbol List Items (4 endpoints)
GET/symbol-lists/{symbolListId}/items | Get symbol list items |
POST/symbol-lists/{symbolListId}/items | Add symbol list item |
PUT/symbol-list-items | Update symbol list item |
DELETE/symbol-list-items/{symbolListItemId} | Delete symbol list item |
Symbol List Templates (13 endpoints)
POST/symbol-list-templates/search | Search symbol list templates |
GET/symbol-list-templates/detail/{templateId} | Get template detail |
GET/symbol-list-templates/categories | Get template categories |
POST/accounts/{accountId}/symbol-list-templates | Publish community template |
POST/accounts/{accountId}/symbol-lists/from-template | Create symbol list from template |
GET/accounts/{accountId}/symbol-list-templates | Get account templates |
DELETE/symbol-list-templates/detail/{templateId} | Delete symbol list template |
POST/manage/symbol-list-templates | Admin create template |
PUT/manage/symbol-list-templates/{templateId} | Admin update template |
GET/manage/symbol-list-templates | Admin get all templates |
PATCH/manage/symbol-list-templates/{templateId}/activate | Admin activate template |
PATCH/manage/symbol-list-templates/{templateId}/deactivate | Admin deactivate template |
DELETE/manage/symbol-list-templates/{templateId} | Admin delete template |
Messaging - Email & SMS Queue (3 endpoints)
POST/messaging/emails | Enqueue email to send |
PATCH/messaging/emails/{emailToSendId}/sent | Mark email as sent |
POST/messaging/sms | Enqueue SMS to send |
Admin Users (19 endpoints)
GET/management/users/me | Check my admin status |
GET/management/users/{adminUserId} | Get admin user by ID |
GET/management/users/entra/{entraUserId} | Get admin user by Entra ID |
GET/management/users/email/{email} | Get admin user by email |
GET/management/users/active | Get all active admin users |
GET/management/users/role/{role} | Get admin users by role |
GET/management/users | Get admin users (paged) |
POST/management/users/bootstrap | Bootstrap admin user |
POST/management/users | Create admin user |
PUT/management/users/{adminUserId} | Update admin user |
PATCH/management/users/{adminUserId}/deactivate | Deactivate admin user |
PATCH/management/users/{adminUserId}/activate | Activate admin user |
PATCH/management/users/{adminUserId}/role | Update admin user role |
PATCH/management/users/{adminUserId}/lastlogin | Update admin user last login |
PATCH/management/users/entra/{entraUserId}/lastlogin | Update last login by Entra ID |
GET/management/users/count/active | Get active admin user count |
GET/management/users/count/role/{role} | Get admin user count by role |
POST/management/users/{adminUserId}/validate-permissions | Validate admin permissions |
DELETE/management/users/{adminUserId} | Delete admin user |
Admin Notification Emails (5 endpoints)
GET/management/notification-emails | Get all notification emails |
GET/management/notification-emails/{id} | Get notification email by ID |
POST/management/notification-emails | Create notification email |
PUT/management/notification-emails/{id} | Update notification email |
DELETE/management/notification-emails/{id} | Delete notification email |
Invoicing (4 endpoints)
GET/accounts/{accountId}/invoices | Get account invoices |
GET/accounts/{accountId}/balance | Get current account balance |
GET/invoices/{invoiceId} | Get invoice with charges |
GET/invoices/{invoiceId}/charges/download | Download invoice charges |
Stripe Integration (2 endpoints)
POST/accounts/{accountId}/stripe/payment-methods | Create Stripe payment method |
POST/stripe/webhook | Stripe webhook handler |
Dashboard & Statistics (15 endpoints)
GET/dashboard/system | Get system dashboard |
GET/dashboard/stats | Get system stats |
GET/accounts/{accountId}/dashboard | Get account dashboard |
GET/dashboard/metrics/accounts/total | Total accounts count |
GET/dashboard/metrics/accounts/active | Active accounts count |
GET/dashboard/metrics/accounts/validation-pending | Validation pending count |
GET/dashboard/metrics/jobs/total | Total jobs count |
GET/dashboard/metrics/jobs/in-progress | Jobs in progress count |
GET/dashboard/metrics/jobs/completed-today | Completed jobs today count |
GET/dashboard/metrics/revenue/total | Total revenue |
GET/dashboard/metrics/revenue/this-month | Revenue this month |
GET/dashboard/metrics/storage/total | Total storage used |
GET/dashboard/metrics/revenue/monthly | Monthly revenue breakdown |
GET/dashboard/metrics/accounts/growth | Account growth metrics |
GET/dashboard/metrics/jobs/status-breakdown | Job status breakdown |
Coupons (1 endpoint)
GET/accounts/{accountId}/coupons/used | Check if account used any coupon |
Report Generation (3 endpoints)
POST/accounts/{accountId}/reports/estimate | Get report cost estimate |
POST/accounts/{accountId}/reports/generate | Generate report |
GET/reports/traffic-pattern | Get report queue status with ETAs (Report Traffic Pattern) |
Activity Logging (3 endpoints)
POST/accounts/{accountId}/activity | Log activity |
POST/accounts/{accountId}/activity/batch | Log activity batch |
GET/accounts/{accountId}/activity | Get activity log |
Health & System Monitoring (5 endpoints)
GET/health | Health check |
GET/ready | Readiness probe |
GET/management/system-health | Get system health data |
GET/management/financials/dashboard | Platform financial dashboard |
GET/management/financials/card-expirations | Card expiration summary |
Admin Queue & Activity Log (5 endpoints)
GET/management/email-queue | Get email queue |
GET/management/sms-queue | Get SMS queue |
GET/management/activity-log/stats | Get activity log stats |
GET/management/activity-log | Get admin activity log |
GET/management/activity-log/top-accounts | Get top accounts by activity |
Claude AI Analysis (8 endpoints)
POST/claude-analysis/estimate | Estimate Claude analysis cost |
POST/claude-analysis/submit | Submit Claude analysis job |
GET/claude-analysis/jobs/{accountId} | Get Claude analysis jobs |
GET/claude-analysis/job/{jobId} | Get Claude analysis job detail |
POST/claude-analysis/cancel/{jobId} | Cancel Claude analysis job |
POST/claude-analysis/jobs/{jobId}/dismiss | Dismiss Claude analysis job |
POST/claude-analysis/console/estimate | Estimate Claude console question cost |
POST/claude-analysis/console/ask | Ask Claude console question |
Report Comparison (8 endpoints)
GET/report-comparison/groups/{accountId} | Get comparison groups |
GET/report-comparison/runs/{accountId}/{groupKey} | Get comparison runs |
POST/report-comparison/estimate | Estimate comparison cost |
POST/report-comparison/submit | Submit comparison job |
GET/report-comparison/jobs/{accountId} | Get comparison jobs |
GET/report-comparison/job/{jobId} | Get comparison job detail |
POST/report-comparison/cancel/{jobId} | Cancel comparison job |
POST/report-comparison/dismiss/{jobId} | Dismiss comparison job |
ETF Holdings (7 endpoints)
GET/etf-holdings/{etfSymbol} | Lookup ETF holdings |
POST/accounts/{accountId}/symbol-lists/from-etf | Create symbol list from ETF |
POST/accounts/{accountId}/symbol-list-templates/from-etf | Publish template from ETF |
POST/manage/etf-templates/create | Admin create approved ETF template |
GET/manage/etf-templates/{templateId}/refresh-preview/{etfSymbol} | Admin preview ETF template refresh |
POST/manage/etf-templates/{templateId}/refresh-from-fmp | Admin apply ETF template refresh |
POST/manage/etf-templates/seed-and-sync | Admin seed and sync approved templates |
Billing Processing (3 endpoints)
GET/management/billing/preview | Get billing preview |
POST/management/billing/charge | Process billing charge |
POST/management/billing/charge-account | Process billing charge for account |
Critical Error Logs (3 endpoints)
GET/management/critical-errors/stats | Get critical error log stats |
GET/management/critical-errors | Get critical error logs |
POST/management/critical-errors/{errorLogId}/resolve | Resolve critical error |
Report Dashboard (3 endpoints)
GET/accounts/{accountId}/jobs/{jobId}/dashboard | Get report dashboard summary |
GET/accounts/{accountId}/jobs/{jobId}/dashboard/{symbol} | Get report dashboard symbol detail |
POST/accounts/{accountId}/jobs/{jobId}/dashboard/ask-claude | Ask Claude about dashboard |
Support Requests (6 endpoints)
POST/accounts/{accountId}/support-requests | Create support request |
GET/accounts/{accountId}/support-requests | Get support requests by account |
GET/support-requests | Get all support requests (admin) |
GET/support-requests/{id} | Get support request by ID |
POST/support-requests/{id}/respond | Respond to support request |
PUT/support-requests/{id}/status | Update support request status |
Feature Requests (5 endpoints)
POST/accounts/{accountId}/feature-requests | Create feature request |
GET/accounts/{accountId}/feature-requests | Get feature requests by account |
GET/feature-requests | Get all feature requests (admin) |
GET/feature-requests/{id} | Get feature request by ID |
PUT/feature-requests/{id}/status | Update feature request status |
Bug Reports (6 endpoints)
POST/accounts/{accountId}/bug-reports | Create bug report (authenticated) |
POST/bug-reports | Create bug report (public) |
GET/accounts/{accountId}/bug-reports | Get bug reports by account |
GET/bug-reports | Get all bug reports (admin) |
GET/bug-reports/{id} | Get bug report by ID |
PUT/bug-reports/{id}/status | Update bug report status |
Platform Feedback (4 endpoints)
POST/platform-feedback | Create feedback (public) |
POST/accounts/{accountId}/platform-feedback | Create feedback (authenticated) |
GET/platform-feedback | Get all feedback (admin) |
GET/platform-feedback/{id} | Get feedback by ID |
Admin Queue Counts (1 endpoint)
GET/admin/queue-counts | Get admin notification bar counts |
Knowledge Base (10 endpoints)
GET/knowledge-base | Get published articles |
GET/knowledge-base/all | Get all articles (admin) |
GET/knowledge-base/{id} | Get article by ID |
GET/knowledge-base/slug/{slug} | Get article by slug |
GET/knowledge-base/categories | Get categories |
GET/knowledge-base/search | Search articles |
POST/knowledge-base | Create article |
PUT/knowledge-base/{id} | Update article |
DELETE/knowledge-base/{id} | Delete article |
GET/knowledge-base | Get published (with category filter) |
Announcements (6 endpoints)
GET/announcements/active | Get active announcements |
GET/announcements | Get all announcements (admin) |
GET/announcements/{id} | Get announcement by ID |
POST/announcements | Create announcement |
PUT/announcements/{id} | Update announcement |
DELETE/announcements/{id} | Delete announcement |
Changelog (6 endpoints)
GET/changelog/published | Get published changelog entries |
GET/changelog | Get all entries (admin) |
GET/changelog/{id} | Get entry by ID |
POST/changelog | Create entry |
PUT/changelog/{id} | Update entry |
DELETE/changelog/{id} | Delete entry |
Maintenance Windows (6 endpoints)
GET/maintenance-windows/active | Get active maintenance window |
GET/maintenance-windows/upcoming | Get upcoming maintenance windows |
GET/maintenance-windows | Get all windows (admin) |
POST/maintenance-windows | Create maintenance window |
PUT/maintenance-windows/{id} | Update maintenance window |
DELETE/maintenance-windows/{id} | Delete maintenance window |
Email Preferences (2 endpoints)
GET/accounts/{accountId}/email-preferences | Get email preferences |
PUT/accounts/{accountId}/email-preferences | Update email preferences |
Data Export (1 endpoint)
GET/accounts/{accountId}/export | Export account data as JSON |
Analytics - Cost & Margin (3 endpoints)
GET/analytics/costs | Cost & margin analytics |
POST/analytics/expenses | Add operational expense |
DELETE/analytics/expenses/{id} | Delete operational expense |
Blog (8 endpoints)
GET/blog/published | Get published blog posts |
GET/blog | Get all posts (admin) |
GET/blog/{id} | Get post by ID |
GET/blog/slug/{slug} | Get post by slug |
POST/blog | Create blog post |
PUT/blog/{id} | Update blog post |
DELETE/blog/{id} | Delete blog post |
POST/blog/{id}/view | Increment view count |
Total: 312 HTTP endpoints across 45 functional areas serving the complete Grade My Investments platform
Function Architecture
Runtime & Hosting
- Runtime: .NET 10 Isolated
- Hosting: Azure Functions v4
- Plan: Consumption/Premium
- Triggers: HTTP only
Dependencies
- Gmi.DataAccess
- Gmi.Services
- Gmi.ClassLibrary
- Entity Framework Core
Security & Authentication
Authentication Methods
- Azure AD integration
- JWT token validation
- Role-based access
Security Features
- HTTPS enforcement
- Input validation
- Data sanitization
Deployment
- Azure DevOps CI/CD
- Staging slots
- Blue-green deployment
- Automated testing
Monitoring
- Application Insights
- Performance metrics
- Error tracking
- Health checks
Performance
- Cold start optimization
- Connection pooling
- Async operations
- Caching strategies
- Auto-scaling