npx skills add ...
npx skills add forcedotcom/sf-skills --skill experience-portal-create
Create / provision / set up a NEW Digital Experience (Communities) / Experience Cloud site — employee service, IT support, help desk, HR, customer, and partner portals — via the headless-360 MCP site-creation APIs. Use whenever a user asks to create/provision/set up a portal, site, or community, e.g.: 'create an employee service portal', 'create an IT Support Portal', 'create an Agentforce Employee Center', including wiring MIAW (Messaging for In-App/Web) at create. This is the site-CREATION skill and OWNS provisioning a new Aura OR LWR Experience Builder site from scratch — trigger it even when the user says 'Experience Builder site' or 'LWR site', as long as a NEW site is wanted. It always writes a portal-creation report as its final step (never ad hoc via CLI) and never makes a legacy Tabs+Visualforce site. DO NOT TRIGGER only for modifying an EXISTING site's pages/routes/theme/branding/guest-access metadata (experience-lwr-site-generate), existing-site customization (experience-ui-bundle), CMS, Commerce.
npx skills add forcedotcom/sf-skills --skill experience-portal-create
Create a new Digital Experience (formerly Communities) portal/site in Salesforce. Supports employee service portals, partner portals (PRM), and general customer communities.
Every operation runs through the headless-360 MCP server (mcp__headless-360__discover →
mcp__headless-360__describe → mcp__headless-360__dispatch / mcp__headless-360__dispatch_readonly).
Do not use the Salesforce CLI (its api request, data query, or org open subcommands), the project-codey MCP
server, raw curl, or any other HTTP client — dispatch/dispatch_readonly is the only way this
skill talks to the org. See references/mcp-invocation.md for the exact call shapes.
status: Live), adding member profiles, and publishing the Experience Builder pages (see references/post-creation-activate-publish.md).Every org call is a dispatch: mcp__headless-360__dispatch_readonly(url, method: "GET", queryParams)
for reads, mcp__headless-360__dispatch(url, method, body) for writes; read status_code + body from
the response. To resolve the endpoint for a portal type, use mcp__headless-360__discover(query=...) and
mcp__headless-360__describe(id=...) as needed. Connect API create/list operations for Experience Cloud
are not always indexed by discover/describe — when a lookup returns nothing, dispatch the well-known
versioned Connect API path directly (see references/mcp-invocation.md) rather than concluding the
capability is missing.
Critical: paths must include the full /services/data/vXX.0/... prefix (e.g.
"/services/data/v67.0/connect/communities") — unlike some other dispatchers, headless-360 does
not resolve or inject the API version for you. A path without the version prefix returns
400 ROUTE_NOT_FOUND. Copy the path verbatim from a discover/describe result when available;
otherwise use the version shown in this skill's examples (v67.0 at time of writing) and adjust if
the org runs a different version. Full details, response envelope, job-monitoring, and gotchas live
in references/mcp-invocation.md.
Before proceeding, determine:
Portal type?
Agentforce Employee Center Aura template via the communities API (richest employee experience; Agentforce-ready). Use the self-service API instead when MIAW must be wired in at creation time and a guest ESD exists.Basic settings (required for all types):
For Employee Service / Self-Service portals:
siteType? → default AURA (Aura Experience Builder + Builder). Use LWR only if the user explicitly wants a Lightning Web Runtime site. Never create a Salesforce Tabs + Visualforce ("VF Template") site — those are legacy and have no Builder.For Partner portals only:
POST /connect/self-service/site):siteName (required) - portal nameguestEmbeddedServiceConfigId (required) - Embedded Service Deployment (MIAW) config ID for guest usersembeddedServiceConfigId (optional) - Embedded Service Deployment (MIAW) config ID for authenticated userssiteType (optional) - AURA (default) or LWR. Produces an Experience Builder site. Do not use Visualforce.enableForGuest (optional) - whether guest (unauthenticated) users can access the sitecontentDocumentId (optional) - ContentDocument ID of a logo image to wire into the site's branding setbrandColors (optional) - array of RGBA colors targeting action, link, border, text, pageBackgroundThis API sets the URL path prefix automatically from the site name. There is no
templateName— the framework is chosen withsiteType(Aura/LWR), never Visualforce.
siteName (required)siteUrlPrefix (required)prmTemplate (required)siteDesc (optional)POST /connect/communities):name (required)urlPathPrefix (required) - alphanumeric only, no hyphenstemplateName (required) - an Experience Builder template. Aura: Agentforce Employee Center (preferred for employee service), Employee Portal, Customer Service, Help Center, Customer Account Portal, Partner Central, Build Your Own. LWR: Build Your Own (LWR), Microsite (LWR). Validate the exact string via GET /connect/communities/templates (see below). Do not use Salesforce Tabs + Visualforce ("VF Template") — it is a legacy Visualforce site with no Builder.description (optional)Employee Service / Self-Service → POST /connect/self-service/site
CustomizeApplication permission; org has self-service site-creation API access; a guest Embedded Service Deployment existsPartner (PRM) → POST /connect/prm/setup/sites
CommonPrmEnabled featureGeneral Community → POST /connect/communities
templateName (Aura or LWR) — never Salesforce Tabs + VisualforceManageNetworks)Use the self-service site API. It creates an Aura Experience Builder site (with the Builder option) by deploying CustomSite, Network, and ExperienceBundle metadata, then wires MIAW into the site via the given Embedded Service Deployment (ESD) config IDs. This is the correct path for ITSM / IT help desk / employee self-service portals.
API Call (via mcp__headless-360__dispatch):
Poll with GET /services/data/v67.0/connect/self-service/site/status/{jobId} via mcp__headless-360__dispatch_readonly.
siteType defaults to AURA (Aura Experience Builder + Builder). Pass LWR only if the user explicitly asks for a Lightning Web Runtime site. Never create a Visualforce site.guestEmbeddedServiceConfigId is required — it is the MIAW Embedded Service Deployment config ID for guest users. embeddedServiceConfigId (authenticated users) is optional. If the user has no Embedded Service Deployment yet, have them create one first (Setup → Embedded Service Deployments), or use the MIAW/embedded-service setup skill.contentDocumentId (logo) and brandColors (array of { "type": "action|link|border|text|pageBackground", "color": { "r": 0-255, "g": 0-255, "b": 0-255, "a": 0-1 } }).Response:
On success, report Success: — the portal creation started (Aura + Experience Builder); give the
name, framework (Aura), jobId, and status, and note it is provisioning in the background
(Network, CustomSite, ExperienceBundle metadata + the Embedded Service/MIAW deployment). Next: monitor
the job (see 'Background Job Monitoring'), then complete Step 3 (Activate → Add Members → Publish).
On failure, report Failure: with the {error} — see the "Common Errors" section for the causes
(missing/invalid guestEmbeddedServiceConfigId, duplicate name/URL prefix, org lacks self-service
site-creation API access, missing CustomizeApplication) and their resolutions.
API Call (via mcp__headless-360__dispatch):
Synchronous — no job polling.
Response:
On success, report Success: — the partner portal was created; give the name, networkId,
siteUrlPrefix, and prmTemplate. Next: find it at Setup → Digital Experiences → All Sites (by
Network ID), then complete Step 3 (Activate → Add Members → Publish).
On failure, report Failure: — see "Common Errors" (org lacks PRM/CommonPrmEnabled, invalid PRM
template name, duplicate name/URL prefix). PRM templates: Setup → Digital Experiences → Settings →
Partner Templates.
First, discover valid templates (required — accepted templateName strings vary by org edition/version), via mcp__headless-360__dispatch_readonly:
Response: { "templates": [ { "publisher": "Salesforce", "templateName": "Employee Portal" }, … ], "total": N }. Use a returned templateName verbatim. Prefer an Experience Builder template (Aura or LWR). Never use Salesforce Tabs + Visualforce.
API Call (via mcp__headless-360__dispatch):
The body accepts only {name, description, templateName, templateParams, urlPathPrefix} — omit templateParams unless you need template-specific config.
For an employee service / ITSM / HR portal, prefer the Agentforce Employee Center template when the org's live template list includes it — it ships IT/HR ticketing, a self-service catalog, a knowledge base, and an Agentforce-ready experience. Fall back to Employee Portal (then Customer Service) for a plainer, non-Agentforce site. Other options by use case: Help Center (Aura knowledge/deflection), Customer Account Portal (Aura authenticated account self-service), Partner Central (Aura PRM), or Build Your Own (LWR) for a modern blank LWR site.
Agentforce Employee Center is two layers. This
POST /connect/communitiescall provisions the site only. The embedded Agentforce conversational assistant is a separate step — create the internal employee agent from its shipped template (EmployeeCopilot__AgentforceEmployeeAgent) viaPATCH /services/data/v67.0/headless/invoke/einstein/genai-agentbuilder/create-copilot-from-template(copilotContext.companyis required), then activate it and wire it to the site. This skill provisions the site and points the user to that step; full Agentforce setup is out of scope. Seereferences/templates.md.
Response:
On success, report Success: — community creation started; give the name, jobId, and
message. Next: monitor the job (see 'Background Job Monitoring'), then complete Step 3 (Activate →
Add Members → Publish).
On failure, report Failure: — see "Common Errors" (invalid templateName — run
GET /services/data/v67.0/connect/communities/templates and use a returned value verbatim; duplicate
name/URL prefix; missing Manage Communities permission).
Creation only provisions the site — it comes back UnderConstruction, admin-only, with
unpublished pages, so its URL is not reachable yet (the #1 "my portal doesn't work" cause).
Complete three steps, in order: (1) Activate — deploy the Network metadata with
<status>Live</status>; (2) Add members — add the target profile(s) to
networkMemberGroups (membership is profile-based, not per user; e.g. Unified Employee — a
Profile, not a UserRole) and redeploy (combinable with step 1); (3) Publish —
sf community publish --name "<Site Name>", then poll the returned jobId on BackgroundOperation
until Complete. Then confirm status: Live and give the user the login URL
(.../<prefix>/login), not the bare prefix.
Tooling exception: activate/members use the Metadata API (
Networkdeploy) and publish usessf community publish— there is no Connect API for these (PATCH /connect/communitiesreturns 405). This is the one place the skill uses tools other than headless-360; Step 3 reads still go through headless-360.
Exact commands, XML, verification queries, and gotchas: references/post-creation-activate-publish.md.
Always finish by writing a report.md summarizing what was done — this is the skill's final,
non-optional action, whether the create call succeeded, is still provisioning, or failed. Write it to
the working/output directory as report.md.
The report must:
# Portal Creation Report.self-service/site, communities, or prm) and
why (e.g. "no guest ESD present → communities API"), the framework (Aura / LWR), and the
template or siteType chosen.jobId /
networkId / siteUrl / status, or the error).Task completed: portal creation dispatched — see report.mdCopy the template at assets/report-template.md and fill in the portal-specific values.
All recommendations produce Experience Builder sites (Aura or LWR). Never recommend Salesforce Tabs + Visualforce ("VF Template") — it is legacy and has no Builder.
| Use Case | API | Framework | Template / siteType |
|---|---|---|---|
| Employee service / ITSM / HR / help desk (richest; Agentforce-ready) | communities | Aura | Agentforce Employee Center |
| Employee service / help desk (MIAW at creation, guest ESD exists) | self-service/site | Aura | siteType: AURA (+ MIAW ESD config) |
| Employee service / help desk (plainer, no Agentforce) | communities | Aura | Employee Portal (fallback Customer Service) |
| Customer support / self-service community | communities | Aura | Customer Service |
| Knowledge base / case deflection | communities | Aura | Help Center |
| Authenticated account self-service | communities | Aura | Customer Account Portal |
| Partner portal (with PRM) | prm/setup/sites | Aura | Org-specific PRM template |
| Partner portal / channel (no PRM) | communities | Aura | Partner Central |
| Modern blank / headless-friendly site | communities | LWR | Build Your Own (LWR) |
Modern recommendations:
Agentforce Employee Center Aura template via the communities API — it ships the fullest employee experience (ticketing, catalog, knowledge, Agentforce-ready). The conversational assistant is a separate agent step (EmployeeCopilot__AgentforceEmployeeAgent). Use the self-service site API (siteType: AURA) instead when the portal needs MIAW wired in at creation time and a guest Embedded Service Deployment exists; use Employee Portal for a plainer, non-Agentforce site.Customer Service template (Aura, mobile-responsive) via the communities API.See references/templates.md for complete template documentation.
Portal creation is asynchronous (except PRM which is synchronous). Poll through
mcp__headless-360__dispatch_readonly.
Self-service site path — use the dedicated typed status route (preferred):
Returns {success, siteName, urlPathPrefix, siteUrl, error, jobId, status}.
Communities path — query BackgroundOperation via the regular REST query endpoint,
not /tooling/query:
Tooling vs. regular query (verified gotcha):
BackgroundOperationis not a valid Tooling API sObject through this dispatcher —GET /services/data/vXX.0/tooling/querywith that SOQL returns400 INVALID_TYPE "sObject type 'BackgroundOperation' is not supported.". Use the plain/services/data/vXX.0/queryendpoint instead; it succeeds with the same SOQL string.
Column discipline: on
BackgroundOperation, select onlyIdandStatus.JobType,CompletedDate, andNumErrorsare not columns on this object and returnINVALID_FIELD. Use the SOQL string above exactly.
Job statuses:
Queued / Scheduled — waiting to startInProgress / Running — executingComplete — finished successfullyError — failed (check the error field on the status route)After creation completes:
mcp__headless-360__dispatch_readonly(url: "/services/data/v67.0/connect/communities", method: "GET") lists all Experience Cloud sites. Find the new one and confirm siteAsContainerEnabled: true (Experience Builder — Aura/LWR) and a non-null builderUrl, and that templateName is not Salesforce Tabs + Visualforce. siteAsContainerEnabled: false means a legacy Visualforce site — the bug this skill exists to avoid.siteUrl from the response (portal will be inactive initially).Note: Portal must be activated and published before external users can access it.
| Constraint | Rationale |
|---|---|
| Portal creation is asynchronous | Deploys metadata and provisions resources in background |
| Site names must be unique | Each portal needs distinct name within org |
| URL prefixes must be unique | URL paths cannot conflict |
| URL prefixes must be alphanumeric | No hyphens, spaces, or special characters allowed |
| PRM requires PRM feature | Gated by licensing and org config |
| Created portals start inactive | Must manually activate/publish after creation |
| Paths must include the API version prefix | dispatch/dispatch_readonly do not inject /services/data/vXX.0 — omitting it returns 400 ROUTE_NOT_FOUND |
CustomizeApplication permissionCommonPrmEnabledManageNetworks)"The URL can only contain alphanumeric characters. Remove hyphens, spaces, or special characters (e.g., 'employeeservice' not 'employee-service') and try a different prefix."
"The specified template does not exist.
Resolution:
GET /services/data/v67.0/connect/communities/templates and use a returned templateName verbatimAgentforce Employee Center (employee service), Employee Portal, Customer Service, Help Center, Customer Account Portal, Partner Central, Build Your Own, Build Your Own (LWR)Salesforce Tabs + Visualforce ("VF Template") — it is a legacy Visualforce site with no Builder""The self-service site API requires a guest Embedded Service Deployment config ID.
Resolution:
guestEmbeddedServiceConfigId (and optionally embeddedServiceConfigId for authenticated users)""This org doesn't have Partner Relationship Management (PRM) enabled.
Options:
Partner Central template instead (via Communities API)""A portal with this name or URL prefix already exists (the communities API returns 400 INVALID_INPUT — Enter a different name. That one already exists.).
Check existing portals: mcp__headless-360__dispatch_readonly(url: "/services/data/v67.0/connect/communities", method: "GET") and scan the name / urlPathPrefix fields.
Choose a different name or URL prefix."
"You don't have permission to create portals.
Required permissions:
CustomizeApplicationManageNetworks (Manage Communities)Contact your Salesforce admin to request these permissions."
"400 ROUTE_NOT_FOUND on a path that otherwise matches this skill's documentation. Confirm the url includes the full /services/data/vXX.0/... prefix — dispatch/dispatch_readonly require it verbatim and won't add it for you. If a specific version 404s, try the version shown in a recent discover/describe result for that org."
After creation:
Manage existing:
mcp__headless-360__dispatch_readonly(url: "/services/data/v67.0/connect/communities", method: "GET")UnderConstruction, member-less, and unpublished, so its URL is not reachable until you complete Step 3 (Activate → Add Members → Publish; see references/post-creation-activate-publish.md).https://<domain>.my.site.com/<prefix> (serve/login at .../<prefix>/login, not the bare prefix).POST /connect/communities) are not individually indexed. Do not conclude the capability is missing; dispatch the well-known, versioned Connect API path directly (documented in this skill).references/mcp-invocation.md — Read every session. Exact mcp__headless-360__* call shapes, the version-prefix requirement, response envelope, job monitoring, BackgroundOperation column/endpoint discipline, and gotchas.references/templates.md — Available templates, template parameters, selection guide.references/post-creation-activate-publish.md — Step 3 (activate, add members, publish) to make the site reachable: the Metadata-API + sf community publish paths, the 405-on-PATCH gotcha, NetworkMemberGroup column discipline, and the login-URL note.assets/report-template.md — Step 4 report.md template to copy (heading, required fields, sentinel).Site creation is dispatched through mcp__headless-360__dispatch / mcp__headless-360__dispatch_readonly (never project-codey or raw HTTP). All paths include the /services/data/vXX.0 prefix. Post-creation (Step 3) is the one exception: activating the Network and adding members use the Metadata API (sf project deploy start --metadata Network:...), and publishing uses sf community publish — there is no Connect API for these (a PATCH /connect/communities/<id> returns 405). Reads/verification for Step 3 still go through headless-360. Creation paths:
POST /services/data/vXX.0/connect/self-service/site — asynchronous (poll GET /services/data/vXX.0/connect/self-service/site/status/{jobId})POST /services/data/vXX.0/connect/prm/setup/sites — synchronousPOST /services/data/vXX.0/connect/communities — asynchronous (poll BackgroundOperation via GET /services/data/vXX.0/query, not /tooling/query)