Platforms API
Manage authentication platforms (OAuth providers and email). Control enabled status, 2FA requirements, and registration per platform.
GraphQL
Queries
List All Platforms
query {
platforms {
id name slug isOauth enabled
twoFactorSupported twoFactorRequired registrationEnabled
createdAt updatedAt
}
}
List Enabled Platforms
query { enabledPlatforms { id name slug isOauth enabled twoFactorSupported twoFactorRequired registrationEnabled } }
Get Platform
query { platform(idOrSlug: "email") { id name slug enabled registrationEnabled } }
Mutations
All mutations require settings:write permission.
Update Platform Settings (combined)
mutation {
updatePlatformSettings(
idOrSlug: "email"
input: { enabled: true, twoFactorRequired: false, registrationEnabled: true }
) { id name enabled twoFactorRequired registrationEnabled }
}
Individual Setters
mutation { setPlatformEnabled(idOrSlug: "email", enabled: true) { id enabled } }
mutation { setPlatformTwoFactorRequired(idOrSlug: "email", required: true) { id twoFactorRequired } }
mutation { setPlatformRegistrationEnabled(idOrSlug: "email", enabled: false) { id registrationEnabled } }
Legacy Enable/Disable
mutation { enablePlatform(idOrSlug: "email") { success message } }
mutation { disablePlatform(idOrSlug: "email") { success message } }
REST API
Endpoints
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /v1/platforms | No | List all platforms |
| GET | /v1/platforms/enabled | No | List enabled platforms |
| GET | /v1/platforms/{id_or_slug} | No | Get platform by ID or slug |
| PATCH | /v1/platforms/{id_or_slug}/enabled | settings:write | Set enabled status |
| PATCH | /v1/platforms/{id_or_slug}/settings | settings:write | Update multiple settings |
Update Platform Settings
curl -X PATCH http://localhost:3000/v1/platforms/email/settings \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"enabled": true, "twoFactorRequired": false, "registrationEnabled": true}'
Audit Events
All setting changes log platform_setting_updated events with:
setting: field name (enabled,two_factor_required,registration_enabled)old_value/new_value: previous and new valuesplatform_slug: the platform identifier
Field Reference
| Field | Type | Description |
|---|---|---|
enabled | bool | Master switch - disables all login/registration |
twoFactorSupported | bool | Whether 2FA setup is available (read-only) |
twoFactorRequired | bool | Whether 2FA is mandatory for this platform |
registrationEnabled | bool | Whether new user registration is allowed (existing users can still sign in) |