Update mature-content settings
PATCH /admin/system/mature-content
Sets whether the instance allows mature content.
You need system.config.write or system.admin for the whole install; read permission isn’t enough, and a permission held only for a team doesn’t count. A body that can’t be decoded gets a plain-text 400, even when you aren’t signed in. Otherwise signed-out callers get 401 and callers without the permission 403.
Always send allowed. The schema marks it required, but the server currently reads {}, a JSON null body or a null allowed as false, so those bodies turn mature content off rather than leaving the setting alone. An empty body, malformed JSON or a wrong field type gets the 400.
This saves only the instance setting. It doesn’t clear existing asset or post flags, remove content or reset anyone’s opt-in. An item’s signed-in owner and anyone with system.admin stay exempt from the mature-content check, and the separate access rules still apply.
The viewer check reads this setting straight from the database, with no configuration cache, and keeps its answer for the rest of the request, so a request already in progress can keep the earlier answer. Creating or updating an asset with mature: true also reads the setting and gets a 400 when mature content isn’t allowed. This setting never blocks clearing the flag, though the endpoint’s usual permission and validation checks still apply. A settings change that races an asset write isn’t atomic with it.
The response echoes this request’s value. Auditing is attempted after the save and isn’t guaranteed. There’s no version check, so concurrent updates can overwrite each other, and the response isn’t a fresh read of the final setting.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”The instance-wide mature-content setting. It controls the instance’s part of the shared mature-content check and leaves saved flags and account preferences as they are.
object
True when the instance allows mature content, and the default until the setting is saved. Ordinary viewers must also be signed in and opted in. An item’s signed-in owner and anyone with system.admin are exempt from this check; separate access rules still apply. On writes, always send this field: omitting it or sending null currently counts as false, even though the schema marks it required.
Responses
Section titled “ Responses ”The mature-content value this request saved.
The instance-wide mature-content setting. It controls the instance’s part of the shared mature-content check and leaves saved flags and account preferences as they are.
object
True when the instance allows mature content, and the default until the setting is saved. Ordinary viewers must also be signed in and opted in. An item’s signed-in owner and anyone with system.admin are exempt from this check; separate access rules still apply. On writes, always send this field: omitting it or sending null currently counts as false, even though the schema marks it required.
Malformed request
object
Human-readable error summary
Example
the request could not be completedAuthentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}Authenticated but missing required capabilities
object
Human-readable error summary
Example
the request could not be completed