---
title: "Send monthly-usage-summary email to paid orgs for previous month"
method: POST
path: "/internal/cron/monthly-usage-digest"
tags: ["internal"]
---

# Send monthly-usage-summary email to paid orgs for previous month

`POST /internal/cron/monthly-usage-digest`

Aggregate previous month `daily_usage` per paid org, send digest.

Fires from `pg_cron` at 13:00 UTC on the 1st of each month (see
0025_monthly_usage_digest_cron.sql). Audience per PMO Q4 = basic +
pro only; free-tier orgs excluded (low signal + template has
tier_quota_monthly that free tier barely touches).

Month boundaries: previous-month (first day → last day inclusive).
E.g. firing on 2026-05-01 aggregates 2026-04-01 → 2026-04-30. The
0-usage case still sends (`calls_used=0`) — the digest is the only
recurring touchpoint for quiet orgs; silent skip would be invisible.

Idempotency: cron firing once per month + Resend message_id in log
is sufficient dedup for V1. org_email_log backing lands in B-19-d
and will cover the "cron fires twice on the 1st due to DST or
manual trigger" case. Known limitation for launch.

## 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/7885a141754c/schema)
