Configuration & preferences
Change runtime settings such as password policies, verification channels and rate limits with the config module, and bucket languages with preferences.
Most of Spica is configured with startup options. Settings that you may want to change while the instance runs live in two modules: config and preferences.

Config module
Each config module has a JSON schema. List them with GET /config/schema:
| Module | Settings |
|---|---|
user | Password policy, verification channels, password reset, passwordless login, verification attempts and rate limits. |
identity | Password policy. |
Read and update
| Endpoint | Action | Purpose |
|---|---|---|
GET /config | config:index | Every stored module configuration. |
GET /config/schema | Schemas of all modules. | |
GET /config/:module | config:show | One module. Returns 404 until it has been set once. |
PUT /config/:module | config:update | Replace the module's settings. |
The body of PUT is the settings object itself, and it replaces what was stored before:
curl -X PUT https://api.example.com/api/config/user \
-H "Authorization: IDENTITY <token>" -H "Content-Type: application/json" \
-d '{
"password": {"minLength": 10, "minNumber": 1},
"providerVerificationConfig": [{"provider": "email", "strategy": "Otp"}],
"resetPasswordProvider": [{"provider": "email", "strategy": "Otp"}],
"passwordlessLogin": {"passwordlessLoginProvider": [{"provider": "email", "strategy": "MagicLink"}]},
"verificationProcessMaxAttempt": 5,
"rateLimits": {"login": {"limit": 10, "ttl": 60}}
}'{"_id": "6b0b1ad7988a814684c8fec6", "module": "user", "options": {"password": {"minLength": 10, "minNumber": 1}}}user settings
| Setting | Description |
|---|---|
password | minLength, minLowercase, minUppercase, minNumber, minSpecialCharacter. |
providerVerificationConfig | Channels users can verify: [{provider: "email" or "phone", strategy: "Otp" or "MagicLink"}]. |
resetPasswordProvider | Channels allowed for password reset. |
passwordlessLogin.passwordlessLoginProvider | Channels allowed for passwordless login. |
verificationProcessMaxAttempt | Attempts allowed for a verification process. |
rateLimits | login, providerVerification, forgotPassword, refreshToken, createUser, each {limit, ttl} with ttl in seconds. |
See Users and Password & login security for how these are used.
Preferences
Preferences are smaller, scoped settings. The bucket scope holds the languages of translated properties:
curl https://api.example.com/api/preference/bucket -H "Authorization: IDENTITY <token>"{"scope": "bucket", "language": {"available": {"tr_TR": "Turkish", "en_US": "English"}, "default": "en_US"}}Change them with PUT /preference/bucket. The actions are preference:show and preference:update, with the scope as the resource.
curl -X PUT https://api.example.com/api/preference/bucket \
-H "Authorization: IDENTITY <token>" -H "Content-Type: application/json" \
-d '{"scope": "bucket", "language": {"available": {"en_US": "English", "de_DE": "German"}, "default": "en_US"}}'