/v1/apps/{app_id}/unverified-account-expiry/runAuthRun the unverified-account expiry for this app now (or as a dry run).
Permanently deletes every account that qualifies under the app's `unverified_account_ttl_days`, exactly as the nightly job does: each deletion is audited as `auth.account.expired_unverified` and fires `user.deleted` with `reason: "unverified_expired"`. Use `dry_run: true` to preview.
Path parameters
app_id*stringId of the app.
Headers
Idempotency-KeystringStripe-style idempotency key; a retry with the same key returns the first run's result. 24h TTL.
Request body
dry_runbooleanCount and list the accounts that would be deleted without deleting any. Allowed while the setting is off, in which case it previews the default 7-day window.
min_age_minutesnumberTEST OVERRIDE, development apps only (`environment: development`; any other app answers 422). Replaces the day-based window with this many minutes, so an integration test can create an unverified account and expire it at once. Every other eligibility rule still applies.
Response · 200
dry_run*booleanTrue when this was a preview: nothing was deleted.
Example: false
ttl_days*numberThe window the run used, in days.
Example: 7
user_ids*arrayAccounts deleted (or, on a dry run, that would be deleted).
truncated*booleanTrue when the per-run ceiling stopped the run; the nightly job drains the rest.
Example: false
Example
Request
POST https://api.auth.productcraft.co/v1/apps/{app_id}/unverified-account-expiry/run
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"dry_run": false,
"min_age_minutes": 0
}import { Auth } from "@productcraft/auth";
// Admin routes read PRODUCTCRAFT_API_KEY; consumer routes need no key
const auth = new Auth();
const unverifiedAccountExpiryRun = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").unverifiedAccountExpiry.run({ dry_run: false });auth.admin.app(…).unverifiedAccountExpiry.run(params?, options?): Auth.UnverifiedAccountExpiryRun
Response
{
"dry_run": false,
"ttl_days": 7,
"user_ids": [
"00000000-0000-0000-0000-000000000000"
],
"truncated": false
}