{"templateId":"openapi_docs","sharedDataIds":{"openAPIDocsStore":"oas-sai/content-items-api/index.json","sidebar":"sidebar-sidebar.yaml__sai_content-items-api","current-catalog-info":"current-catalog-info-/sai/content-items-api"},"props":{"definitionId":"sai/content-items-api/index.json","dynamicMarkdocComponents":[],"baseSlug":"/sai/content-items-api","seo":{"title":"Content Items 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":"Content Items API","description":"The Content Items API lets you manage content items for an environment. A content item is an instance of a content type that stores structured content and its metadata. Content items contain the actual content used by sites, applications, and other channels. \n\n This REST API lets you: \n\n - Create, retrieve, update and delete content items. \n\n - List live content items. \n\n - Validate and translate content items. \n\n - Retrieve content item hierarchy and hierarchy children. \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](https://doc.sitecore.com/portal/en/developers/sitecore-cloud-portal/roles.html) or Organization Owner.\n\n## Create an automation client\n 1. In the Sitecore Cloud Portal, open SitecoreAI Deploy.\n 2. Click **Credentials** > **Environment** > **Create credentials** > **Automation**.\n 3. Fill out the automation client details, then click **Create**.\n 4. 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\nIn the response, the `access_token` key contains the JWT:\n\n```json\n  {\n    \"access_token\": \"{YOUR_JWT}\",\n    \"scope\": \"xmcloud.cm:admin\",\n    \"expires_in\": 86400,\n    \"token_type\": \"Bearer\"\n  }\n```\n\nThe JWT expires in 24 hours. If your requests unexpectedly return a response with status `401 Unauthorized`, 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  ```","product":"SitecoreAI"},"compilationErrors":[],"markdown":{"partials":{},"variables":{"rbac":{"teams":["anonymous"]},"user":{},"remoteAddr":{"hostname":"api-docs.sitecore.com","port":4000,"ipAddress":"216.73.217.110"},"lang":"default_locale","env":{"PUBLIC_REDOCLY_BRANCH_NAME":"master"}}},"pagePropGetterError":{"message":"","name":""}},"slug":"/sai/content-items-api","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}