Tag: Sitecore

Sitecore AI Content Migration – Retrieve the transfer details

Once the transfer is complete you should be able to see the transferred items and their details. Along with this you can run a clean up process.

See the blog post on how to create a transfer in source environment – Link

See the blog post on how to consume chunks in destination environment – Link

To generate the Automation client and token see this blog post – Link

Retrieve Transferred Items

Http Method – GET

Url – https://your-xmc-instance.sitecorecloud.io/sitecore/shell/api/v3/ItemsTransfer/transfers/databases/master/sources/{sourceName}/items?page=1&pageSize=50

Example- https://your-xmc-instance.sitecorecloud.io/sitecore/shell/api/v3/ItemsTransfer/transfers/databases/master/sources/contentTransfer-1ec8122c-a25e-49b0-a0fb-bd47dfccdf8b-30fca7fa-0775-436f-957e-71b74b1ef6ef.raif/items?page=1&pageSize=50

Response –

{
    "Items": [
        {
            "SourceName": "consumed.20260719 071845 158815.6f8c1b94-25df-49df-bc4e-05fd58dcc9ac",
            "TimeStamp": 639200423251588150,
            "TimeStampDate": "2026-07-19T07:18:45.158815Z",
            "IsTransferred": true,
            "MasterId": "00000000-0000-0000-0000-000000000000",
            "ParentId": "0de95ae4-41ab-4d01-9eb0-67441b7c2450",
            "TemplateId": "76036f5e-cbce-46d1-af0a-4143f9b557aa",
            "Name": "Home",
            "Id": "110d559f-dea5-42ea-9c1c-8a5df7e70ef9"
        },
        {
            "SourceName": "consumed.20260719 071845 158815.6f8c1b94-25df-49df-bc4e-05fd58dcc9ac",
            "TimeStamp": 639200423251588150,
            "TimeStampDate": "2026-07-19T07:18:45.158815Z",
            "IsTransferred": true,
            "MasterId": "00000000-0000-0000-0000-000000000000",
            "ParentId": "110d559f-dea5-42ea-9c1c-8a5df7e70ef9",
            "TemplateId": "76036f5e-cbce-46d1-af0a-4143f9b557aa",
            "Name": "Sample Item",
            "Id": "3ce168e8-27dd-47a7-98ee-26bfd681eb9a"
        }
    ],
    "Page": 1,
    "PageSize": 50,
    "TotalCount": 2
}

Retrieve Transferred Item Details

Http Method- GET

Url- https://your-xmc-instance.sitecorecloud.io/sitecore/shell/api/v3/ItemsTransfer/transfers/databases/master/sources/{sourceName}/items/{itemID}

Example- https://your-xmc-instance.sitecorecloud.io/sitecore/shell/api/v3/ItemsTransfer/transfers/databases/master/sources/contentTransfer-1ec8122c-a25e-49b0-a0fb-bd47dfccdf8b-30fca7fa-0775-436f-957e-71b74b1ef6ef.raif/items/3ce168e8-27dd-47a7-98ee-26bfd681eb9a

Response –

{
    "Fields": [
        {
            "Version": 1,
            "Language": "en",
            "Value": "Sample Item for Content Transfer",
            "Id": "75577384-3c97-45da-a847-81b00500e250"
        },
        ...
    ],
    "SourceName": "consumed.20260719 071845 158815.6f8c1b94-25df-49df-bc4e-05fd58dcc9ac",
    "TimeStamp": 639200423251588150,
    "TimeStampDate": "2026-07-19T07:18:45.158815Z",
    "IsTransferred": true,
    "MasterId": "00000000-0000-0000-0000-000000000000",
    "ParentId": "110d559f-dea5-42ea-9c1c-8a5df7e70ef9",
    "TemplateId": "76036f5e-cbce-46d1-af0a-4143f9b557aa",
    "Name": "Sample Item",
    "Id": "3ce168e8-27dd-47a7-98ee-26bfd681eb9a"
}

