Auth API reference

Auth API · End-Users

post/v1/apps/{app_id}/unverified-account-expiry/runAuth

Run 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*string

Id of the app.

Headers

Idempotency-Keystring

Stripe-style idempotency key; a retry with the same key returns the first run's result. 24h TTL.

Request body

dry_runboolean

Count 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_minutesnumber

TEST 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*boolean

True when this was a preview: nothing was deleted.

Example: false

ttl_days*number

The window the run used, in days.

Example: 7

user_ids*array

Accounts deleted (or, on a dry run, that would be deleted).

truncated*boolean

True 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
}

Response

{
  "dry_run": false,
  "ttl_days": 7,
  "user_ids": [
    "00000000-0000-0000-0000-000000000000"
  ],
  "truncated": false
}