> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.docs.modulards.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.modulards.com/_mcp/server.

# Install a component on websites

POST https://api.modulards.com/api/public/v1/components/install
Content-Type: application/json

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](https://api.docs.modulards.com/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` (`plugin` or `theme`, required): the kind of component to install.
- `from` (string, required): the source; only `repository` (wordpress.org) is accepted.
- `value` (string, required): the wordpress.org slug, as it appears in the item's URL, for example `woocommerce`; 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. Default `false`.
- `overwrite` (boolean, optional): reinstall over an existing copy instead of skipping the website. Default `false`.
- `clean_cache` (boolean, optional): clear each website's cache after installing. Default `false`.

**Errors**
- **422**: `sites` is invalid, `from` is not `repository`, or `value` is not a slug wordpress.org knows for that type.

Reference: https://api.docs.modulards.com/modular-ds-public-api/updater/components/install-a-component-on-websites

## Authentication

- `Authorization` header (bearer token, required) — Personal access token created in the Modular DS dashboard; read-only tokens can only call GET endpoints.

## Request

### Body (application/json)

This endpoint expects an object.

- `activate` (double, optional)
- `from` (string, optional)
- `sites` (list of double, optional)
- `type` (string, optional)
- `value` (string, optional)

## Response

### 202

202 Accepted - one install launched, one website skipped

- `data` (list of ApiPublicV1ComponentsInstallPostResponsesContentApplicationJsonSchemaDataItems, optional)
- `jsonapi` (ApiPublicV1ComponentsInstallPostResponsesContentApplicationJsonSchemaJsonapi, optional)
- `meta` (ApiPublicV1ComponentsInstallPostResponsesContentApplicationJsonSchemaMeta, optional)

## Types

### ApiPublicV1ComponentsInstallPostResponsesContentApplicationJsonSchemaDataItems

- `attributes` (ApiPublicV1ComponentsInstallPostResponsesContentApplicationJsonSchemaDataItemsAttributes, optional)
- `id` (string, optional)
- `links` (ApiPublicV1ComponentsInstallPostResponsesContentApplicationJsonSchemaDataItemsLinks, optional)
- `type` (string, optional)

### ApiPublicV1ComponentsInstallPostResponsesContentApplicationJsonSchemaJsonapi

- `version` (string, optional)

### ApiPublicV1ComponentsInstallPostResponsesContentApplicationJsonSchemaMeta

- `skipped` (list of ApiPublicV1ComponentsInstallPostResponsesContentApplicationJsonSchemaMetaSkippedItems, optional)

### ApiPublicV1ComponentsInstallPostResponsesContentApplicationJsonSchemaDataItemsAttributes

- `completed_at` (any, optional, nullable)
- `created_at` (string, optional)
- `created_by` (double, optional)
- `origin` (string, optional)
- `site_id` (double, optional)
- `started_at` (any, optional, nullable)
- `status` (string, optional)
- `type` (string, optional)
- `updated_at` (string, optional)

### ApiPublicV1ComponentsInstallPostResponsesContentApplicationJsonSchemaDataItemsLinks

- `self` (string, optional)

### ApiPublicV1ComponentsInstallPostResponsesContentApplicationJsonSchemaMetaSkippedItems

- `message` (string, optional) — Human-readable explanation of the reason.
- `reason_code` (string, optional) — Why the website was skipped, for example SITE_UNREACHABLE, UNSUPPORTED, NOT_FOUND, PERMISSION_DENIED, CONFLICT or ALREADY_APPLIED.
- `site_action_id` (any, optional, nullable) — Always null: no site action was created for a skipped website.
- `site_id` (integer, optional) — Id of the website that was skipped.
- `site_name` (string, optional, nullable) — Name of the website that was skipped; null when you have no access to it.

## Examples

### 202 Accepted - one install launched, one website skipped

**Response**

```json
{
  "data": [
    {
      "attributes": {
        "completed_at": null,
        "created_at": "2026-09-21T09:00:00.000000Z",
        "created_by": 501,
        "origin": "agent",
        "site_id": 12,
        "started_at": null,
        "status": "pending",
        "type": "manager.install",
        "updated_at": "2026-09-21T09:00:00.000000Z"
      },
      "id": "5010",
      "links": {
        "self": "{{base_url}}/api/public/v1/site-actions/5010"
      },
      "type": "site-actions"
    }
  ],
  "jsonapi": {
    "version": "1.1"
  },
  "meta": {
    "skipped": [
      {
        "message": "This website is not connected; connect it first.",
        "reason_code": "SITE_UNREACHABLE",
        "site_action_id": null,
        "site_id": 13,
        "site_name": "Blog"
      }
    ]
  }
}
```

**SDK Code**

```python 202 Accepted - one install launched, one website skipped
import requests

url = "https://api.modulards.com/api/public/v1/components/install"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript 202 Accepted - one install launched, one website skipped
const url = 'https://api.modulards.com/api/public/v1/components/install';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 202 Accepted - one install launched, one website skipped
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.modulards.com/api/public/v1/components/install"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 202 Accepted - one install launched, one website skipped
require 'uri'
require 'net/http'

url = URI("https://api.modulards.com/api/public/v1/components/install")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java 202 Accepted - one install launched, one website skipped
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.modulards.com/api/public/v1/components/install")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php 202 Accepted - one install launched, one website skipped
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.modulards.com/api/public/v1/components/install', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp 202 Accepted - one install launched, one website skipped
using RestSharp;

var client = new RestClient("https://api.modulards.com/api/public/v1/components/install");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift 202 Accepted - one install launched, one website skipped
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/components/install")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Install a component on websites

**Request**

```json
{
  "activate": 1,
  "from": "repository",
  "sites": [
    12,
    13
  ],
  "type": "plugin",
  "value": "woocommerce"
}
```

**Response**

```json
{
  "data": [
    {
      "attributes": {
        "completed_at": null,
        "created_at": "2026-09-21T09:00:00.000000Z",
        "created_by": 501,
        "origin": "agent",
        "site_id": 12,
        "started_at": null,
        "status": "pending",
        "type": "manager.install",
        "updated_at": "2026-09-21T09:00:00.000000Z"
      },
      "id": "5010",
      "links": {
        "self": "{{base_url}}/api/public/v1/site-actions/5010"
      },
      "type": "site-actions"
    }
  ],
  "jsonapi": {
    "version": "1.1"
  },
  "meta": {
    "skipped": [
      {
        "message": "This website is not connected; connect it first.",
        "reason_code": "SITE_UNREACHABLE",
        "site_action_id": null,
        "site_id": 13,
        "site_name": "Blog"
      }
    ]
  }
}
```

**SDK Code**

```python Install a component on websites
import requests

url = "https://api.modulards.com/api/public/v1/components/install"

payload = {
    "activate": 1,
    "from": "repository",
    "sites": [12, 13],
    "type": "plugin",
    "value": "woocommerce"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Install a component on websites
const url = 'https://api.modulards.com/api/public/v1/components/install';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"activate":1,"from":"repository","sites":[12,13],"type":"plugin","value":"woocommerce"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Install a component on websites
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.modulards.com/api/public/v1/components/install"

	payload := strings.NewReader("{\n  \"activate\": 1,\n  \"from\": \"repository\",\n  \"sites\": [\n    12,\n    13\n  ],\n  \"type\": \"plugin\",\n  \"value\": \"woocommerce\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Install a component on websites
require 'uri'
require 'net/http'

url = URI("https://api.modulards.com/api/public/v1/components/install")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"activate\": 1,\n  \"from\": \"repository\",\n  \"sites\": [\n    12,\n    13\n  ],\n  \"type\": \"plugin\",\n  \"value\": \"woocommerce\"\n}"

response = http.request(request)
puts response.read_body
```

```java Install a component on websites
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.modulards.com/api/public/v1/components/install")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"activate\": 1,\n  \"from\": \"repository\",\n  \"sites\": [\n    12,\n    13\n  ],\n  \"type\": \"plugin\",\n  \"value\": \"woocommerce\"\n}")
  .asString();
```

```php Install a component on websites
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.modulards.com/api/public/v1/components/install', [
  'body' => '{
  "activate": 1,
  "from": "repository",
  "sites": [
    12,
    13
  ],
  "type": "plugin",
  "value": "woocommerce"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Install a component on websites
using RestSharp;

var client = new RestClient("https://api.modulards.com/api/public/v1/components/install");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"activate\": 1,\n  \"from\": \"repository\",\n  \"sites\": [\n    12,\n    13\n  ],\n  \"type\": \"plugin\",\n  \"value\": \"woocommerce\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Install a component on websites
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "activate": 1,
  "from": "repository",
  "sites": [12, 13],
  "type": "plugin",
  "value": "woocommerce"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/components/install")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```