OperationHTTP Method & EndpointDescriptionUse Case
List Transferred ItemsGET /transfers/databases/{databaseName}/sources/{sourceName}/itemsReturns a paginated list of items that have been transferred for an ongoing or completed transfer in the specified database and source.Use this endpoint to view all items included in a specific transfer and navigate through them using pagination.
Get Transferred Item DetailsGET /transfers/databases/{databaseName}/sources/{sourceName}/items/{itemId}Returns detailed information for a specific transferred item, including all captured metadata and localized/versioned field information for the given itemId, database, and source.Use this endpoint to inspect the complete details of an individual transferred item, including its field values, versions, and metadata.

Sitecore AI Content Migration – Consume the chunks in destination environment

See the blog post on how to create a transfer in source environment – Link

To generate the Automation client and token see this blog post – Link

State of content tree in source environment

State of content tree in destination environment before migration

Step 1 – Save Data Chunk

Destination environment

Http Method – PUT

Url – https://your-xmc-instance.sitecorecloud.io/sitecore/api/content/transfer/v1/transfers/{transferID}/chunksets/{chunksetID}/chunks/{chunkID}

Example- https://your-xmc-instance.sitecorecloud.io/sitecore/api/content/transfer/v1/transfers/004d321e-1100-4e41-ad25-465fb304ee5a/chunksets/95e3b762-a002-4333-b141-13cdc513b1ee/chunks/0

Headers-

Content-Type: application/octet-stream

Authorization – token

Payload– Attach the file (response.bin)

Response-

201 – Created

This saves the chunck to the Azure Blob

Step 2 – Complete the chunk set 

Http Method- Post

Url- https://your-xmc-instance.sitecorecloud.io/sitecore/api/content/transfer/v1/transfers/{transferID}/chunksets/{chunksetID}/complete

Example – https://your-xmc-instance.sitecorecloud.io/sitecore/api/content/transfer/v1/transfers/1ec8122c-a25e-49b0-a0fb-bd47dfccdf8b/chunksets/30fca7fa-0775-436f-957e-71b74b1ef6ef/complete

Headers-

Authorization – token

Payload– Not Applicable

Response-

{
    "ContentTransferFileName": "contentTransfer-1ec8122c-a25e-49b0-a0fb-bd47dfccdf8b-30fca7fa-0775-436f-957e-71b74b1ef6ef.raif"
}

Note down the file name with extension raif

Step 3 – Verify the blob

Http Method- Get

Url- https://your-xmc-instance.sitecorecloud.io/sitecore/shell/api/v3/ItemsTransfer/sources/blobs

Headers-

Authorization – token

Response-

{
    "Sources": [      
        {
            "Name": "contentTransfer-1ec8122c-a25e-49b0-a0fb-bd47dfccdf8b-30fca7fa-0775-436f-957e-71b74b1ef6ef.raif",
            "BlobState": "Uploaded"
        }        
    ],
    "Page": 1,
    "PageSize": 50,
    "TotalCount": 3
}

Check the BlobState- Uploaded

Step 4 – Consume Blob (Transfer chunk)

Http Method- POST

Url- https://your-xmc-instance.sitecorecloud.io/sitecore/shell/api/v3/ItemsTransfer/transfers/databases/master/sources?blobName=contentTransfer-{transferID}{chunksetID}.raif

Example – https://your-xmc-instance.sitecorecloud.io/sitecore/shell/api/v3/ItemsTransfer/transfers/databases/master/sources?blobName=contentTransfer-1ec8122c-a25e-49b0-a0fb-bd47dfccdf8b-30fca7fa-0775-436f-957e-71b74b1ef6ef.raif

Headers-

Authorization – token

Response

202 – Accepted

Verify the blob and you should see the BlobState changed to – Transferred. The earlier state was Uploaded

If transfer has issues ths state will be – TransferredWithErrors

  {
            "Name": "contentTransfer-1ec8122c-a25e-49b0-a0fb-bd47dfccdf8b-30fca7fa-0775-436f-957e-71b74b1ef6ef.raif",
            "BlobState": "Transferred"
        },

