> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# SetToolsToggle

# Package: appTools

# Namespace: ToolsHost

# Method link: https://dev.wix.com/docs/api-reference/app-management/app-tools/tools-host/set-tools-toggle.md

## Permission Scopes:
Invoke App Tools: SCOPE.APP_TOOLS.INVOKE

## Introduction

Enables or disables individual tools of one app for the site in context.

Tools that aren't in the request keep their current setting. Method names the app doesn't declare are
ignored. To switch all of an app's tools at once, call Set Tools Providers Toggle.

---

## REST API

### Schema

```
 Method: setToolsToggle
 Description: Enables or disables individual tools of one app for the site in context.  Tools that aren't in the request keep their current setting. Method names the app doesn't declare are ignored. To switch all of an app's tools at once, call Set Tools Providers Toggle.
 URL: https://www.wixapis.com/_api/tools-host/v1/set-tools-toggle
 Method: POST
 Method parameters:
   param name: providerAppId | type: providerAppId | description: GUID of the app whose tools to enable or disable.  | validation: format GUID
   param name: tools | type: array<tools> | description: Tools to enable or disable for the site. Tools not listed keep their current setting.  | validation: minItems 1, maxItems 100
              - name: methodName | type: string | description: Method name of the tool, as returned in `methodName` by List Tools Providers.  | validation: minLength 1, maxLength 50
              - name: enabled | type: boolean | description: Whether the tool is enabled for the site.  
 Return type: SetToolsToggleResponse
  EMPTY-OBJECT {}


```

### Examples

### Switch one of an app's tools off for a site
Disables a single tool of an installed app for the site. Tools not listed keep their current setting.

```curl
curl -X POST \
'https://www.wixapis.com/_api/tools-host/v1/set-tools-toggle' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-H 'wix-site-id: <SITE_ID>' \
-d '{
  "providerAppId": "6c4d3373-2afc-46a6-b7e0-9b98a43df146",
  "tools": [
    {
      "methodName": "sendCarrierNote",
      "enabled": false
    }
  ]
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.appTools.toolsHost.setToolsToggle(options)
 Description: Enables or disables individual tools of one app for the site in context.  Tools that aren't in the request keep their current setting. Method names the app doesn't declare are ignored. To switch all of an app's tools at once, call Set Tools Providers Toggle.
 Method parameters:
   param name: options | type: SetToolsToggleOptions  none  
        - name: providerAppId | type: string | description: GUID of the app whose tools to enable or disable.  | validation: format GUID
        - name: tools | type: array<ToolToggle> | description: Tools to enable or disable for the site. Tools not listed keep their current setting.  | validation: minItems 1, maxItems 100
           - name: methodName | type: string | description: Method name of the tool, as returned in `methodName` by List Tools Providers.  | validation: minLength 1, maxLength 50
           - name: enabled | type: boolean | description: Whether the tool is enabled for the site.  
 Return type: PROMISE<SetToolsToggleResponse>
  EMPTY-OBJECT {}


```

### Examples

### Switch one of an app's tools off for a site
Disables a single tool of an installed app for the site. Tools not listed keep their current setting.

```javascript
import { toolsHost } from "@wix/app-tools";

async function setToolsToggle() {
  const response = await toolsHost.setToolsToggle({
    providerAppId: "6c4d3373-2afc-46a6-b7e0-9b98a43df146",
    tools: [
      {
        methodName: "sendCarrierNote",
        enabled: false,
      },
    ],
  });
}

/* Promise resolves to:
 * {}
 */

```

### setToolsToggle (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { toolsHost } from '@wix/app-tools';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { toolsHost },
  // Include the auth strategy and host as relevant
});


async function setToolsToggle(options) {
  const response = await myWixClient.toolsHost.setToolsToggle(options);
};
```

---