Skip to main content
NiCE KnowledgeKnowledge
NiCE Knowledge Success Center

Retrieve page content as Markdown

NiCE KM can return a rendered page as Markdown instead of HTML. This is meant for AI agents, Retrieval-Augmented Generation (RAG) pipelines, and custom integrations that read your published content. The agent receives the article text without the surrounding page theme, so there is less to strip out before the content reaches the model.

The page is negotiated through the standard HTTP Accept header, so there is no new API path or endpoint. A browser is unaffected and still receives the usual HTML page.

This article explains how the feature works, how to enable it, and how to consume it from an agent.

Why Markdown for agents

HTML is an awkward input format for an agent. Along with the article text, it carries navigation, theme wrappers, inline scripts, and security headers that cost tokens without adding meaning. Markdown gives the agent the article's headings, links, lists, and images in a form most models already read and write well.

The Markdown response also starts with a short YAML front matter block of page metadata: id, title, uri, revision, modified date, and tags. An agent can read that block to track where the content came from and whether it has changed, without a second API call.

Availability

Markdown content negotiation is enabled per site by NiCE. To have it turned on for your site, contact NiCE Support. General availability is planned for an upcoming release, after which no request is needed.

Once the feature is on, any request whose highest-priority Accept media type is text/markdown receives the Markdown representation of the requested page.

How to retrieve content as Markdown

Send a GET request to any page URL with an Accept: text/markdown header. Negotiation is strict (RFC 9110): Markdown comes back only when text/markdown is the single highest-priority media type in the Accept header. A browser's default Accept header (text/html,application/xhtml+xml,...) never matches, so ordinary page views are unaffected.

Example request: cURL

curl -H "Accept: text/markdown" https://expert-help.nice.com/

Example response

The example cURL request returns the Homepage as Markdown, starting with the YAML front matter block:

---
id: 1
title: "Home"
uri: "https://expert-help.nice.com/"
revision: 389
modified: "2026-04-28T19:08:38Z"
dynamic: true
tags: ["article:topic-category", "Support"]
---

### Unlock the power of AI-enhanced knowledge for digital self-service

    - ![GenAI.svg](https://expert-help.nice.com/@api/deki/files/18355/GenAI.svg?revision=1)
- Optimize your knowledge for GenSearch
    - [GenSearch training and certification](https://expert-help.nice.com/Integrations_and_Extending_Content/AI_and_LLM_features/GenSearch_Adoption_and_Utilization_Companion/GenSearch_Fundamentals_-_Training_Videos_and_Course_Certifications)  [GenSearch onboarding and adoption](https://expert-help.nice.com/Integrations_and_Extending_Content/AI_and_LLM_features/GenSearch_Adoption_and_Utilization_Companion/GenSearch_Onboarding_and_Adoption_Guide)  [Analyze GenSearch data and improve content efficacy](https://expert-help.nice.com/Integrations_and_Extending_Content/AI_and_LLM_features/Analyze_GenSearch_data_and_improve_content_efficacy)

### Support resources

- <button onclick="location.href='/Admin/Release_Notes'" title="Release Notes">Release notes</button>
- <button onclick="location.href='/Admin/Contact'" title="Support">Contact support</button>
- <button onclick="location.href='/Admin/Contact'" title="Customer community">Customer community</button>

Point the request at any page's URL on a Markdown-enabled site to try it against that page.

Front matter fields

Field Description
id The page ID
title The page title
uri The canonical page URL
revision The current revision number. Use it to detect changes.
modified The last-modified timestamp (UTC)
dynamic Whether the page contains dynamic content
tags The page's tags, including its article type

Authentication and permissions

Turning the feature on does not expose anything beyond what the requesting user could already view as HTML. Markdown content negotiation uses the same authentication methods as the rest of the NiCE KM API, and it returns only the content the user is allowed to see.

Anonymous requests are allowed. Without any token, a request receives the site's public content, the same content an anonymous visitor sees in a browser. The previous cURL example is an anonymous request.

To read restricted content, authenticate the request with a Server API Token or a Long-term JWT, the same way you would for other API calls. See Integrating with Generative AI Tools via the Expert API for token setup.

Behavior and limitations

  • Strict negotiation: Markdown comes back only when text/markdown is the single highest-priority media type in the Accept header. Otherwise, the page renders as HTML.
  • Excluded page types: Draft, template, special, virtual, and redirect pages always render as HTML and are never served as Markdown.
  • Caching: The Markdown response is cached per site, page, and revision; an edited page produces fresh Markdown on its next request.
  • Fallback: If Markdown cannot be produced for a page, the request falls back to the standard HTML response.

Recommended workflow for agents

  1. Authenticate (if needed): Public content requires no token. To read restricted content, see Integrating with Generative AI Tools via the Expert API.
  2. Discover pages: Use GET /@api/deki/pages or GET /@api/deki/site/query to find the pages you want to ingest.
  3. Request Markdown: For each page URL, send Accept: text/markdown and capture the response.
  4. Track freshness: Store the revision field from the front matter and re-fetch when it changes.
  • Was this article helpful?