Automate Section Enrichment in Sitecore Stream Using Enrichment Pipeline API



Today, I am going to provide a thorough and step-by-step explanation of the new pipeline that runs for enrichment, one of the latest endpoints introduced in Sitecore Stream. This pipeline automates the management and enhancement of section and subsection content within brand kits in Sitecore Stream.

To begin, let us first understand what Sitecore Stream is. Sitecore Stream is an AI platform that brings AI capabilities to Sitecore products, fundamentally changing the way marketers create and manage their content. Sitecore Stream is built on the Microsoft Azure OpenAI Service and uses advanced large language models (LLMs) to help teams ideate, create, and refine on-brand content quickly and securely. Sitecore Stream simplifies everyday marketing tasks, such as content creation, developing campaigns, and personalizing messages. Sitecore Stream supports work to happen across multiple brands and complex campaigns while creating an organization that is organized and maintains pace. Sitecore Stream is AI-first in its approach, effectively capturing your brand's voice while also automating daily workflows for your team by enabling them to do more in a shorter timeframe. Because Sitecore Stream is AI-enabled, it helps marketing teams to increase levels of efficiency, strengthen team collaboration, and deliver high-quality end-user experiences throughout all stages of the engagement lifecycle with your brand.

Introducing the Enrichment Pipeline

In July 2025, Sitecore introduced a new, powerful enrichment pipeline endpoint specifically designed to automatically enrich brand kit sections and subsections with AI-generated metadata, classifications, and structure recommendations. This allows for automation and intelligence in organizing brand assets by improving discoverability, alignment, and reuse across teams.


Implementing the Enrichment Pipeline

This technical guide will provide a comprehensive walkthrough for implementing the enrichment pipeline endpoint, including authentication, request and response handling, and a production-ready C# code example to automate the enrichment of brand kit sections and subsections.

Base API Endpoint:

POST /api/data/v1/organizations/{organizationId}/pipeline/EnrichSectionsPipeline

This pipeline intelligently analyzes the content and structure of each section within a brand kit. It then enriches that data with meaningful metadata such as tags, classifications, and contextual insights generated by AI. By doing so, it transforms raw section data into structured, discoverable, and reusable information. This capability is especially valuable for organizations aiming to scale their content operations, enhance brand consistency, and leverage AI-driven enrichment to maintain quality and efficiency across multiple campaigns and teams.

Prerequisites

Before proceeding with the implementation of the endpoint, ensure the following:

1. Sitecore Stream Account - You must have administrative rights for the Sitecore Stream account.
2. Brand Kit Keys - You must have the Client ID and Client Secret for the brand kit you are going to work with.
3. Existing Brand Kit - The brand kit must already exist and contain at least one section.
4. Organization ID - You can retrieve it from your Stream instance.
5. Development Environment - C#

Step-by-Step Implementation Guide: Run Enrichment Pipeline

Let us now deep dive into the technical implementation of the Enrichment Pipeline endpoint.

1. Authenticate with the Sitecore Stream API

Before making any API calls, it is necessary to obtain an access token using your Client ID and Client Secret.

Token Endpoint:

POST https://auth.sitecorecloud.io/oauth/token

Request Body:

{
  "client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "client_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "audience": "https://api.sitecorecloud.io",
  "grant_type": "client_credentials"
}

Note: Replace client_id and client_secret with your own values. Refer to my previous blog, How to Install and Configure Sitecore Stream for Platform DXP, to learn how to obtain them.

Response:

{
  "access_token": "{YOUR_ACCESS_TOKEN}",
  "scope": "ai.org.brd:w ai.org.brd:r ai.org.docs:w ai.org.docs:r ai.org:admin",
  "expires_in": 86400,
  "token_type": "Bearer"
}

Save the access_token obtained for authorization in subsequent requests.


2. Construct the Enrichment Pipeline Request

Now we are ready to call the new endpoint for Enrichment Pipeline to initiate the enrichment process for selected brand kit sections and subsections.

POST /api/data/v1/organizations/{organizationId}/pipeline/EnrichSectionsPipeline

Note: Replace organizationId with your Sitecore Stream organization ID.

Headers:

Authorization: Bearer {access_token}
Content-Type: application/json

Request Body:

{
  "parameters": {
    "brand_kit_id": "98689dd5-1684-48cb-a339-d9610dbd7986",
    "sectionId": "b2f2e1a1-295d-4d40-88f2-93bf545bb878",
    "fieldId": "b2f2e1a1-295d-4d40-88f2-93bf545bb878"
  }
}

Note: Replace brandkitId with the target brand kit’s ID, sectionId with the ID of the section that contains the field you want to enrich, and fieldId with the ID of the specific field to be enriched.

This tells the Sitecore Stream to enrich the specified field of the section of a brand kit using the AI pipeline.

Response:

Successful Response (201 Created):

{
  "createdOn": "2025-04-23T13:55:13.308326",
  "createdBy": "mman",
  "updatedOn": "2025-04-23T13:55:13.308326",
  "updatedBy": "mman",
  "id": "e774b4b6-204e-11f0-a62d-3e62ff39b87e",
  "pipelineId": "string",
  "parameters": {
    "brand_kit_id": "98689dd5-1684-48cb-a339-d9610dbd7986",
    "org_id": "org_ZiiCnzhCeHDpWJAU",
    "baseUrlDocAPI": "https://ai-documents-api-euw.sitecorecloud.io"
  },
  "runStart": "2025-06-18T12:46:12.718310",
  "runEnd": "2025-06-18T12:46:12.718310",
  "durationInMs": 3,
  "status": "Succeeded",
  "message": ""
}

The response confirms that the enrichment pipeline has been successfully initiated and provides the ID, which can be used for further management.

Use Cases

This API unlocks several powerful features for marketers and business users:
1. Automatic Metadata - The API can automatically add helpful tags like tone, region, intent, or sentiment to each section, saving time and reducing manual work.
2. Easier Search - With richer metadata, it becomes much easier to find the right content quickly using search tools.
3. Smarter Content Checks - AI can spot missing details, suggest improvements, and make sure all sections match your brand’s style and message.
4. Scales Easily - You can run enrichment for many sections or even entire brand kits at once, making it simple to manage large amounts of content.

C# Implementation

public async Task<string> RunSectionEnrichmentAsync(string accessToken, string organizationId, string brandKitId, string sectionId, string fieldId)
{
    HttpClient client = new HttpClient();
    client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);

    var payload = new
    {
        brand_kit_id = brandKitId,
        sectionId = sectionId,
	fieldId = fieldId
    };

    var content = new StringContent(JsonConvert.SerializeObject(payload), Encoding.UTF8, "application/json");
    var response = await client.PostAsync($"https://ai-brands-api-use.sitecorecloud.io/api/data/v1/organizations/{organizationId}​/pipeline/EnrichSectionsPipeline", content);

    response.EnsureSuccessStatusCode();
    var result = await response.Content.ReadAsStringAsync();
    Console.WriteLine(result);
	
    return result;
}

With the new Enrichment API, Sitecore Stream empowers developers and brand managers to enhance their brand kits with AI-driven insights. You can now move beyond static content and automatically enrich sections with meaningful metadata, improving organization, searchability, and overall content quality.

Chirag Goel

I am a developer, likes to work on different future technologies.

Post a Comment (0)
Previous Post Next Post