10 KiB
Administrative settings type registry
write_settings_patch uses the exact closed projected types embedded in its input schema. This table binds each section to the upstream body type. A patch is merged into an internally loaded full section, never posted as a partial upstream replacement. All nested object patches merge by property; arrays replace the complete array and are validated as complete elements against the saved section/type. Omitted fields preserve their values; null is rejected. An empty nested object is a no-op and must not be treated as deletion. Reject patches that make no effective change.
revision is a server-issued opaque digest bound to principal, instance and section. Recheck immediately before save, serialize local saves and reject stale revisions. RAML has no ETag or compare-and-swap guarantee, so external writers can still race; report this limit. Any array element needing hidden fields or identity values must be matched unambiguously to a saved element by a documented safe key; if impossible, reject that array edit. Never guess indexes after concurrent changes.
notificationTemplates patch elements use the notification_type/agent string labels. The merge layer translates each label to its integer (Phase 04 T3/T4 maps) and the notification_type key to notificationType before merging; reads emit the labels with the raw *_code twins as fallback per Phase 04.
These types deliberately exclude credentials, connection destinations, internal persistence IDs, migration flags and script/service execution configuration. Such changes remain manual. Enums retain RAML numeric values because labels are not supplied. Fields like enabled, schedules, HTML/CSS, templates, default roles and automatic deletion can still have major effects; administrator authorization is required, and job/configuration consequences must be described.
Read-only sections
| Section | GET path |
|---|---|
base_url |
/api/v1/Settings/baseurl |
client_id |
/api/v1/Settings/clientid |
default_language |
/api/v1/Settings/defaultlanguage |
themes |
/api/v1/Settings/themes |
lidarrenabled |
/api/v1/Settings/lidarrenabled |
issuesenabled |
/api/v1/Settings/issuesenabled |
voteenabled |
/api/v1/Settings/voteenabled |
notifications.email.enabled |
/api/v1/Settings/notifications/email/enabled |
Fields excluded from patches
The following exact field names are excluded recursively wherever encountered; key in a selected-library record is an identifier, not automatically a secret. Read projections also exclude private values and use an allowlist, not merely this name list. In read projections (read_settings), a scoped exemption allows server identity fields (id, serverId, machineIdentifier) to be projected when they are direct leaves of a server record under /servers/<digits> (e.g. /servers/0/id, /servers/0/serverId, /servers/0/machineIdentifier), making saved servers discoverable for read_integration media_server and plex_libraries. In patches (write_settings_patch), these fields remain strictly excluded and unpatchable.
accessToken, accountSid, administratorId, apiKey, applicationToken, applicationUrl, authToken, authorizationHeader, baseUrl, botApi, customDonationUrl, disableCertificateChecking, disableTLS, favicon, hasMigratedOldTvDbData, host, iconUrl, id, installId, ip, logo, machineIdentifier, password, plexAuthToken, port, processName, scriptLocation, serverHostname, serverId, set, ssl, subDir, useScript, userToken, webhookUrl, windowsService, windowsServiceName, wizard.
notifications.mobile may have only template fields left after projection. Notification tester bodies differ from settings UI view models: choose the tester body type from the operation ledger and construct it internally; do not forward a settings view model blindly. Profiles for testers without a complete saved-settings route (for example mobile) must be provisioned outside the model.
Feature writes
action=feature sends {name, enabled} to /api/v2/Features/enable when true and /disable when false. The feature name must have been returned by the configured instance; do not invent a universal feature enum. Feature writes are not an arbitrary settings section.