Install a component on websites
Installs a plugin or theme from the wordpress.org repository on the websites you list in sites, and can activate it right away. Find the slug with “Search components”.
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, is a multisite sub-site, already has the item (unless overwrite is true), is already installing it, or already has too many pending or running actions.
Body
type(pluginortheme, required): the kind of component to install.from(string, required): the source; onlyrepository(wordpress.org) is accepted.value(string, required): the wordpress.org slug, as it appears in the item’s URL, for examplewoocommerce; at most 200 characters.sites(array of integers, required): ids of the websites to act on, 1 to 50.activate(boolean, optional): activate the item after installing it. Defaultfalse.overwrite(boolean, optional): reinstall over an existing copy instead of skipping the website. Defaultfalse.clean_cache(boolean, optional): clear each website’s cache after installing. Defaultfalse.
Errors
- 422:
sitesis invalid,fromis notrepository, orvalueis not a slug wordpress.org knows for that type.
Authentication
Personal access token created in the Modular DS dashboard; read-only tokens can only call GET endpoints.
Request
Response
202 Accepted - one install launched, one website skipped
