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

# Update component visibility

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

Hides or shows one plugin, theme or WordPress core update notice on the selection: a direct `is_hidden` write on its site items, no Site Action and no connectivity check.

Body parameters:

* `sites` (integer array, required): exact ids, 1 to 200.
* `is_hidden` (boolean, required): `true` hides the update notice, `false` shows it again. The requested state, never a flip.

200 with a meta-only document: `meta.status` (`applied`|`skipped`), `meta.updated` (`{site_id, site_name, site_item_id}` per changed item) and `meta.skipped` (`{site_id, site_name, site_item_id, reason_code, message}` per refused website; `site_item_id` is null there, `site_name` is null for `PERMISSION_DENIED`; `NOT_FOUND` when the component is not installed on the website, `ALREADY_APPLIED` when it is already in the requested state).

* **422**: `sites` missing/empty/over 200/unknown id; `is_hidden` missing or not boolean.
* **404**: `{component}` does not exist or is not reachable from the token's organization.
* **403**: a read-only token.

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

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

- `is_hidden` (boolean, optional)
- `sites` (list of double, optional)

## Response

### 200

200 - One website hidden, one already hidden

- `jsonapi` (object, optional)
  - `version` (string, optional)
- `meta` (object, optional)
  - `skipped` (list of object, optional)
    - `message` (string, optional)
    - `reason_code` (string, optional)
    - `site_id` (double, optional)
    - `site_item_id` (any, optional, nullable)
    - `site_name` (string, optional)
  - `status` (string, optional)
  - `updated` (list of object, optional)
    - `site_id` (double, optional)
    - `site_item_id` (double, optional)
    - `site_name` (string, optional)

## Examples

### 200 - One website hidden, one already hidden

**Request**

```json
undefined
```

**Response**

```json
{
  "jsonapi": {
    "version": "1.1"
  },
  "meta": {
    "skipped": [
      {
        "message": "WooCommerce is already hidden on this website.",
        "reason_code": "ALREADY_APPLIED",
        "site_id": 13,
        "site_item_id": null,
        "site_name": "Blog"
      }
    ],
    "status": "applied",
    "updated": [
      {
        "site_id": 12,
        "site_item_id": 301,
        "site_name": "Shop"
      }
    ]
  }
}
```

**SDK Code**

```python 200 - One website hidden, one already hidden
import requests

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

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

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

print(response.json())
```

```javascript 200 - One website hidden, one already hidden
const url = 'https://api.modulards.com/api/public/v1/components/component/visibility';
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 200 - One website hidden, one already hidden
package main

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

func main() {

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

	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 200 - One website hidden, one already hidden
require 'uri'
require 'net/http'

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

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 200 - One website hidden, one already hidden
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/visibility")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php 200 - One website hidden, one already hidden
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp 200 - One website hidden, one already hidden
using RestSharp;

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

```swift 200 - One website hidden, one already hidden
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/api/public/v1/components/component/visibility")! 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()
```

### Update component visibility

**Request**

```json
{
  "is_hidden": true,
  "sites": [
    12
  ]
}
```

**Response**

```json
{
  "jsonapi": {
    "version": "1.1"
  },
  "meta": {
    "skipped": [
      {
        "message": "WooCommerce is already hidden on this website.",
        "reason_code": "ALREADY_APPLIED",
        "site_id": 13,
        "site_item_id": null,
        "site_name": "Blog"
      }
    ],
    "status": "applied",
    "updated": [
      {
        "site_id": 12,
        "site_item_id": 301,
        "site_name": "Shop"
      }
    ]
  }
}
```

**SDK Code**

```python Update component visibility
import requests

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

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

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

print(response.json())
```

```javascript Update component visibility
const url = 'https://api.modulards.com/api/public/v1/components/component/visibility';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"is_hidden":true,"sites":[12]}'
};

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

```go Update component visibility
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"is_hidden\": true,\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 Update component visibility
require 'uri'
require 'net/http'

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

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  \"is_hidden\": true,\n  \"sites\": [\n    12\n  ]\n}"

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

```java Update component visibility
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/visibility")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"is_hidden\": true,\n  \"sites\": [\n    12\n  ]\n}")
  .asString();
```

```php Update component visibility
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Update component visibility
using RestSharp;

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

```swift Update component visibility
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "is_hidden": true,
  "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/visibility")! 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()
```