Skip to main content

Tenant Subscription Sweep Internal

1 API call in this section.

Run Tenant Subscription Sweep (Internal)​

Billing & Subscriptions / Tenant Subscription Sweep Internal
POST/tenant-subscription-sweep

Runs the tenant-subscription sweep

recomputes eligible tenant statuses and sends applicable lifecycle, due-reminder, and suspension notices. No request body fields are consumed. When the subscription model is disabled, the request succeeds with skipped: true and zero counters.

Internal backend/cron only. Send apikey: {{supabase_secret_key}} with the default managed Supabase secret key (SUPABASE_SECRET_KEYS.default). Never put this value in a frontend or mobile application. Missing, invalid, publishable, legacy anon, and legacy service-role bearer credentials return HTTP 401 before work is dispatched. Authorization: Bearer ... alone is not accepted. Frontend handoff: none; application clients must not call this internal endpoint.

Headers

ParameterTypeDescription
Content-Typestring

Example: application/json

apikeystring

Default managed Supabase secret key; backend only.

Example: {{supabase_secret_key}}

Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/tenant-subscription-sweep" \2  --header "Content-Type: application/json" \3  --header "apikey: ${SUPABASE_SECRET_KEY}" \4  --data-raw '{}'

Internal backend endpoint. Run from a trusted server; keep backend secret keys out of the browser.

Response examples

200OK
Response body
json
1{2  "success": true,3  "processed": 0,4  "warnings": 0,5  "suspensions": 0,6  "activated": 0,7  "resumed": 0,8  "due_reminders": 0,9  "suspension_notices": 010}