---
title: "Snapshot yesterday's per-org request counts from Redis to daily_usage"
method: POST
path: "/internal/cron/daily-usage-snapshot"
tags: ["internal"]
---

# Snapshot yesterday's per-org request counts from Redis to daily_usage

`POST /internal/cron/daily-usage-snapshot`

Read Redis `quota_day:org:<uuid>:<YYYY-MM-DD>` counters and UPSERT
into `public.daily_usage` for yesterday (UTC). Runs 00:05 UTC daily
per 0015_daily_usage_pg_cron.sql. The Redis counters live 48h so
yesterday's bucket is still readable when this fires.

Anonymous (`ip:*`) buckets are intentionally skipped — they have no
foreign key target in `organizations`. Orgs with zero daily count
still get a row so the dashboard can distinguish "quiet day" from
"no data yet."

## 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)