Monitor Transfer Status

Http Method – GET

Url – https://your-xmc-instance.sitecorecloud.io/sitecore/shell/api/v3/ItemsTransfer/transfers

Response –

{
    "Transfers": [        
        {
            "Id": "consumed.20260719 073111 3698598.6d40ff72-58e9-4940-a0bc-a88909f8f3a7",
            "SourceName": "contentTransfer-1ec8122c-a25e-49b0-a0fb-bd47dfccdf8b-30fca7fa-0775-436f-957e-71b74b1ef6ef.raif",
            "DatabaseName": "master",
            "ConsumedDate": "2026-07-19T07:31:11.3698598Z",
            "TransferState": "Finished",
            "Strategy": "OverrideExistingItem",
            "Description": null
        }        
    ],
    "Page": 1,
    "PageSize": 50,
    "TotalCount": 9
}

Post transfer-

You can also check the items that are transfered. In the next blog we will see how to check the items been transfered with the item details.

Sitecore AI Content Migration – Create transfer and chunks from source environment

To understand the end to end flow for migrating the content between environments, please see this blog post – Link

Pre-requisite – Automation Client and JWT Token

Before starting you will need the JWT token for the request to be made to the Content Transfer API. You should be Sitecore Admin or owner.

To generate the Automation client and token see this blog post – Link

Step 1 – Create Transfer

Used in source environment

Request-

Http Method – POST

URL – https://your-xmc-instance.sitecorecloud.io/sitecore/api/content/transfer/v1/transfers

Headers

Authorization – Bearer token

Payload

{
  "Configuration": {
    "DataTrees": [
      {
        "ItemPath": "/sitecore/content/Home",
        "Scope": "ItemAndDescendants",
        "MergeStrategy": "OverrideExistingItem"
      }
    ],
    "Database": "master"
  },
  "TransferId": "1ec8122c-a25e-49b0-a0fb-bd47dfccdf8b"
}

Response

202 – Accepted

Note the Transfer ID – 1ec8122c-a25e-49b0-a0fb-bd47dfccdf8b

Transfer ID will be used in next API request.

Step 2 – Get Content Transfer

Used in source environment

Get content transfer status or wait for the transfer to be ready

Request

Http Method – GET

Url- https://your-xmc-instance.sitecorecloud.io/sitecore/api/content/transfer/v1/transfers/{transferId}/status

Example – https://your-xmc-instance.sitecorecloud.io/sitecore/api/content/transfer/v1/transfers/1ec8122c-a25e-49b0-a0fb-bd47dfccdf8b/status

Headers

Authorization – token

Payload– Not Applicable

Response

{
    "State": "Completed",
    "ChunkSetsMetadata": [
        {
            "ChunkSetId": "d71458d7-db08-4a74-a125-0d7d4eabf491",
            "ChunkCount": 1,
            "TotalItemCount": 2
        }
    ]
}

Note the chunkSetId – d71458d7-db08-4a74-a125-0d7d4eabf491

Step 3 – Retrieve a chunk

Used in source environment

Method- Get

Url – https://your-xmc-instance.sitecorecloud.io/sitecore/api/content/transfer/v1/transfers/{transferID}/chunksets/{chunksetID}/chunks/{chunkID}

Example – https://your-xmc-instance.sitecorecloud.io/sitecore/api/content/transfer/v1/transfers/1ec8122c-a25e-49b0-a0fb-bd47dfccdf8b/chunksets/d71458d7-db08-4a74-a125-0d7d4eabf491/chunks/0

Headers

Authorization – token

Payload – Not applicable

Response-

Save chunk –

Save response to file (response.bin)

Delete the transfer

Used in source environment

Method – Delete

Url – https://your-xmc-instance.sitecorecloud.io/sitecore/api/content/transfer/v1/transfers/{transferID}

Example- https://your-xmc-instance.sitecorecloud.io/sitecore/api/content/transfer/v1/transfers/1ec8122c-a25e-49b0-a0fb-bd47dfccdf8b

