> 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

# DisableConnection

# Package: headless

# Namespace: ConnectionsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/headless/connections/disable-connection.md

## Permission Scopes:
SCOPE.IDENTITY.MANAGE-SSO-SITE: SCOPE.IDENTITY.MANAGE-SSO-SITE

## Introduction

Disables a connection from user authentication.

This deactivates the connection without deleting its configuration.
Users can no longer sign in using this connection until it's re-enabled.

---

## REST API

### Schema

```
 Method: disableConnection
 Description: Disables a connection from user authentication.  This deactivates the connection without deleting its configuration. Users can no longer sign in using this connection until it's re-enabled.
 URL: https://www.wixapis.com/iam/connection/v1/connections/enabled/{connectionId}
 Method: DELETE
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  connectionId
 Method parameters: 
   param name: connectionId | type:   none | required: true 
 Return type: DisableConnectionResponse
  EMPTY-OBJECT {}


```

### Examples

### Disable a connection
Deactivates an enabled connection while preserving its configuration, so it can be re-enabled later. The connection ID is passed in the path; the response is empty on success.

```curl
curl -X DELETE \
'https://www.wixapis.com/iam/connection/v1/connections/enabled/2f3c8a1e-0b7d-4e2a-9c11-8a1e0b7d4e2a' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.identity.connection.disableConnection(connectionId)
 Description: Disables a connection from user authentication.  This deactivates the connection without deleting its configuration. Users can no longer sign in using this connection until it's re-enabled.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  connectionId
 Method parameters: 
   param name: connectionId | type: string | description: Connection GUID. | required: true | validation: format GUID
 Return type: PROMISE<DisableConnectionResponse>
  EMPTY-OBJECT {}


```

### Examples

### Disable a connection
Deactivates an enabled connection while preserving its configuration.

```javascript
import { connection } from "@wix/identity";

async function disableConnection() {
  const response = await connection.disableConnection(
    "2f3c8a1e-0b7d-4e2a-9c11-8a1e0b7d4e2a",
  );
}

/* Promise resolves to:
 * {}
 */

```

### disableConnection (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 { connection } from '@wix/identity';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function disableConnection(connectionId) {
  const response = await myWixClient.connection.disableConnection(connectionId);
};
```

---