---
title: "Recompute audit usage totals"
method: POST
path: "/internal/audit/usage/refresh"
tags: ["Internal"]
---

# Recompute audit usage totals

`POST /internal/audit/usage/refresh`

## Request

- Base URL: `https://api.openworklabs.com`
- URL: `https://api.openworklabs.com/internal/audit/usage/refresh`
- Auth: HTTP bearer

Recomputes every organization's audit usage totals (retained operations, events, logical bytes) from the stored rows and saves them with the time they were measured. The audit write path never updates these totals, so a scheduled caller runs this (daily by default). Answers 404 when DEN_MAINTENANCE_TOKEN is not configured.

## Response `200`

Totals recomputed.

- object
  - `organizations` integer, required
  - `refreshedAt` string, date-time, required

## Other responses

- `401`: Missing or wrong maintenance token.
- `404`: Maintenance endpoints are not configured on this deployment.
- `500`: The refresh failed; totals keep their previous values.

## Changes

- **2026-12-01** `9e0e1784e377`: 6 warning
  - added the new `invalid_request` enum value to the `error` response property for the response status `401`
  - added the new `invalid_request` enum value to the `error` response property for the response status `404`
  - added the new `invalid_request` enum value to the `error` response property for the response status `500`
  - added the new `prune_failed` enum value to the `error` response property for the response status `401`
  - …2 more
- **2026-11-07** `be73cfed1696`: 3 warning
  - added the new `reconcile_failed` enum value to the `error` response property for the response status `401`
  - added the new `reconcile_failed` enum value to the `error` response property for the response status `404`
  - added the new `reconcile_failed` enum value to the `error` response property for the response status `500`
- …earlier changes not shown

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/internal/audit/usage/refresh/post.md)

---

[API](https://skmtc.dev/openworklabs/apis/den-api.md) - [All operations](https://skmtc.dev/openworklabs/apis/den-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openworklabs/apis/den-api/revisions/84fb0f99fb95?raw)