Headers

Authorization – token

Payload – Not applicable

Response

202 Accepted

Summary of API’s

HTTP MethodAPI EndpointPurpose
POST/sitecore/api/content/transfer/v1/transfersCreate a new content transfer.
GET/sitecore/api/content/transfer/v1/transfers/{transferId}/statusRetrieve the status of a specific transfer.
GET/sitecore/api/content/transfer/v1/transfers/{transferId}/chunksets/{chunksetId}/chunks/{chunkId}Download or retrieve a specific chunk from a chunk set.
DELETE/sitecore/api/content/transfer/v1/transfers/{transferId}Delete or cancel a specific transfer.

References

https://developers.sitecore.com/changelog/sitecoreai/01072026/content-transfer-api-and-item-transfer-api-now-available

https://doc.sitecore.com/sai/en/developers/sitecoreai/deploying-sitecoreai/migrating-content-between-sitecoreai-environments.html#alternatives-to-other-package-designer-tasks

https://api-docs.sitecore.com/sai/content-transfer-api

https://api-docs.sitecore.com/sai/item-transfer-api

A Modern Approach to Sitecore Content Migration Using the Content Transfer API and Item Transfer API

Effective 7 July 2026, the Package Designer is no longer available in Sitecore AI. As a result, creating and installing Sitecore packages through the Sitecore Client is no longer supported.

For many years, the Package Designer was one of the most widely used, simplest, and most reliable methods for transferring content between Sitecore environments. However, Sitecore has long provided an alternative through the Sitecore CLI, which supports content serialization and deployment in a more modern, automation-friendly manner.

With the removal of the Package Designer, organizations are encouraged to adopt the Sitecore CLI and the newer Content Transfer and Item Transfer APIs for moving content between Sitecore AI environments.

With the content transfer API uses chunked streaming there is no need to break large migrations into multiple smaller packages formelry we used to do this with the zip package. With the new approach a .raif file is created with the no manual file download or upload.

            SOURCE ENVIRONMENT
      +--------------------------------+
      |   Sitecore CM (Source)         |
      |                                |
      |  Content Transfer API          |
      +---------------+----------------+
                      |
            1. Create Transfer
                      |
                      ▼
              Transfer Service
                      |
            2. Export Content
                      |
                      ▼
             Chunk Set Created
                      |
            3. Download Chunks
                      |
                      ▼
           -----------------------
       Content Transfer (Chunked Streaming)
           -----------------------
            4. Upload Chunks
                      |
                      ▼
            DESTINATION ENVIRONMENT
      +--------------------------------+
      |  Content Transfer API          |
      +---------------+----------------+
                      |
           5. Complete Chunk Set
                      |
                      ▼
            RAIF File Generated
                      |
           6. Verify Blob Exists
             GET /sources/blobs
                      |
                      ▼
             Item Transfer API
                      |
           7. Start Import
                      |
                      ▼
           Import Processing
                      |
                      ▼
          Sitecore Master Database
                      |
                      ▼
           Content Available

Creating authorization for automation client in Sitecore AI

This guide explains how to create and configure authorization for an automation client in Sitecore AI. It covers the prerequisites, steps to register or configure the client, generating the required credentials, assigning appropriate permissions, and validating authentication. By following this guide, you will enable automation tools, scripts, or external applications to securely authenticate with Sitecore AI APIs while adhering to security best practices and the principle of least privilege.

Create the Client credetntials

To generate the environment specific client credentitals select the project and the environment the Client ID and secret to be created for.

Client ID and secret is deplayed. Client secret cannot be shown again, so note this for future use.

Generating JWT token for automation client

Url – https://auth.sitecorecloud.io/oauth/token

client_id – Use your client id

client_secret – use your client secret

audience – https://api.sitecorecloud.io

Use following cuRL command to run the get the token for this client-

