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

# Activate or deactivate a component on websites

PATCH https://api.modulards.com/api/public/v1/components/{component}/manage
Content-Type: application/json

Activates or deactivates one plugin or theme on the websites you list in `sites`. The action is explicit, never a flip.

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. Activating a theme replaces the active theme of each website, and the answer says so in a warning. A website is skipped when it is not connected, does not have the component, hides its update notice, already has it in the requested state, or already has too many pending or running actions. WordPress itself cannot be activated or deactivated, a theme cannot be deactivated (activate another theme instead), and the Modular Connector plugin is never deactivated.

**Body**
- `sites` (array of integers, required): ids of the websites to act on, 1 to 50.
- `action` (`activate` or `deactivate`, required): what to do with the component.

**Errors**
- **404**: the component is not installed on any of your websites.
- **422**: `sites` is invalid or `action` is not `activate` or `deactivate`.

Reference: https://api.docs.modulards.com/modular-ds-public-api/updater/components/activate-or-deactivate-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

### Path parameters

- `component` (string, required)

### Body (application/json)

This endpoint expects an object.

- `action` (string, optional)
- `sites` (list of double, optional)

## Response

### 202

202 Accepted - one deactivation launched, one website skipped

- `data` (list of ApiPublicV1ComponentsComponentManagePatchResponsesContentApplicationJsonSchemaDataItems, optional)
- `jsonapi` (ApiPublicV1ComponentsComponentManagePatchResponsesContentApplicationJsonSchemaJsonapi, optional)
- `meta` (ApiPublicV1ComponentsComponentManagePatchResponsesContentApplicationJsonSchemaMeta, optional)

## Types

### ApiPublicV1ComponentsComponentManagePatchResponsesContentApplicationJsonSchemaDataItems

- `attributes` (ApiPublicV1ComponentsComponentManagePatchResponsesContentApplicationJsonSchemaDataItemsAttributes, optional)
- `id` (string, optional)
- `links` (ApiPublicV1ComponentsComponentManagePatchResponsesContentApplicationJsonSchemaDataItemsLinks, optional)
- `type` (string, optional)

### ApiPublicV1ComponentsComponentManagePatchResponsesContentApplicationJsonSchemaJsonapi

- `version` (string, optional)

### ApiPublicV1ComponentsComponentManagePatchResponsesContentApplicationJsonSchemaMeta

- `skipped` (list of ApiPublicV1ComponentsComponentManagePatchResponsesContentApplicationJsonSchemaMetaSkippedItems, optional)
- `warnings` (list of string, optional) — Caveat about the request, for example that activating a theme replaces the active theme. Present only when there is one.

### ApiPublicV1ComponentsComponentManagePatchResponsesContentApplicationJsonSchemaDataItemsAttributes

- `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)

### ApiPublicV1ComponentsComponentManagePatchResponsesContentApplicationJsonSchemaDataItemsLinks

- `self` (string, optional)

### ApiPublicV1ComponentsComponentManagePatchResponsesContentApplicationJsonSchemaMetaSkippedItems

- `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 deactivation 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.deactivate",
        "updated_at": "2026-09-21T09:00:00.000000Z"
      },
      "id": "5012",
      "links": {
        "self": "{{base_url}}/api/public/v1/site-actions/5012"
      },
      "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 deactivation launched, one website skipped
import requests

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

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

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

print(response.json())
```

```javascript 202 Accepted - one deactivation launched, one website skipped
const url = 'https://api.modulards.com/api/public/v1/components/component/manage';
const options = {method: 'PATCH', 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 deactivation launched, one website skipped
package main

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

func main() {

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

	req, _ := http.NewRequest("PATCH", 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 deactivation launched, one website skipped
require 'uri'
require 'net/http'

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

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

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

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

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

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

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

$client = new \GuzzleHttp\Client();

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

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

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

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

```swift 202 Accepted - one deactivation 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/component/manage")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```

### Activate or deactivate a component on websites

**Request**

```json
{
  "action": "deactivate",
  "sites": [
    12
  ]
}
```

**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.deactivate",
        "updated_at": "2026-09-21T09:00:00.000000Z"
      },
      "id": "5012",
      "links": {
        "self": "{{base_url}}/api/public/v1/site-actions/5012"
      },
      "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 Activate or deactivate a component on websites
import requests

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

payload = {
    "action": "deactivate",
    "sites": [12]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Activate or deactivate a component on websites
const url = 'https://api.modulards.com/api/public/v1/components/component/manage';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"action":"deactivate","sites":[12]}'
};

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

```go Activate or deactivate a component on websites
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"action\": \"deactivate\",\n  \"sites\": [\n    12\n  ]\n}")

	req, _ := http.NewRequest("PATCH", 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 Activate or deactivate a component on websites
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"action\": \"deactivate\",\n  \"sites\": [\n    12\n  ]\n}"

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

```java Activate or deactivate a component on websites
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.modulards.com/api/public/v1/components/component/manage")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": \"deactivate\",\n  \"sites\": [\n    12\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.modulards.com/api/public/v1/components/component/manage', [
  'body' => '{
  "action": "deactivate",
  "sites": [
    12
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Activate or deactivate a component on websites
using RestSharp;

var client = new RestClient("https://api.modulards.com/api/public/v1/components/component/manage");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": \"deactivate\",\n  \"sites\": [\n    12\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Activate or deactivate a component on websites
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "action": "deactivate",
  "sites": [12]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/components/component/manage")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()
```