Skip to main content

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

MethodPathAuthDescription
GET/v1/platformsNoList all platforms
GET/v1/platforms/enabledNoList enabled platforms
GET/v1/platforms/{id_or_slug}NoGet platform by ID or slug
PATCH/v1/platforms/{id_or_slug}/enabledsettings:writeSet enabled status
PATCH/v1/platforms/{id_or_slug}/settingssettings:writeUpdate 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 values
  • platform_slug: the platform identifier

Field Reference

FieldTypeDescription
enabledboolMaster switch - disables all login/registration
twoFactorSupportedboolWhether 2FA setup is available (read-only)
twoFactorRequiredboolWhether 2FA is mandatory for this platform
registrationEnabledboolWhether new user registration is allowed (existing users can still sign in)