curl --location 'https://auth.sitecorecloud.io/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: __cf_bm=LMWhyHFoTdNlwF2MqFxH9AVUQ3FleNAC2Tc3dis4aE8-1784278799.3461177-1.0.1.1-dsinakNmEeHaipvn0cpRI9_Q9p7BQc6JpaI8UYtd24vUJibuJ5xg8GMigR12QLFPl4Sttk1A193_e4mqNdj_Y_23zXG5kHynOcDPJnkuTJu2e9Z.iRZnF5TDBaHSWHjw; did=s%3Av0%3Ae990257e-954d-4c0b-9885-648b225b8582.gnfIQeI146L5TXZF13lXJ%2FSKo%2BQ0L4PDj0xUdYVyqyo; did_compat=s%3Av0%3Ae990257e-954d-4c0b-9885-648b225b8582.gnfIQeI146L5TXZF13lXJ%2FSKo%2BQ0L4PDj0xUdYVyqyo' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=xmcloud.cm:admin' \
--data-urlencode 'client_id=YOUR_CLIENT_ID' \
--data-urlencode 'client_secret=YOUR_CLIENT_SECRET' \
--data-urlencode 'audience=https://api.sitecorecloud.io'

This should generate the JWT token for you to use this to perform automation-

Version issues with Sitecore Graphql Search Query

In this blog post we saw how to use Sitecore Grpahql Search query to filter the items.

But search query has issues with results getting same items with different version in Preview mode. This works fine for the published item (edge) as a single version of item is published.

I created a new version of the same item-

Using the same query

# Write your query or mutation here

query SearchQuery($pageSize: Int = 10, ) {
  search(
    where: {
      AND: [
        {
          name: "_path"
          value: "{B08684BB-3CB0-4DFE-A378-054E26ECC5AE}"
          operator: CONTAINS
        }
        { name: "ProductId", value: "bali-power-bank-3000mah" }
      ]
    }
    first: $pageSize
  ) {
    total
    results {
      id
      name
      version
      url {
        path
      }
	... on Product{
        productId{value}
        productFeature{value}
      }
    }
  }
}

See the output results in same item with versions available in Sitecore-

{
  "data": {
    "search": {
      "total": 2,
      "results": [
        {
          "id": "8716FE4AD58345589AB04369C39F5CC0",
          "name": "bali-power-bank-3000mah",
          "version": 2,
          "url": {
            "path": "/Data/Commerce-Data/Product-Data/bali-power-bank-3000mah"
          },
          "productId": {
            "value": "bali-power-bank-3000mah"
          },
          "productFeature": {
            "value": "UPDATE - official-camera - Product Feature. JIGA power bank is a high-quality battery pack, with all-day powerThe power bank can charge your phone at least 3-5 times,the perfect partner for gamers, camping and business trips."
          }
        },
        {
          "id": "8716FE4AD58345589AB04369C39F5CC0",
          "name": "bali-power-bank-3000mah",
          "version": 1,
          "url": {
            "path": "/Data/Commerce-Data/Product-Data/bali-power-bank-3000mah"
          },
          "productId": {
            "value": "bali-power-bank-3000mah"
          },
          "productFeature": {
            "value": "official-camera - Product Feature. JIGA power bank is a high-quality battery pack, with all-day powerThe power bank can charge your phone at least 3-5 times,the perfect partner for gamers, camping and business trips."
          }
        }
      ]
    }
  }
}

See the highlighted fields in result. Same ID, multiple result set with different versions. Unfortunately, there is no option here to get the latest version. Sitecore has clarified this and raised a bug for same as of October 2025. this might be resolved in future. The related public reference number is DEVEX-2992.

How to solve this issue- This needs to be handled in headless app.

Headless app needs to filter this for each item and should pick only latest version from the result set for the same item.

function GetLatestVersion(products: ProductResult[]) 
{ 
  if (products.length === 0) 
  { return null; } 
  const latestVersions = Object.values( products.reduce<Record<string,        ProductResult>>((acc, item) => { 
  const existing = acc[item.id]; 
  if (!existing || item.version > existing.version) 
  { 
    acc[item.id] = item; 
  } 
  return acc; 
}, 
{})); 
 return latestVersions; 
}

