Expire stale pending AI suggestions (POST)
POST
/cron/expire-ai-suggestions
const url = 'https://example.com/api/cron/expire-ai-suggestions';const options = {method: 'POST'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/cron/expire-ai-suggestionsScheduled daily by supabase/migrations/20260803000004_pgcron_expire_ai_suggestions.sql. Protected by CRON_SECRET via the x-cron-secret header only.
Responses
Section titled “ Responses ”TTL sweep result
Media type application/json
object
ok
required
False when the sweep hit a database error; error then carries the message.
boolean
expired
required
Rows actually flipped from pending to expired by this run.
integer
truncated
required
True when a full page was selected — more stale suggestions remain; re-run.
boolean
error
Database error message; present only when ok is false.
string
Missing or invalid CRON_SECRET