/api/admin/organizations/enforce-mfa-requirementsAuthenticatedEnforce organization MFA requirements (scheduled job)
Enforces the multi-factor authentication requirements of organizations: removes every member whose grace period ended while they still have no verified MFA factor (recording each removal, which the daily admin report lists), starts a grace period for members without MFA who have none yet (and emails them), deletes grace periods of members who enabled MFA or left, and retries the requirement emails that failed. Members past their grace period already lose the use of their membership when it ends; this job removes the membership itself. This is the scheduled job's entry point (a daily Vercel cron, or a host crontab entry for the deploy/ stack): it only accepts the deployment's cron secret, never a session. Administrators run it by hand with POST.
get_api_admin_organizations_enforce_mfa_requirementsAdministrationAuthentication & permissionsAuthenticated
Any authenticated user
- Accepted credentials
- Cron secret (Bearer)
Authorization: Bearer <token>
- Cron secret (Bearer)
- Who may call
- Any authenticated user
- Notes
- Only the deployment's cron secret (
Authorization: Bearer <CRON_SECRET>) is accepted; administrator sessions and access tokens are refused (use POST). Always refused whileCRON_SECRETis unset.
Responses
| Property | Type | Description |
|---|---|---|
| success* | true | |
| message* | string | |
| data* | object | |
| removed_members* | object[] | Members removed from their organization by this run (also recorded for the daily admin report) |
| organization_id* | string | minLength: 4maxLength: 32pattern: ^[a-z][a-z0-9_-]+$ |
| uid* | string (uuid) | |
| role* | string | Membership role in the organization: |
| grace_period_reason* | "requirement_enabled" | "mfa_removed" | Why the grace period started: |
| grace_period_ended_at* | number | Unix epoch milliseconds the member's grace period ended |
| grace_periods_started* | integer | |
| grace_periods_cleared* | integer | |
| notifications_sent* | integer | |
| notifications_failed* | integer |
Example request
curl -X GET 'https://auth.schemavaults.com/api/admin/organizations/enforce-mfa-requirements' \
-H 'Authorization: Bearer <access_token>'