--- title: "Setting up the Salesforce Agentforce integration" slug: "salesforce-agentforce-integration" description: "Connect Salesforce Agentforce to Document360 via API for read-only, keyword-based answers from published articles with trusted links—no content sync required." tags: ["Salesforce Agentforce"] updated: 2026-11-25T10:58:17Z published: 2026-11-25T10:58:17Z canonical: "docs.document360.com/salesforce-agentforce-integration" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.document360.com/llms.txt > Use this file to discover all available pages before exploring further. # Setting up the Salesforce Agentforce integration Connect a Salesforce Agentforce agent to your Document360 knowledge base so it can answer questions from your published articles. The agent searches your articles through the Document360 API (v3), reads the best match, and answers from its text with a link to the article. Your content stays in Document360. Nothing is copied or synced into Salesforce. This article walks you through creating an API key, connecting Salesforce to the Document360 API, building the Flows and agent actions, and setting up the agent. NOTE This setup is different from the [Salesforce integration](https://docs.document360.com/docs/salesforce), which adds Document360 to the Salesforce console for support agents. Use this article if you want an Agentforce agent to answer questions from your knowledge base. --- ## How it works When a user asks a question, the agent runs two Salesforce Flows in order: 1. **Search Document360 Articles** searches your published articles by keyword and returns up to three titles and article IDs. 2. **Get Document360 Article** fetches the best match and returns its title, link, and content. The agent then writes its answer from that article text. Both Flows call the Document360 API through one Salesforce Named Credential that holds your API key. The agent only returns published articles: - If an article has a newer draft, the agent uses the latest published version. - If an article was never published or is hidden, the agent replies that the article is not available and shares no content or links. - Snippets, variables, and glossary terms are resolved, and internal notes are removed. The integration is read-only. The agent can't create, edit, or publish articles. --- ## Before you begin - Your Document360 plan must include API access. - You need a workspace with published articles, and permission to create an API key in Document360. - You need a Salesforce org with Agentforce enabled, admin access, and access to Agentforce Studio. - Save the two OpenAPI specifications in [OpenAPI specifications](/docs/salesforce-agentforce-integration#openapi-specifications) as `.yaml` files. You import them in Stage 3. - You need a terminal to test the API. In Windows PowerShell, type `curl.exe` instead of `curl`. The integration uses two Document360 API (v3) endpoints: | API | Endpoint | Used for | | --- | --- | --- | | Search workspace articles | `GET /v3/projects/{project_id}/workspaces/{workspace_id}/search` | Find published articles by keyword | | Get article | `GET /v3/projects/{project_id}/articles/{article_id}` | Fetch one article's title, link, and content | --- ## Set up the Salesforce Agentforce integration Setting up the integration involves eight stages. Complete them in order, because each stage depends on the one before it: 1. [Create an API key and note your IDs](/docs/salesforce-agentforce-integration#stage-1-create-an-api-key-and-note-your-ids) 2. [Create the Salesforce credentials and permissions](/docs/salesforce-agentforce-integration#stage-2-create-the-salesforce-credentials-and-permissions) 3. [Add the External Services](/docs/salesforce-agentforce-integration#stage-3-add-the-external-services) 4. [Create the Flows](/docs/salesforce-agentforce-integration#stage-4-create-the-flows) 5. [Create the agent actions](/docs/salesforce-agentforce-integration#stage-5-create-the-agent-actions) 6. [Create the agent and subagent](/docs/salesforce-agentforce-integration#stage-6-create-the-agent-and-subagent) 7. [Set up language support](/docs/salesforce-agentforce-integration#stage-7-set-up-language-support) (optional) 8. [Add a Trusted URL](/docs/salesforce-agentforce-integration#stage-8-add-a-trusted-url) --- ### Stage 1: Create an API key and note your IDs At the end of this stage, you have an API key, a project ID, and a knowledge base workspace ID. 1. In Document360, navigate to **Settings** () > **Knowledge base portal** > **API keys**. 2. Click **Create API key**. If the page shows two tabs, use **Enhanced keys (v3)**. 3. Enter a name for the key, such as *Salesforce Agentforce - Read only*. 4. Choose a portal role and a content role that can view articles. Set the content access to the workspace the agent should answer from. 5. Click **Generate key** and copy the key. It's shown only once and can't be retrieved later. NOTE Every conversation uses this one key, so the agent can reach any article the key can view, whoever is asking. Limit the key's content access to the articles you want the agent to use. For more information, see [API keys](https://docs.document360.com/docs/api-keys). 1. Note the API host for your region. You use it in the commands below and in Stage 2. | Region | Host | | --- | --- | | Default | `https://apihub.document360.io` | | US data center | `https://apihub.us.document360.io` | | Private hosting | `https://apihub.<subdomain>.document360.io` | 1. List your projects to find your project ID. Replace `YOUR_KEY` with your key. ``` curl -i "https://apihub.document360.io/v3/projects" --header "X-API-Key: YOUR_KEY" ``` 1. List the workspaces in your project. Note the ID of the workspace whose `workspace_type` is `KnowledgeBase`, not `ApiDocumentation`. ``` curl -i "https://apihub.document360.io/v3/projects/PROJECT_ID/workspaces" --header "X-API-Key: YOUR_KEY" ``` 1. Test a search and an article fetch, using a keyword and an article ID from a published article. ``` curl -i "https://apihub.document360.io/v3/projects/PROJECT_ID/workspaces/WORKSPACE_ID/search?query=KEYWORD&page_size=3" --header "X-API-Key: YOUR_KEY" curl -i "https://apihub.document360.io/v3/projects/PROJECT_ID/articles/ARTICLE_ID?published=true&content_mode=display" --header "X-API-Key: YOUR_KEY" ``` If the key works, the search returns a response like this: ``` {"data":[{"article_id":"...","title":"...","category_id":"...","slug":"...","version":1}],"pagination":{"page":1,"page_size":3,"total_count":1,"has_more":false},"success":true} ``` If you get a `401` or `403`, or a published article is missing, see [Troubleshooting](/docs/salesforce-agentforce-integration#troubleshooting). --- ### Stage 2: Create the Salesforce credentials and permissions At the end of this stage, you have a Named Credential that sends your API key, and a permission set that the agent's user holds. #### Create the permission set 1. In Salesforce, navigate to **Setup** > **Permission Sets**. 2. Click **New**. 3. Enter **D360 API Access** as the label, leave the license empty, and click **Save**. #### Create the External Credential 1. Navigate to **Setup** > **Named Credentials**. 2. Open the **External Credentials** tab and click **New**. 3. Enter the following values and click **Save**: - **Label**: Document360 API - **Name**: Document360_API - **Authentication Protocol**: Custom 4. Under **Principals**, click **New** and enter the following values: - **Parameter Name**: D360Principal - **Sequence Number**: 1 - **Identity Type**: Named Principal 5. Edit the principal and add an authentication parameter named `ApiToken`. Paste your API key as the value, with no brackets, quotes, or spaces. 6. Under **Custom Headers**, click **New** and enter the following values: - **Name**: X-API-Key - **Value**: `{!$Credential.Document360_API.ApiToken}` - **Sequence Number**: 1 ![External Credential page with the D360Principal principal and the X-API-Key custom header](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/01-external-credential.png) ![Edit Principal dialog with the ApiToken authentication parameter](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/02-edit-principal.png) #### Create the Named Credential 1. Open the **Named Credentials** tab and click **New**. 2. Enter the following values: - **Label**: Document360 API - **Name**: Document360_API - **URL**: your API host from Stage 1 - **External Credential**: Document360 API 3. Under **Callout Options**, clear **Generate Authorization Header** and select **Allow Formulas in HTTP Header**. 4. Click **Save**. Leave **Custom Headers** on the Named Credential empty. The `X-API-Key` header comes from the External Credential. ![Named Credential page with Allow Formulas in HTTP Header selected](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/03-named-credential.png) #### Grant access to the credential 1. Open the **D360 API Access** permission set. 2. Under **External Credential Principal Access**, enable **Document360_API - D360Principal**. 3. Under **Object Settings** > **User External Credentials**, click **Edit**, select **Read** only, and click **Save**. If **Find Settings** doesn't find it, open **Object Settings** and search the page for *User External*. 4. Click **Manage Assignments** and assign the permission set to yourself and to the agent's user. You can find the agent's user under **Agent's User Record** in the agent's settings, for example *EinsteinServiceAgent User*. ![User External Credentials object settings with Read selected](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/04-user-external-credentials.png) ![D360 API Access permission set assignments with the agent user assigned](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/05-permission-set-assignments.png) --- ### Stage 3: Add the External Services At the end of this stage, you have two External Services with one operation each. Keeping them separate means a change to one can't break the other. | Service name | Specification file | Operation | | --- | --- | --- | | Document360V3 | `document360-v3-articles-openapi.yaml` | getArticleV3 | | Document360Search | `document360-v3-search-openapi.yaml` | searchWorkspaceArticles | To add each External Service, 1. Navigate to **Setup** > **External Services**. 2. Click **Add an External Service** and select **From API Specification**. 3. Enter the service name from the table and select the **Document360 API** Named Credential. 4. Upload the specification file. 5. If Salesforce asks about `application/problem+json`, map it to `application/json`. 6. Select the operation from the table, click **Next**, then click **Done**. ![Document360V3 External Service with the getArticleV3 operation](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/06-external-service-get-article.png) ![Document360Search External Service with the searchWorkspaceArticles operation](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/07-external-service-search.png) To check that it worked, open the **Action** picker in any Flow and search for `getArticleV3` and `searchWorkspaceArticles`. Both appear. --- ### Stage 4: Create the Flows At the end of this stage, you have two active autolaunched Flows. NOTE Create every Text variable as single-value, with **Allow multiple values (collection)** cleared. Otherwise, the action inputs report a data type mismatch. #### Create the Get Document360 Article Flow 1. Navigate to **Setup** > **Flows** and click **New Flow**. 2. Select **Autolaunched Flow (No Trigger)**. 3. In the **Toolbox**, click **New Resource** and create each resource in this table: | Resource | Type | Settings | | --- | --- | --- | | ArticleId | Variable, Text | Available for input | | LangCode | Variable, Text | Available for input | | ProjectId | Constant, Text | Your project ID from Stage 1 | | ArticleText | Variable, Text | Available for output | | ArticleTemplate | Text Template | View as Plain Text | | ArticleTextClean | Formula, Text | See step 7 | 1. Add the **Document360V3: Get Article V 3** action and set its inputs: **Published** returns the latest published version instead of a newer draft. **Content Mode** set to `display` resolves snippets, variables, and glossary terms, and removes internal notes. - **Article Id**: ArticleId - **Project Id**: ProjectId - **Content Mode**: Included, `display` - **Lang Code**: Included, `{!LangCode}` - **Published**: Included, `{!$GlobalConstant.True}` ![Get Article V 3 action inputs with Content Mode, Lang Code, and Published included](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/09-get-flow-action-inputs.png) 1. Open **ArticleTemplate** and build its body with **Insert a resource**, using the fields under the action's **200** > **data**: ``` Title: [title] Link: [url] Content: [content] [html_content] ``` ![ArticleTemplate text template set to View as Plain Text](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/08-get-flow-text-template.png) 1. Add a Decision named **Check Article**. Name its first outcome **Blocked**, select **Any Condition Is Met (OR)**, and add three conditions using the action's **200** > **data** fields: - `public_version` **Equals** 0 - `public_version` **Is Null** True - `hidden` **Equals** True ![Blocked outcome with Any Condition Is Met (OR) and its three conditions](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/10-get-flow-decision-conditions.png) NOTE Keep the **Is Null** condition. An unpublished article returns `public_version` as null, not 0, so **Equals 0** alone lets draft text through. 1. Open **ArticleTextClean** and enter this formula. It removes the `<style>` block that `display` mode adds to the end of the article. ``` IF(CONTAINS({!ArticleTemplate}, "