List daily billing sweep runs (internal)

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://docs.usehearsay.com/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "integrations MCP server": {
    "url": "https://docs.usehearsay.com/mcp"
  }
}

Close
GET /admin/billing/sweep-runs

Lists the recorded daily billing sweep runs, nightly and admin-triggered, most recent first, with timings, status, counts and failed groups. Page with limit (default 50) and skip. Super admin only.

Query parameters

  • limit number
  • skip number

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • data array[object] Required
      Hide data attributes Show data attributes object
      • id string Required
      • startedAt string(date-time) Required
      • finishedAt string(date-time) Required
      • durationMs number Required
      • status string Required

        Values are succeeded or failed.

      • manual boolean Required

        true for an admin-triggered run, false for the nightly cron

      • organizationId string | null Required

        Set when the run was scoped to one org

      • invoicesCreated number Required
      • totalCents number Required
      • groupsFailed number Required
      • stuckReset number Required
      • baseFeeRowsCreated number Required
      • recurringAddonRowsCreated number Required
      • failedGroups array[string] Required

        Which group failed and why — the detail behind groupsFailed

      • error string | null Required

        Set only when the sweep itself threw

    • statusCode number Required
    • timestamp string(date-time) Required
GET /admin/billing/sweep-runs
curl \
 --request GET 'http://api.example.com/admin/billing/sweep-runs' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "data": [
    {
      "id": "65a1b2c3d4e5f6a7b8c9d0f0",
      "startedAt": "2026-01-15T10:15:00.000Z",
      "finishedAt": "2026-01-15T10:20:00.000Z",
      "durationMs": 300000,
      "status": "succeeded",
      "manual": false,
      "organizationId": "string",
      "invoicesCreated": 3,
      "totalCents": 45000,
      "groupsFailed": 0,
      "stuckReset": 0,
      "baseFeeRowsCreated": 2,
      "recurringAddonRowsCreated": 1,
      "failedGroups": [
        "string"
      ],
      "error": "string"
    }
  ],
  "statusCode": 200,
  "timestamp": "2026-01-15T10:15:00.000Z"
}