> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gradial.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sitecore XM Cloud Integration

> Connect Gradial's AI agents to Sitecore XM Cloud to automate content creation, updates, and publishing workflows via GraphQL and REST APIs.

Gradial AI agents connect with XM Cloud via Sitecore's published GraphQL and REST APIs. The integration is configured through a guided onboarding wizard in Gradial under **Settings → Integrations**.

## Prerequisites

Before starting the wizard, create **automation credentials** in the Sitecore Deploy app. These are the OAuth client credentials Gradial uses to authenticate against your environment.

<Steps>
  <Step title="Open the Deploy app">
    Go to [deploy.sitecorecloud.io](https://deploy.sitecorecloud.io), then select **Credentials** in the left nav and open the **Environment** tab.
  </Step>

  <Step title="Create credentials">
    Click **Create credentials → Automation**.
  </Step>

  <Step title="Select project and environment">
    Choose your project and environment. The environment should be the **Authoring** environment.
  </Step>

  <Step title="Save the credentials">
    Click **Create** and save the credentials.

    <Warning>
      Copy the **Client Secret** now — it cannot be viewed again after this screen is closed.
    </Warning>
  </Step>
</Steps>

### Where to find environment details

You'll need several values from your environment during onboarding. Find them in the Deploy app under **Projects → your project → Authoring Environments → Details**.

## Create a new Sitecore XM Cloud integration

<Steps>
  <Step title="Connection">
    Provide the base connection information:

    * **Integration Name** — A human-readable label for this environment, e.g. "Staging" or "Production"
    * **Description** *(optional)* — A short note to help your team identify this connection
    * **Sitecore XM Cloud Hostname** — The **Environment host name** from the environment details page in the Deploy app
    * **Edge API Key** — From the environment details page, open the **Preview GraphQL IDE**, click **Generate Preview API token**, and copy the API key
  </Step>

  <Step title="Credentials">
    Enter the automation credentials you created in the Deploy app:

    * **Client ID** — The automation credential Client ID
    * **Client Secret** — The automation credential Client Secret
    * **Audience** — The token audience (use the default)
    * **Token URL** — The token URL (use the default)
  </Step>

  <Step title="Sites">
    Configure the first site you want Gradial to work with:

    * **Available Sites** — A dropdown of all sites detected on the environment; select the one to use
    * **Editing Host URL** — The [Editing Host](https://doc.sitecore.com/xmc/en/developers/xm-cloud/configure-an-external-editing-host.html) URL. Auto-populates from the site configuration
    * **Live Domain** — Used for live-page URL resolution (e.g. `https://yoursite.com/about` → `/sitecore/content/yoursitecollection/yoursite/Home/about`)
    * **Default Asset Path** — The default Media Library path where Gradial uploads assets. Auto-populates from the site configuration
  </Step>
</Steps>

### Multi-site support

The Gradial integration for Sitecore supports multi-site tenants. The onboarding wizard configures the **first** site of the integration. After the integration has been created, you can add more sites by editing the integration, opening the **Sites** tab, and clicking **Add Site**.
