Schedule Maintenance Internal
1 API call in this section.
Run Schedule Maintenance (Internal)
/scheduler-maintenanceRegenerates restaurant availability windows. Optional body fields: location_id regenerates one location; otherwise menu_id regenerates one menu; an empty body runs full maintenance for active locations and published automatic menus. If both IDs are supplied, location_id takes precedence. Omit both IDs only when full maintenance is intended.
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: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
location_id | string | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/scheduler-maintenance" \2 --header "Content-Type: application/json" \3 --header "apikey: ${SUPABASE_SECRET_KEY}" \4 --data-raw '{5 "location_id": "{{restaurant_location_id}}"6}'Replace {{placeholders}} with your own values before sending.
Internal backend endpoint. Run from a trusted server; keep backend secret keys out of the browser.
Response examples
1{2 "success": true,3 "mode": "single_location"4}