---
title: "Daily sweep: send quota-80/quota-100 emails when MTD usage crosses thresholds"
method: POST
path: "/internal/cron/quota-warnings"
tags: ["internal"]
---

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

`POST /internal/cron/quota-warnings`

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. Period-scoped org_email_log keys make each 80% and
100% notice a once-per-billing-month action.

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.

## Headers

- `x-internal-secret` string, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/goldprice/apis/gold-api.md) · [All operations](https://skmtc.net/goldprice/apis/gold-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/goldprice/gold-api/revisions/5e6518098e6e/schema)
