Run the daily billing sweep now (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
POST /admin/billing/cron/daily-sweep

Runs the daily billing sweep (base fees, recurring add-ons, then invoicing of pending items) as of asOf or now, for every organization or only organizationId, records the run and returns its summary. Not available in production (403). Super admin only.

application/json

Body Required

  • asOf string

    ISO date the sweep bills for (default: now)

  • organizationId string

    Scope the sweep to one organization (default: all)

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • data object Required
      Hide data attributes Show data attributes object
      • invoicesCreated integer
      • totalCents integer
      • groupsFailed integer
      • failedGroups array[string]

        Which group failed and why; empty on a clean run.

      • stuckReset integer
      • baseFeeRowsCreated integer
      • recurringAddonRowsCreated integer
    • statusCode number Required
    • timestamp string(date-time) Required
POST /admin/billing/cron/daily-sweep
curl \
 --request POST 'http://api.example.com/admin/billing/cron/daily-sweep' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{
  "asOf": "string",
  "organizationId": "string"
}'
Request examples
{
  "asOf": "string",
  "organizationId": "string"
}
Response examples (200)
{
  "data": {
    "invoicesCreated": 3,
    "totalCents": 45000,
    "groupsFailed": 0,
    "failedGroups": [
      "string"
    ],
    "stuckReset": 0,
    "baseFeeRowsCreated": 2,
    "recurringAddonRowsCreated": 1
  },
  "statusCode": 200,
  "timestamp": "2026-01-15T10:15:00.000Z"
}