{"templateId":"openapi_docs","sharedDataIds":{"openAPIDocsStore":"oas-sai/item-transfer-api/index.yaml","sidebar":"sidebar-sidebar.yaml__sai_item-transfer-api","current-catalog-info":"current-catalog-info-/sai/item-transfer-api"},"props":{"definitionId":"sai/item-transfer-api/index.yaml","dynamicMarkdocComponents":[],"baseSlug":"/sai/item-transfer-api","seo":{"title":"Item Transfer API","siteUrl":"https://api-docs.sitecore.com","image":"/assets/favicon.19b81ef710429ff2169b164acdb39de23d65db39632db445eeef84aa38980a00.db81178d.svg","keywords":"documentation, api","lang":"en-US","jsonLd":{"@context":"https://schema.org","@type":"Website","url":"http://api-docs.sitecore.com","name":"Sitecore APIs Documentation"},"llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"itemId":"","disableAutoScroll":true,"metadata":{"type":"openapi","title":"Item Transfer API","description":"The Item Transfer API allows SitecoreAI *Organization Admins* and *Organization Owners* to incorporate special files (*sources*) containing migrated content and media data into the database of the *destination* environment.\n\nThe Item Transfer API is primarily used to consume `.raif` files produced by the [Content Transfer API](https://api-docs.sitecore.com/sai/content-transfer). In this primary workflow, source files are read from Azure Blob Storage. \n\nAlternatively, you can use the Item Transfer API to [upload](#operation/uploadBlobSource) small `.raif` files (under 100 MB) from your Sitecore file system, but this is a secondary workflow intended for smaller or ad hoc transfers.\n\nFor large content migrations between environments, use the Content Transfer API to generate `.raif` files via chunked streaming, and then consume them using the Item Transfer API.\n\nEach `.raif` file represents a single data tree from the source environment, and each tree is either a single item or an item plus all of its descendants.\n\nNote the following:\n- To use this REST API, you must authorize your API requests.\n- You must be an *Organization Admin* or *Organization Owner* to use this API. \n- Unlike the Content Transfer API, the Item Transfer API is used only in your *destination* environment, not in your *source* environment.\n\n# Migrating content\n\nThe Item Transfer API covers the *destination* side of a content migration. Before using this API, complete all steps in the [Content Transfer API](https://api-docs.sitecore.com/sai/content-transfer) to generate `.raif` files in the destination environment.\n\nAlso ensure you have the *Organization Admin* or *Organization Owner* role, and that you have determined your *destination* [base URL](#section/base-url) and created a [JWT](#section/authorization) for the environment. \n\n## Verify the blob is available\n\n[Return the list of available blob sources](#operation/getBlobSources) to confirm that the `.raif` file produced by the Content Transfer API is present and has a `BlobState` of `Uploaded`, which means that the file is ready to consume.\n\n## Start consuming the blob\n\n[Start consuming the source](#operation/startItemsTransfer) into the destination database, passing the `.raif` file name as the `blobName` parameter. Transferred items are immediately available to work with in the destination environment while the system completes the sync to the database in the background. The `location` response header contains a URL. The final path segment of the URL is the transfer ID used in subsequent requests.\n\n## Monitor the transfer\n\nAlthough items are available immediately, poll the transfer status to detect failures. If the background sync fails before completing, items that were not yet synced will become unavailable and the transfer must be retried.\n\n[Poll the transfer status](#operation/getTransfers) until `TransferState` is `Finished`. If `TransferState` is `Failed`, [retry the transfer](#operation/retryFailedItemsTransfer).\n\nYou can also [retrieve the details of a specific transfer](#operation/getTransferById) or [view the transfer history](#operation/getTransfersHistory).\n\n## Clean up\n\nAfter the transfer is finished, [delete the blob source](#operation/deleteBlobSource) to remove the `.raif` file from Azure Blob Storage.\n\nThis completes the migration process.\n\n\n# Base URL\nIn the base URL, replace `{host}` with your environment host name of your *destination* environment (where you're migrating data to).\n\nFind the environment host name in SitecoreAI Deploy > **Projects** > your project > **Authoring environments** > your environment > **Details** > **Environment host name**.\n\nExample environment host name: `your-environment.sitecorecloud.io`\n\n# Authorization\nTo authorize your requests, use environment automation client credentials and generate a JSON Web Token (JWT).\n\nNote: To create client credentials, you must be an [Organization Admin or Organization Owner](https://doc.sitecore.com/portal/en/developers/sitecore-cloud-portal/roles.html).\n\n## Create an automation client\n1. In the Sitecore Cloud Portal, open SitecoreAI Deploy.\n2. Click **Credentials** > **Environment** > **Create credentials** > **Automation**.\n3. Fill out the automation client details, then click **Create**.\n4. Copy the client ID and the client secret because you won't be able to view them again in SitecoreAI Deploy. You'll use them to request a JWT.\n\n## Request a JWT\n\nRun the following cURL command to request a JWT. Replace the placeholder values with your client ID and client secret.\n```curl\n  curl -X POST 'https://auth.sitecorecloud.io/oauth/token' \\\n  --header 'Content-Type: application/x-www-form-urlencoded' \\\n  --data-urlencode 'client_id={YOUR_CLIENT_ID}' \\\n  --data-urlencode 'client_secret={YOUR_CLIENT_SECRET}' \\\n  --data-urlencode 'grant_type=client_credentials' \\\n  --data-urlencode 'audience=https://api.sitecorecloud.io'\n```\n\nThe JWT expires in 24 hours. If your requests unexpectedly return a response with status `403 Forbidden`, request a new JWT by repeating this `POST` request.\n\nWe recommend that you cache the JWT for 24 hours to avoid repeating this `POST` request while the JWT is still valid.\n\n## Include the JWT in the request header\n\nYou can now start making REST API requests. You must include the JWT in the request header of every request. For example:\n```curl\n  curl -X GET '{YOUR_BASE_URL}/...' \\\n  -H 'Authorization: Bearer {YOUR_JWT}' \\\n  -H 'Accept: application/json'\n```\n","product":"SitecoreAI"},"compilationErrors":[],"markdown":{"partials":{},"variables":{"rbac":{"teams":["anonymous"]},"user":{},"remoteAddr":{"hostname":"api-docs.sitecore.com","port":4000,"ipAddress":"216.73.217.10"},"lang":"default_locale","env":{"PUBLIC_REDOCLY_BRANCH_NAME":"master"}}},"pagePropGetterError":{"message":"","name":""}},"slug":"/sai/item-transfer-api","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}