Tenant Subscription Sweep Internal
1 API call in this section.
Run Tenant Subscription Sweep (Internal)
/tenant-subscription-sweepRuns 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
| Parameter | Type | Description |
|---|---|---|
Content-Type | string | Example: |
apikey | string | Default managed Supabase secret key; backend only. Example: |
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
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}