| Location | Name | Required | Meaning |
|---|---|---|---|
| query | status | Conditional / optional | {"type":"string","enum":["pending","restored","purged"],"default":"pending"} |
| query | cursor | Conditional / optional | {"type":"string","maxLength":2000} |
| query | limit | Conditional / optional | {"type":"integer","minimum":1,"maximum":100,"default":50} |
{error:{code,message}} for CloudError failures, attaches Request-Id, and disables caching. Handle 401 by signing in; show role refusal for 403 forbidden, reauthenticate only for step_up_required, and collect a reason for 400 reason_required. A CSRF failure needs a current page/session token, not blind retries. Operation-specific 404/409/413/422/502/503 errors retain their status. Honor Retry-After on 429./** GET /api/admin/deletions?status=pending|restored|purged&cursor&limit: scheduled deletions (ADMIN.md §7). */
export const GET = adminRoute("accounts.read", async (request) => {
const params = new URL(request.url).searchParams;
const parsed = query.safeParse({ status: params.get("status") ?? undefined, cursor: params.get("cursor") ?? undefined, limit: params.get("limit") ?? undefined });
if (!parsed.success) throw invalid("status must be pending, restored or purged; limit 1–100.");
return adminJson(await listHolds(parsed.data.status, parsed.data.cursor, parsed.data.limit));
});