Switch Patch & Protect for websites
Switches Patch & Protect on or off for the websites you list in sites. Use it to protect a group of websites, or to remove the protection from them.
Every protected website is billed. The add-on is metered per website and per month, with no websites included in the plan, so enabling it here adds to the organization’s invoice. Without the add-on subscribed the call is refused and the user enables it from the Modular DS dashboard, after which the same request goes through: an integration never buys it.
Switching on installs the security plugin on WordPress; switching off removes it and leaves the website unprotected. Both take time: It creates one site action per website that passes the checks. The work finishes later: see Writes and asynchronous operations. Follow the site actions with “List site actions”. Websites that cannot be processed are reported in meta.skipped, each with a reason_code and a message, and do not fail the call. A website is skipped when it is not connected (SITE_UNREACHABLE), when it is being restored or already has a switch running (CONFLICT), or when it is already in the state you asked for (ALREADY_APPLIED). Ids outside your reach come back as PERMISSION_DENIED (with a null site_name) instead of being dropped silently.
Body
sites(array of integers, required): ids of the websites to act on, 1 to 50.status(enabledordisabled, required): the state to set.
Errors
- 409: the organization has no Patch & Protect subscription. The message reads “This organization has no Patch & Protect subscription. Enable the add-on from the Modular DS dashboard first.”
Authentication
Personal access token created in the Modular DS dashboard; read-only tokens can only call GET endpoints.
Request
Response
202 - One website switched on, one skipped
