Usage Tracking
Track your MoMail usage to optimize costs, predict needs, and ensure you stay within plan limits.
Real-Time Usage Dashboard
Section titled “Real-Time Usage Dashboard”Access your usage dashboard at app.momail.io/settings/usage
Dashboard Features
Section titled “Dashboard Features”- Current Period: Emails, searches, and storage for this billing cycle
- Usage Trends: Graphs showing usage over time
- Projections: Estimated usage by end of period
- Breakdown: Usage by domain, mailbox, and endpoint
API Usage Tracking
Section titled “API Usage Tracking”Get Current Usage
Section titled “Get Current Usage”GET /billing/usageResponse
Section titled “Response”{ "success": true, "data": { "emailsUsed": 4500, "emailsLimit": 10000, "searchesUsed": 890, "searchesLimit": 5000, "storageUsed": 256000000, "storageLimit": 50000000000, "periodStart": "2024-01-01T00:00:00.000Z", "periodEnd": "2024-02-01T00:00:00.000Z" }}Usage Breakdown
Section titled “Usage Breakdown”By Domain
Section titled “By Domain”See which domains receive the most emails:
curl https://api.momail.io/v1/billing/usage/domains \ -H "X-API-Key: your_key"{ "success": true, "data": [ { "domain": "company.com", "emailsReceived": 3200, "storageUsed": 180000000 }, { "domain": "personal.com", "emailsReceived": 1300, "storageUsed": 76000000 } ]}By Endpoint
Section titled “By Endpoint”Track API usage by endpoint:
{ "success": true, "data": { "endpoints": { "/search": 890, "/domains": 45, "/api-keys": 12, "/webhooks": 200 } }}By Time
Section titled “By Time”Get hourly or daily usage:
# Daily usage for the past 30 dayscurl "https://api.momail.io/v1/billing/usage/daily?days=30" \ -H "X-API-Key: your_key"{ "success": true, "data": [ { "date": "2024-01-15", "emails": 150, "searches": 30, "storageDelta": 5242880 }, { "date": "2024-01-14", "emails": 142, "searches": 28, "storageDelta": 4194304 } ]}Usage Alerts
Section titled “Usage Alerts”Configure alerts to notify you when approaching limits.
Setting Up Alerts
Section titled “Setting Up Alerts”In your dashboard:
- Go to Settings > Notifications
- Click Add Alert
- Configure conditions:
- Resource type (emails, searches, storage)
- Threshold percentage (e.g., 80%)
- Notification method (email, webhook)
Alert Types
Section titled “Alert Types”| Alert | Trigger | Notification |
|---|---|---|
| Warning | 80% of limit | Email + Dashboard |
| Critical | 95% of limit | Email + SMS + Webhook |
| Exceeded | 100% of limit | Immediate email + API error |
Webhook Alert Payload
Section titled “Webhook Alert Payload”{ "event": "usage.warning", "timestamp": "2024-01-15T10:30:00.000Z", "data": { "accountId": "acc_abc123", "type": "email_quota", "used": 8000, "limit": 10000, "percentage": 80, "projectedExhaustion": "2024-01-25T00:00:00.000Z" }}Usage Reports
Section titled “Usage Reports”Monthly Reports
Section titled “Monthly Reports”Automatically receive monthly usage reports via email:
- Total emails processed
- Peak usage days
- Most active mailboxes
- API endpoint breakdown
- Cost analysis (for paid plans)
Export Usage Data
Section titled “Export Usage Data”Export your usage data for external analysis:
# Export as CSVcurl "https://api.momail.io/v1/billing/usage/export?format=csv&start=2024-01-01&end=2024-01-31" \ -H "X-API-Key: your_key" \ --output usage_report.csvCode Examples
Section titled “Code Examples”Monitor Usage in Your Application
Section titled “Monitor Usage in Your Application”async function checkUsage() { const response = await fetch('https://api.momail.io/v1/billing/usage', { headers: { 'X-API-Key': process.env.MOMAIL_API_KEY } });
const { data } = await response.json();
const emailPercentage = (data.emailsUsed / data.emailsLimit) * 100; const searchPercentage = (data.searchesUsed / data.searchesLimit) * 100;
return { emails: { used: data.emailsUsed, limit: data.emailsLimit, percentage: emailPercentage, status: emailPercentage > 90 ? 'critical' : emailPercentage > 75 ? 'warning' : 'ok' }, searches: { used: data.searchesUsed, limit: data.searchesLimit, percentage: searchPercentage, status: searchPercentage > 90 ? 'critical' : searchPercentage > 75 ? 'warning' : 'ok' } };}
// Check usage dailysetInterval(checkUsage, 24 * 60 * 60 * 1000);Usage Dashboard Widget
Section titled “Usage Dashboard Widget”import requestsfrom flask import Flask, jsonify
app = Flask(__name__)
@app.route('/api/usage')def get_usage_widget(): response = requests.get( 'https://api.momail.io/v1/billing/usage', headers={'X-API-Key': os.environ['MOMAIL_API_KEY']} )
data = response.json()['data']
return jsonify({ 'emails': { 'used': data['emailsUsed'], 'limit': data['emailsLimit'], 'percentage': round((data['emailsUsed'] / data['emailsLimit']) * 100, 1) }, 'storage': { 'used_gb': round(data['storageUsed'] / (1024**3), 2), 'limit_gb': round(data['storageLimit'] / (1024**3), 2) } })Predicting Usage
Section titled “Predicting Usage”Projection Algorithm
Section titled “Projection Algorithm”MoMail calculates projected usage based on your current rate:
projected_emails = current_emails + (daily_average * days_remaining)Usage Forecasting
Section titled “Usage Forecasting”# Get 30-day projectioncurl "https://api.momail.io/v1/billing/usage/forecast?days=30" \ -H "X-API-Key: your_key"{ "success": true, "data": { "projectedEmails": 8500, "projectedSearches": 4200, "projectedStorage": 350000000, "willExceedLimit": false, "recommendation": "Current usage is within expected limits" }}Best Practices
Section titled “Best Practices”- Monitor weekly: Check usage trends regularly
- Set alerts at 75%: Get early warning before limits
- Review monthly: Analyze patterns to optimize costs
- Export data: Keep historical records for analysis
- Use webhooks: Automate responses to usage events
Questions?
Section titled “Questions?”For questions about usage tracking:
- Email support@momail.io
- Check your dashboard
- Review billing documentation