> 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 component

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 selection: one `manager.install` Site Action per accepted website.

Body parameters:

* `type` (string, required): `plugin` | `theme`.
* `from` (string, required): only `repository` is accepted on this surface (`url`/`upload` answer 422).
* `value` (string, max 200, required): the wordpress.org slug, as in its URL (e.g. `woocommerce`).
* `sites` (integer array, required): exact ids, 1 to 200.
* `activate` (boolean `1`/`0`, default `0`): activate right after installing.
* `overwrite` (boolean `1`/`0`, default `0`): reinstall over an existing copy instead of skipping the website.
* `clean_cache` (boolean `1`/`0`, default `0`): clear each website's cache after installing.

202 with the created `site-actions` documents under `data` and `meta.skipped`: one entry per website the preflight refused, `{site_id, site_name, site_action_id, reason_code, message}`. `site_action_id` is always null in these entries; `site_name` is null for `PERMISSION_DENIED`. A disconnected website answers `reason_code: SITE_UNREACHABLE`. `data: []` is still a 202.

* **422**: `sites` missing/empty/over 200/unknown id; `from` other than `repository`; `value` not a slug wordpress.org resolves.
* **403**: a read-only token.

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

## 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 object, optional)
  - `attributes` (object, optional)
    - `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)
  - `id` (string, optional)
  - `links` (object, optional)
    - `self` (string, optional)
  - `type` (string, optional)
- `jsonapi` (object, optional)
  - `version` (string, optional)
- `meta` (object, optional)
  - `skipped` (list of object, optional)
    - `message` (string, optional)
    - `reason_code` (string, optional)
    - `site_action_id` (any, optional, nullable)
    - `site_id` (double, optional)
    - `site_name` (string, optional)

## Examples

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

**Request**

```json
undefined
```

**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 site is not connected; connect it before installing a plugin or theme.",
        "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 component

**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 site is not connected; connect it before installing a plugin or theme.",
        "reason_code": "SITE_UNREACHABLE",
        "site_action_id": null,
        "site_id": 13,
        "site_name": "Blog"
      }
    ]
  }
}
```

**SDK Code**

```python Install component
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 component
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 component
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 component
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 component
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 component
<?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 component
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 component
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()
```