v2

latestOpenAPI 3.1.0Commercial API license2026-08-01592492.6 KB
internal

Daily sweep: send quota-80/quota-100 emails when MTD usage crosses thresholds

Daily cron scanning month-to-date daily_usage per active org.

Thresholds: quota-100 at ratio >= 1.0, quota-80 at ratio >= 0.8. Fires for ALL tiers including Pro (MVP parity with Stripe/Twilio/Anthropic — per-user mute deferred). Frequency caps (3d / 7d) enforced by send.py via org_email_log so a daily re-scan while still above threshold is a cheap no-op.

Month boundaries read from _mtd_bounds; daily_usage lag is ~1 day because daily-usage-snapshot writes yesterday's bucket at 00:05 UTC and this cron fires at 00:15 UTC. Today's usage will not appear until tomorrow's snapshot, which is fine — a customer crossing 80% on day N gets the email on day N+1 at worst.

post/internal/cron/quota-warnings

Headers

x-internal-secretstring nullable

Response

Successful Response

object required