API Call Quota Monitor
Scheduled flow checks daily API request consumption per user via Power Platform for Admins V2. Flags users above 80% of their daily limit and sends an Outlook alert with a per-user usage summary.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
The API Call Quota Monitor is a scheduled Power Automate Cloud Flow that checks daily API request capacity consumption at the tenant level using the Power Platform for Admins V2 connector. When any capacity category exceeds a configurable threshold percentage, the flow logs an alert to a Dataverse audit table and sends a formatted HTML email to the designated administrator.
Use Case
Power Platform tenants have daily API request limits allocated per license type. When consumption approaches these limits, flows and apps can start failing silently. This flow provides proactive monitoring by polling tenant capacity data on a daily schedule, comparing consumption against a configurable threshold (default: 80%), sending a detailed HTML email alert with a per-category usage summary table, and logging each alert to Dataverse for historical trend analysis.
Target audience: IT Admins, Power Platform Center of Excellence teams.
The flow is ideal for teams that:
- Polling tenant capacity data on a daily schedule
- Comparing consumption against a configurable threshold (default: 80%)
- Sending a detailed HTML email alert with a per-category usage summary table
- Logging each alert to Dataverse for historical trend analysis
Flow Architecture
Recurrence Daily
RecurrenceRuns every day at 8:00 AM Eastern.
Init_varTargetEnvironment
Initialize variableLoads the target environment ID from flowlibs_TargetEnvironmentName. Runs in parallel with the other initialization steps.
Init_varAdminEmail
Initialize variableLoads the admin notification email from flowlibs_AdminEmail. Runs in parallel with the other initialization steps.
Init_varQuotaThreshold
Initialize variableLoads the alert threshold percentage from flowlibs_QuotaThresholdPercent and converts to integer. Runs in parallel with the other initialization steps.
Init_varAlertRows
Initialize variableInitializes an empty string to accumulate HTML table rows. Runs in parallel with the other initialization steps.
Init_varAlertCount
Initialize variableInitializes a counter for over-threshold categories. Runs in parallel with the other initialization steps.
Get Tenant Capacity Details
Power Platform for Admins V2 - GetTenantCapacityDetailsCalls Power Platform for Admins V2 GetTenantCapacityDetails to retrieve all capacity categories and their consumption.
Apply to Each Capacity Item
Apply to eachFor each capacity category returned: composes the usage percent as (consumed / allocated) x 100 (handling division by zero), then evaluates an If condition that compares the usage percent against the threshold variable. On true, appends an HTML table row with capacity type, consumed, allocated, and usage % (styled red) and increments the alert counter. On false, no action.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_AdminEmail | String | you@yourcompany.com | Recipient for quota alert emails. Set to your admin or Center of Excellence distribution list. |
| flowlibs_TargetEnvironmentName | String | <your-tenant-id> | Environment ID to monitor. Set to your tenant/environment GUID. |
| flowlibs_QuotaThresholdPercent | String | 80 | Percentage threshold that triggers alerts. Lower the value for earlier warnings; raise to reduce noise. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Power Platform for Admins V2 | shared_powerplatformadminv2 | GetTenantCapacityDetails (Get tenant capacity data) |
| Microsoft Dataverse | shared_commondataserviceforapps | AddNewRow (Log alerts to audit table (flowlibs_apiquotaalerts)) |
| Office 365 Outlook | shared_office365 | SendEmailV2 (Send alert emails) |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Set environment variable values for your tenant
- After importing the solution, set flowlibs_AdminEmail to your admin/COE distribution list, flowlibs_TargetEnvironmentName to your environment ID, and flowlibs_QuotaThresholdPercent to the desired threshold (e.g., 75 for earlier warnings).
- Authorize the three connections
- Authorize the Power Platform for Admins V2, Microsoft Dataverse, and Office 365 Outlook connections, then turn the flow on.
- Adjust the recurrence schedule
- Modify the Recurrence trigger to change how often capacity is polled (e.g., twice daily, hourly during business hours).
- Customize the email template
- Edit the Compose Email Body action to apply your branding, change the styled table, or include additional context.
- Send to multiple recipients
- Change flowlibs_AdminEmail to a distribution list to fan out alerts to multiple admins without editing the flow.
- Tune the alerting threshold
- Lower flowlibs_QuotaThresholdPercent for earlier warnings; raise it to reduce noise from routine variation.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Usage calculation
Computes the usage percentage for each capacity category and guards against division by zero.
EXPR.02Threshold comparison
Used in the If condition to determine whether a capacity category has crossed the alert threshold.
EXPR.03Email subject
Dynamic email subject summarizing how many categories exceeded the threshold.
EXPR.04Dataverse record name
Names the Dataverse audit row with the run date for easy historical tracking.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.