Get resource usage counts (admin)
GET
/api/admin/usage
const url = 'http://localhost:3000/api/admin/usage';const options = {method: 'GET', headers: {cookie: 'session=<session>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:3000/api/admin/usage \ --cookie session=<session>Counts rows across the plan-tracked resource tables (shared RESOURCE_TABLES list) and returns plan limit thresholds. Response is NOT wrapped in data.
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”Usage report
Media type application/json
object
total
required
Total countable resources across all tracked tables
integer
breakdown
required
Per-table row counts, keyed by table name
object
key
additional properties
integer
limits
required
Plan limit thresholds
object
Example generated
{ "total": 1, "breakdown": { "additionalProperty": 1 }, "limits": {}}Not authenticated
Media type application/json
object
error
required
string
Example
{ "error": "Not found"}Admin access required
Media type application/json
object
error
required
string
Example
{ "error": "Not found"}Failed to count resources
Media type application/json
object
error
required
string
Example
{ "error": "Not found"}