This should only provide the latest version of item.

Loading

Sitecore Personalize – Run Fullstack Experience using Rest API endpoint

Continuing with the post – Sitecore Personalize – Create Fullstack Experience

In earlier post created a new Fullstack experience named- pastoral grill experience and ID for same was “”

Get the ID of the expereince in “Details” tab and a code snippet to run this in frontend. But in this post will see how to interact using rest api endpoint.

Send request to Rest API to recieve response-

https://{{apiEndpoint}}/{{restApiVersion}}/callFlows

See here API target endpoint to be used based on region-

https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform–data-model-2-1/walkthrough–preparing-to-integrate-with-sitecore-cdp.html

https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform–data-model-2-1/base-url-of-sitecore-cdp-apis-for-v2-1-data-model.html

Request and Response-

clientKey- I have client key as a ennvironment variable. See how to find Client Key

pointOfSale- Enter your configured point of sale. See how to create or get POS

friendlyId- Fullstack/Web Epxerience friendly id. See how to get interactive experience id

In the operational tab there is a spike at the time the request was sent-

Loading

Siteocre Personalize – Create a triggered experience to send abandon cart mail

This blog describes the step by step process to create a triggered expereience in Sitecore Personalize to send a abandon cart mail.

Create Experience

Choose Triggered Experience

Name the experience

Configure API Request

Choose a connection created in this blog post – here

Configure the reponse

Save and Close

Start the Expereince and select option “Run immediately”

Steps to add abandon the cart-

Step 1 – View event

Follow the blog post – here

Step 2- Identity event

Follow the blog post – here

Step 3- Add event

Follow the blog post – here

Step 4 – Force Close event

Follow the blog post – here OR wait for session to expire ( normally 20 minutes or as configured in POS)

Mail is delivered to the customer

Loading

Sitecore Personalize – Create connection used by triggered experience

Create connection to external service used to trigger experience. This connections are outbound.

In this blog will see an example to create a connection to mailjet which can be used to trigger a expereience for abandon cart(covered in another blog post)- here

Setup mailjet account

Create a new account if you don’t have any- https://www.mailjet.com/

In the Account Settings => select optin “API Key management”

Note the API Key and Secret Key

Generate a secret key if not already generated.

Create a connection in Sitecore CDP portal

Navigate to “Develoepr center” => Connections option

Search for existing connection or “Add Connection”

Select “Destination” option for Flows to send data.

Fille in the required details and select icon-

Authentication

Next setup the Basic Authentication. Copy the API Key as User Name and Password as Secret Key and “Test Authentication”

Setup the request

Get the api endpoint and the request body from here – https://dev.mailjet.com/email/guides/getting-started/

// Sample mail 
{
    "Messages": [
        {
            "From": {
                "Email": "pilot@mailjet.com",
                "Name": "Your Mailjet Pilot"
            },
            "To": [
                {
                    "Email": "passenger@mailjet.com",
                    "Name": "Customer 1"
                }
            ],
            "Subject": "Your cart is waiting",
            "TextPart": "Dear passenger, Welcome to pastoral grill",
            "HTMLPart": "<h3>Dear passenger 1, welcome to <a href=\"https://www.mailjet.com/\">Mailjet!</a></h3><br />May the delivery force be with you!"
        }
    ]
}

Tet the connection-

Note- add sender address to the contact list in mailjet or the mails will be blocked. Also the mails from gmail wont be triggered. Use this URL to add sender address-

https://app.mailjet.com/account/sender

Check if the test Mail received-

Click Next, Review & Save

Connection is created and this can be used when an expereince is triggered.

Next setup the Triggered Expereince

Loading

Sitecore Send – How to Resubscribe a user to a mailing list

To resubscribe a user goto the mailing list where a user has unsubscribed, navigate to the Unsubscribe tab-

In the action menu – Select Change Status option

Select the Active option and Change Status-

The user will now be made Active and any mails from this mailing list will be sent to the user-

Or you can also ask user to Subscribe again following the steps in this blog.

Loading