Admin API

Stats

const TOKEN = "hv_..."; // your API key
const headers = { Authorization: `Bearer ${TOKEN}` };

Record counts

GET /admin/stats
interface CollectionCount {
  collection: string;
  count: number;
}

interface Stats {
  total_records: number;
  collections: CollectionCount[];
}

const response = await fetch("http://127.0.0.1:3000/admin/stats", {
  headers,
});
const data: Stats = await response.json();

Response: 200 OK

{
  "total_records": 12345,
  "collections": [{ "collection": "xyz.statusphere.status", "count": 500 }]
}

On this page