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

# AEM Integration Setup Guide

This guide walks you through connecting Adobe Experience Manager (AEM) as a Cloud Service to Profound using an Adobe OAuth Server-to-Server credential. Once connected, Profound Agents can access, create, and update the Content Fragment models, folders, and content allowed by the credential's AEM permissions.

## Before you start

You'll need:

* An [AEM as a Cloud Service](https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/overview/introduction) program and **Author** environment
* [AEM Cloud Manager](https://experience.adobe.com/#/cloud-manager) access to commit to an Adobe-managed repository and run a config pipeline (**Deployment Manager** role required)
* Permissions to manage product profiles in the [Adobe Admin Console](https://adminconsole.adobe.com/) and to create OAuth credentials in the [Adobe Developer Console](https://developer.adobe.com/console)
* A [Profound](https://www.tryprofound.com/) account

## Setup guide

<Steps>
  <Step title="Select the AEM environment" id="step-1">
    * Open [Adobe Cloud Manager](https://experience.adobe.com/#/cloud-manager).
    * Sign in under the organization that owns the AEM program you intend to use with Profound.
    * Select and open the program, then select **Environments** in the left sidebar.
    * Open the environment you intend to use and copy its base **Author URL**. It should look like: `https://author-p12345-e67890.adobeaemcloud.com`.
          <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-author-url.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=42c8c2c078ee518a383da531daad117f" alt="Adobe Cloud Manager program overview page screenshot with Environments menu option and Author URL highlighted" width="2013" height="854" data-path="images/integrations/aem/aem-author-url.png" />
  </Step>

  <Step title="Prepare your AEM environment for API access" id="step-2">
    To enable API access in your environment, follow [Adobe's AEM APIs setup guide](https://experienceleague.adobe.com/en/docs/experience-manager-learn/cloud-service/aem-apis/openapis/setup).

    Once done, confirm that you have the correct product profile to use with the AEM API:

    * Go back to your AEM program environment page in [Adobe Cloud Manager](https://experience.adobe.com/#/cloud-manager) (where you left off in [Step 1](#step-1)).
    * Open the environment's action menu and select **Manage Access** > **Author Profiles**. [Adobe Admin Console](https://adminconsole.adobe.com/) opens your environment's page.
          <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-env-manage-access.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=1f68022443bb0a3201c9ff3ccbf60fba" alt="Adobe Cloud Manager environment action menu screenshot with Manage Access and Author Profiles options highlighted" width="1956" height="656" data-path="images/integrations/aem/aem-env-manage-access.png" />
    * Confirm that the **AEM Sites Content Managers - author...** profile exists for your program and environment.
          <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-content-managers-profile.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=3fc3ef6e366cca3ed72730a47c2b2a25" alt="Adobe Admin Console Product profiles list screenshot with the AEM Sites Content Managers author profile highlighted" width="2410" height="1422" data-path="images/integrations/aem/aem-content-managers-profile.png" />
  </Step>

  <Step title="Assign a Developer role to the credential creator" id="step-3">
    To authenticate with Profound, create an OAuth credential. You, or anyone with a **Developer** role in your **AEM Sites Content Managers** product profile, can create it.

    To assign a **Developer** role to the credential creator, continue where you left off in [Step 2](#step-2):

    * On your environment's page in [Adobe Admin Console](https://adminconsole.adobe.com/), select the **AEM Sites Content Managers - author...** product profile.
    * Open the **Developers** tab, then select **Add developers**.
          <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-add-developer.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=344874f02a4457f4695ffb351d71bb55" alt="Adobe Admin Console product profile screenshot with the Developers tab and Add developers button highlighted" width="1758" height="910" data-path="images/integrations/aem/aem-add-developer.png" />
    * Add the email or username of the person creating the OAuth credential, then select **Save**.

    <Tip>
      Learn more about assigning developers to Adobe product profiles in Adobe's [Manage developers in Adobe Admin Console](https://helpx.adobe.com/enterprise/using/manage-developers.html) guide.
    </Tip>
  </Step>

  <Step title="Create the OAuth Server-to-Server credential" id="step-4">
    * Open the [Adobe Developer Console](https://developer.adobe.com/console). If you're following these steps in sequence, you should already be signed in under the organization that owns your Author AEM environment (same as in [Step 1](#step-1)).
    * Select **Create new project** in the **Quick start** section, or go to **Projects** in the top navigation menu and select **Create new project**.
          <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-dev-console-create-project.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=4976d8aa25b741a477d2cb3b50ba158d" alt="Adobe Developer Console home page quickstart section screenshot with Create new project option highlighted" width="1622" height="730" data-path="images/integrations/aem/aem-dev-console-create-project.png" />
    * On the project page, select **Edit project**, give your project a descriptive name (such as **Profound integration credentials**), then select **Save**.
          <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-dev-console-edit-project.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=57dd5b9c83524aee97d71c8018117610" alt="Adobe Developer Console Edit Project dialog screenshot with the Edit project button and the Project Title field highlighted" width="2400" height="1238" data-path="images/integrations/aem/aem-dev-console-edit-project.png" />
    * Select **Add to Project** > **API**.
          <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-dev-console-project-add-api.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=dd25b6dfd1305627eb727fc9ea5f55be" alt="Adobe Developer Console project page screenshot with Add to Project and the API option highlighted" width="1376" height="584" data-path="images/integrations/aem/aem-dev-console-project-add-api.png" />
    * On the **Add an API** page, filter the API list by **Experience Cloud**, select **AEM CS Sites Content Management**, then select **Next**.
          <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-dev-console-cs-sites-content-management.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=e5e114839ec4ecfb03f113b765d3d5af" alt="Add an API view screenshot with Experience Cloud filter option, AEM CS Sites Content Management option, and Next button highlighted" width="2520" height="1556" data-path="images/integrations/aem/aem-dev-console-cs-sites-content-management.png" />
    * Select **Server-to-Server** > **OAuth Server-to-Server** as the authentication type.
          <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-dev-console-s2s-auth.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=63392365f06c8098d1a9d85e1b46687f" alt="Configure API dialog screenshot with Server-to-Server Authentication and Next highlighted" width="2410" height="1140" data-path="images/integrations/aem/aem-dev-console-s2s-auth.png" />
          <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-configure-api-add-s2s-oauth.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=468030a62ea0ee9e1b9cda0a86c4e351" alt="Configure API dialog screenshot with OAuth Server-to-Server, the Credential name field, and Next button highlighted" width="2420" height="1242" data-path="images/integrations/aem/aem-configure-api-add-s2s-oauth.png" />
    * Select the Author product profile you prepared in [Step 2](#step-2), then save the configuration.
          <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-configure-api-select-profile.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=63261c319a90c159ca5c1858d15e1c99" alt="Configure API dialog screenshot with the AEM Sites Content Managers product profile selected and Save configured API option highlighted" width="2420" height="1250" data-path="images/integrations/aem/aem-configure-api-select-profile.png" />

    <Note>
      The AEM Sites Content Management API also provides the folder access Profound uses. No additional credentials are required.
    </Note>
  </Step>

  <Step title="Retrieve the connection values" id="step-5">
    After you save the API configuration, [Adobe Developer Console](https://developer.adobe.com/console) returns you to the project page. In the **Credentials** section, select your new OAuth Server-to-Server credential. From the credential page, copy the values you need to create the AEM integration in Profound:

    * **Client ID**
    * **Client Secret**
    * **Scopes** — copy the complete value exactly as Adobe displays it
    * **Organization ID** — optional; copy it only if the AEM tenant requires the `x-gw-ims-org-id` header

          <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-connection-values.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=33a7ec41d13549bd3ae8ac6ed42993d9" alt="OAuth Server-to-Server credential details view screenshot with Client ID, Client Secret, Scopes, and Organization ID highlighted" width="2348" height="1630" data-path="images/integrations/aem/aem-connection-values.png" />
  </Step>

  <Step title="Register the client ID with the AEM environment" id="step-6">
    Before you can use the credential, register its client ID with your Author environment.

    * Back in [Adobe Cloud Manager](https://experience.adobe.com/#/cloud-manager), open the program and select **Repositories** in the left sidebar.
    * Identify the Adobe-managed repository and branch used by your environment's config pipeline.
          <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-repositories.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=485eedb44a7d7f739f739f236640ff63" alt="Adobe Cloud Manager Repositories screenshot with Repositories menu option, repository name, and the configured pipeline branch highlighted" width="2230" height="1008" data-path="images/integrations/aem/aem-repositories.png" />
    * Select **Access Repo Info** and copy the repository URL and access credentials.
    * Using your regular development workflow, clone the repository onto your machine and create or update the `config/api.yaml` file in the root directory with the following configuration:
      ```yaml theme={null}
      kind: "API"
      version: "1"
      metadata:
        envTypes: ["dev", "stage", "prod"]
      data:
        allowedClientIDs:
          author:
            - "<CLIENT_ID>"
      ```

    Replace `<CLIENT_ID>` with the client ID you copied from Developer Console in [Step 5](#step-5).

    If you already have other API credentials configured, keep the existing configuration and add the client ID to the `author` list under `allowedClientIDs`.

    <Tip>
      Learn more about managing repositories and configuring pipelines in the following Adobe resources:

      * [AEM API client ID registration guide](https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/developing/open-api-based-apis#registering-a-client-id)
      * [Manage repositories in Cloud Manager](https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/using-cloud-manager/managing-code/managing-repositories)
      * [Use config pipelines](https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/operations/config-pipeline) guide
      * [Invoke OpenAPI-based AEM APIs using OAuth Server-to-Server authentication](https://experienceleague.adobe.com/en/docs/experience-manager-learn/cloud-service/aem-apis/openapis/invoke-api-using-oauth-s2s) tutorial
    </Tip>
  </Step>

  <Step title="Deploy API configuration with a config pipeline" id="step-7">
    * Still on your program page in [Adobe Cloud Manager](https://experience.adobe.com/#/cloud-manager), select **Pipelines** in the left sidebar.
    * Select **Add Pipeline**, then select **Add Non-Production Pipeline** for the development environment, or **Add Production Pipeline** for stage and production.
          <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-add-pipeline.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=d5a8bd283871ac52c0ed6a4d9e5a068a" alt="Adobe Cloud Manager Pipelines screenshot with the Pipelines menu option and Add Pipeline button highlighted" width="2232" height="968" data-path="images/integrations/aem/aem-add-pipeline.png" />
    * In the **Add Pipeline** dialog, select **Deployment Pipeline**, give your pipeline a descriptive name, then select **Continue**.
    * On the next screen, fill in the values as follows:
      * Select code to deploy: **Targeted deployment**
      * Include: **Config**
      * Eligible Deployment Environments: select your AEM environment from the dropdown
      * Repository, Git Branch, Code Location: the repository, branch, and config directory from [Step 6](#step-6)
    * Select **Save**.

    Your new config pipeline appears in the list of pipelines in the **Pipelines** section. Select the pipeline, then select **Run selected**. Wait for the deployment to complete successfully.

    <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-pipeline-run.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=f718730ffb2ea2526a06a6ce2b1cdfcd" alt="Adobe Cloud Manager Pipelines screenshot with a new config pipeline selected and a Run selected button highlighted" width="2178" height="438" data-path="images/integrations/aem/aem-pipeline-run.png" />

    <Tip>
      Learn more about deploying config pipelines in the following Adobe resources:

      * [Use config pipelines](https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/operations/config-pipeline) guide
      * [Cloud Manager CI/CD pipelines](https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/implementing/using-cloud-manager/cicd-pipelines/introduction-ci-cd-pipelines) overview
    </Tip>
  </Step>

  <Step title="Add an AEM S2S integration in Profound" id="step-8">
    * In [Profound](https://platform.tryprofound.com), go to **Integrations** in the left sidebar.
    * Search for **Adobe Experience Manager (S2S)** and select it.
          <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-s2s-integration-card.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=bbc744a5c70df84ac351a72fe10642ed" alt="Profound Integrations view screenshot with Adobe Experience Manager (S2S) integration card highlighted" width="1782" height="720" data-path="images/integrations/aem/aem-s2s-integration-card.png" />
    * In the Adobe Experience Manager (S2S) integration view, select **+ Add account**.
    * In the **Connect Adobe Experience Manager (S2S)** dialog, enter the Author URL from [Step 1](#step-1) and the client secret, client ID, scopes, and organization ID you retrieved in [Step 5](#step-5).
    * Select **Connect account**.

    If the connection succeeds, your AEM environment appears in the list of connected accounts.

    <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-profound-integration.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=4170d3dfd15b7309d5a86171dd5bc7f0" alt="Profound Adobe Experience Manager integration view screenshot with a connected account highlighted" width="1366" height="1024" data-path="images/integrations/aem/aem-profound-integration.png" />

    Revoke Profound's access to your AEM environment at any time by selecting **Revoke** in the integration account action menu.

    <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-integration-revoke.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=9ba55d38e6c349de6b38b98830e71bf1" alt="Profound connected account action menu screenshot with the three-dot menu and the Revoke option highlighted" width="1774" height="618" data-path="images/integrations/aem/aem-integration-revoke.png" />
  </Step>

  <Step title="Verify the connection" id="step-9">
    To make sure Profound has all the permissions it needs to work with your AEM environment, verify that the AEM Agent nodes run successfully.

    * In [Profound](https://platform.tryprofound.com), [create a new Agent](https://help.tryprofound.com/articles/2212787792-create-an-agent), or open an existing Agent draft.
    * Add the Adobe Experience Manager **List Content Fragments** and **Get Content Fragment** nodes, then select the connected AEM instance.
    * Select **Test node** (a play icon) in the node configuration panel and confirm that the AEM output contains the expected data.
          <img src="https://mintcdn.com/profound-37face47/VadJiYMKj-yl6ums/images/integrations/aem/aem-test-run-agent.png?fit=max&auto=format&n=VadJiYMKj-yl6ums&q=85&s=f17bb8614765c9ad4aa26a037e4b21ac" alt="List Content Fragments node configuration panel screenshot with the play icon highlighted" width="1774" height="372" data-path="images/integrations/aem/aem-test-run-agent.png" />
    * If you intend to create or update content fragments with Profound Agents, test the **Create Content Fragment** and **Update Content Fragment** nodes the same way.

    <Note>
      Delete test content directly in the AEM environment. Current Profound Agent nodes don't include a delete operation.
    </Note>
  </Step>
</Steps>

## Rotating AEM credentials

### Rotate a client secret only

Adobe supports two client secrets on one OAuth Server-to-Server credential, which allows rotation without changing the client ID.

Rotate your client secret as instructed in [Adobe developer documentation](https://developer.adobe.com/developer-console/docs/guides/authentication/ServerToServerAuthentication/implementation#rotating-client-secrets), then update the credentials in Profound (**Integrations** > **Adobe Experience Manager (S2S)** > **Edit credentials** in a connected account's action menu).

The client ID doesn't change during this process, so you don't need to update or redeploy `api.yaml`.

### Rotate the entire OAuth credential

To replace the entire AEM OAuth credential:

1. Generate a new credential as described in [Step 4](#step-4) of the setup guide.
2. Deploy the new client ID in `config/api.yaml` as instructed in [Step 6](#step-6) of the setup guide.
3. Update the credentials in Profound.

<Tip>
  Keep the old client ID registered until you've verified the new connection.
</Tip>

## Best practices

* Use an **Author** environment only. Profound doesn't connect to AEM Publish or Preview. Learn more about environments in [AEM as a Cloud Service tutorials](https://experienceleague.adobe.com/en/docs/experience-manager-learn/cloud-service/cloud-manager/environments).
* Test the read and write Profound Agent nodes separately to verify their folder and repository permissions.
* Always store your client secret and other credentials in an approved secret manager, and never include them in screenshots, tickets, or source control.
