> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# EnableConnection

# Package: identity

# Namespace: ConnectionsService

# Method link: https://dev.wix.com/docs/api-reference/wix-backoffice/identity/connection-v1/enable-connection.md

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

## Introduction

Enables a connection for user authentication.

This activates a previously created connection, making it available for users to sign in with.
Calling this method for a connection that's already enabled succeeds, and the connection stays enabled.
To deactivate the connection, call [Disable Connection](https://dev.wix.com/docs/api-reference/wix-backoffice/identity/connection-v1/disable-connection.md).

> **Note:** The connection ID isn't validated. If no connection exists with the specified ID, the call still succeeds,
> but no sign-in option is added. To verify that the connection was enabled, call
> [List Enabled Connections Client Data](https://dev.wix.com/docs/api-reference/wix-backoffice/identity/connection-v1/list-enabled-connections-client-data.md)
> and check that the connection appears in the response.

---

## REST API

### Schema

```
 Method: enableConnection
 Description: Enables a connection for user authentication.  This activates a previously created connection, making it available for users to sign in with. Calling this method for a connection that's already enabled succeeds, and the connection stays enabled. To deactivate the connection, call [Disable Connection](https://dev.wix.com/docs/api-reference/wix-backoffice/identity/connection-v1/disable-connection.md).  > **Note:** The connection GUID isn't validated. If no connection exists with the specified GUID, the call still succeeds, > but no sign-in option is added. To verify that the connection was enabled, call > [List Enabled Connections Client Data](https://dev.wix.com/docs/api-reference/wix-backoffice/identity/connection-v1/list-enabled-connections-client-data.md) > and check that the connection appears in the response.
 URL: https://www.wixapis.com/iam/connection/v1/connections/enabled
 Method: POST
 # 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: connectionId | description: Connection GUID. | required: true | validation: format GUID
 Return type: EnableConnectionResponse
  EMPTY-OBJECT {}


```

### Examples

### Enable a connection
Activates a previously created connection so users can sign in with it. The connection ID is passed in the request body; the response is empty on success.

```curl
curl -X POST \
'https://www.wixapis.com/iam/connection/v1/connections/enabled' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "connectionId": "2f3c8a1e-0b7d-4e2a-9c11-8a1e0b7d4e2a"
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.identity.connection.enableConnection(connectionId)
 Description: Enables a connection for user authentication.  This activates a previously created connection, making it available for users to sign in with. Calling this method for a connection that's already enabled succeeds, and the connection stays enabled. To deactivate the connection, call [Disable Connection](https://dev.wix.com/docs/api-reference/wix-backoffice/identity/connection-v1/disable-connection.md).  > **Note:** The connection GUID isn't validated. If no connection exists with the specified GUID, the call still succeeds, > but no sign-in option is added. To verify that the connection was enabled, call > [List Enabled Connections Client Data](https://dev.wix.com/docs/api-reference/wix-backoffice/identity/connection-v1/list-enabled-connections-client-data.md) > and check that the connection appears in the response.
 # 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<EnableConnectionResponse>
  EMPTY-OBJECT {}


```

### Examples

### Enable a connection
Activates a previously created connection for user authentication.

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

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

/* Promise resolves to:
 * {}
 */

```

### enableConnection (self-managed)
Self-managed 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 enableConnection(connectionId) {
  const response = await myWixClient.connection.enableConnection(connectionId);
};
```

---