# Creating Web ESD via Connect API Web-type Embedded Service Deployments cannot be created via Metadata API due to a circular dependency between Network and CustomSite metadata types. Use Connect API instead. --- ## Prerequisites 1. Digital Experiences must be enabled in the org (Setup > Digital Experiences > Enable) 2. The messaging channel must already exist (need the `messagingChannelId` — the 18-char record ID) 3. Salesforce CLI (`sf`) must be authenticated to the target org --- ## Connect API Endpoint ```text POST /connect/embeddedmessaging/deployment/setup ``` ### Request Body (Web) ```json { "name": "", "masterLabel": "", "deploymentType": "Web", "clientVersion": "WebV2", "hostDomain": "", "messagingChannelId": "" } ``` ### Request Body (API / Mobile) ```json { "name": "", "masterLabel": "", "deploymentType": "API", "messagingChannelId": "" } ``` ### Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `name` | String | Yes | API name for the deployment (no spaces) | | `masterLabel` | String | Yes | Display label for the deployment | | `deploymentType` | String | Yes | `Web`, `API`, or `Mobile` | | `messagingChannelId` | String | Yes | 18-character record ID of the messaging channel | | `clientVersion` | String | Web only | Always `WebV2` for enhanced messaging web deployments | | `hostDomain` | String | Web only | The domain where the widget will be hosted (e.g. `mysite.com`) | ### Using Salesforce CLI (Web) ```bash sf api request rest \ --method POST \ --url "/connect/embeddedmessaging/deployment/setup" \ --body '{"name":"","masterLabel":"