Skip to content
Last updated

Knowledge Hub Content Manager API Overview

Introduction

Welcome to the eGain Knowledge Hub Content Manager API Guide. The Content Manager API enables enterprises to author, organize, import, and validate knowledge content in the knowledge base. It provides programmatic access to articles, folders, topics, prompt templates, and bulk import operations used by authors and knowledge managers. Built on OAuth 2.0 authentication, the API ensures secure, scoped, and role-aware access for users with a Knowledge + AI license. Typical callers hold the Author or Knowledge Base Manager role, or a custom role with the matching resource action. These APIs are subject to per-endpoint rate limits; see Usage Plans & Rate Limits.

Capabilities

The API covers these operations:

  • Create, retrieve, and edit articles, including article content, attachments and article metadata.
  • Check out articles for editing, and retrieve published or latest versions as needed.
  • Publish articles after authoring edits are complete.
  • Create and maintain the folder tree used to organize knowledge content.
  • Create, retrieve, edit, and delete manual topics. Topics generated from folders can be retrieved and their articles follow the folder.
  • Get and edit the article order within a topic.
  • Bulk-import knowledge content from Amazon S3 buckets or SFTP servers.
    • Validate content structure, format, and compliance before importing into production.
    • Monitor, pause, resume, cancel, and schedule import jobs, including validation hooks.

Common Use Cases

  • Legacy Knowledge Migration: Import large volumes of content from external sources into eGain using the documented import format, reducing time spent on manual authoring.
  • Scheduled Bulk Updates: Run regular content updates from Amazon S3 or SFTP, including off-peak scheduled imports, so production content stays current.
  • Pre-Production Validation: Validate content against structure, language, and business rules before a production import, catching issues without changing existing data.
  • Knowledge Structure Authoring: Create and maintain folders, topics, and articles programmatically.
  • Programmatic Edit and Publish: Check out an article, save edits, and publish the updated version through a sequence of API calls.
  • Prompt Template Access: Retrieve department and language-specific prompt templates used in authoring and AI-assisted workflows.

Common Authoring API Sequences

Authoring goals often require calling multiple APIs in a specific order. The examples below use Content Manager v4 endpoints. For bulk structure and content, prefer the Ingestion API.

Create a root folder and articles in it

  1. Create a root-level folder with POST /folders and an explicit department.id in the request body. Save the folder ID from the Location response header. Each folder auto-creates a matching "Topics From Folders" topic.
  2. Create articles in that folder with POST /articles, using the folder ID. Newly created articles start checked out to the caller.

To attach files or publish, see Edit and publish below. After article creation, you already hold the lock, so the first publish does not need checkout.

Create a top-level topic, add articles, set order

  1. Create a top-level topic with POST /topics and department.id in the request body. To create under an existing topic instead, supply parent.id. Save the topic ID from the Location response header and the ETag response header. You can include initial links (rel: article, article self-link in href) on create if the articles are already known.
  2. Get the topic with GET /topics/{topicIDs}?$lang=... to confirm it and refresh the ETag response header before edits.
  3. Add existing articles with PATCH /topics/{topicIDs} using links (rel: article) and the topic If-Match request header. To associate from the article side instead, use PATCH /articles/{articleIDs} with rel: topic. Use unlinks on edit to remove articles from the topic.
  4. Set article order with GET /topics/{topicIDs}/articleorder to read pinned top and bottom lists, then PATCH /topics/{topicIDs}/articleorder to pin articles to the top or bottom. Send the topic If-Match request header from a prior GET or POST.

Edit and publish

  1. Get the latest version with GET /article/{articleID}?versionSelector=latest. Use latest to fetch the draft version you can edit, not published. Save the ETag response header. Inspect lockedBy in the response body before you plan an edit.
  2. Check out with PUT /articles/{articleIDs}/checkout if you do not already hold the lock. If another user holds it, the API returns 409 Conflict.
  3. Preupload an attachment. Attachments and images must be uploaded before they are referenced; Content Manager does not accept raw file bytes in the article payload. Pre-upload with the File Manager Generate URL to upload a file API (POST /assets/preupload), with application request body parameter set to article. For attachments, set isInline request body parameter to false. Send the file bytes to the returned uploadUrl, then provide returned fileUploadId in versions[].attachments request body parameter on the next Article PATCH. For uploading inline images, set isInline to true and then include fileUploadId in the image tag in the article's content in the next Article PATCH.
  4. Publish with PATCH /articles/{articleIDs}?operation=publish, including any attachment or content changes in that request.
    • Send the saved ETag in the If-Match request header so you are publishing the version you retrieved. After each successful PATCH, use the new ETag response header before the next edit or publish.
    • Use operation=edit to save and stay checked out, or operation=checkin to save and release the lock without publishing.

Delete a folder and check job status

  1. Delete with DELETE /folders/{folderIDs}. The folder must be empty, or pass deleteUnreferencedArticles=true. If the folder is referenced as a topic in a portal, pass deleteIfUsedInPortal=true.
  2. Check job status. Deletion is asynchronous: a 202 Accepted response includes a Location header. Poll Get Async Job Status at that URL (core/infomgr/v4/async/job/{jobID}).

Working with the API

  1. Secure Access

    • Applications authenticate using OAuth 2.0 with Content Manager read or manage scopes. Authoring operations also support on-behalf-of user scopes.
    • Logged-in users must have a Knowledge + AI license. Operations require the Author or Knowledge Base Manager role, or a custom role with the matching resource action.
  2. Folder and Topic Structure

    • Create, edit, retrieve, and delete folders to organize knowledge content.
    • Create topics at department level or under a parent topic. Retrieve topics, including topics generated from folders.
    • Get and edit the article order for a topic.
  3. Article Authoring

    • Create articles in a folder; newly created articles start in the checked-out state.
    • Retrieve an article by ID with content, choosing published or latest draft.
    • Retrieve multiple articles by ID without content (summary and requested attributes).
    • Check out articles for editing, save changes, and publish when ready.
  4. Import and Validation

    • Validate content before import to check structure, format, language support, and business rules.
    • Create import jobs from supported data sources (Amazon S3 and SFTP).
    • Configure validation hooks, then pause, resume, or cancel jobs as needed.
  5. Monitor and Iterate

    • Check import job status and access detailed logs.
    • Use the import health endpoint to confirm the import service is available.
    • Retrieve prompt templates filtered by department and language.

Additional Resources