Content Items API (v1)
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.
This REST API lets you:
Create, retrieve, update and delete content items.
List live content items.
Validate and translate content items.
Retrieve content item hierarchy and hierarchy children.
To authorize your requests, use environment automation client credentials and generate a JSON Web Token (JWT).
Note: To create client credentials, you must be an Organization Admin or Organization Owner.
- In the Sitecore Cloud Portal, open SitecoreAI Deploy.
- Click Credentials > Environment > Create credentials > Automation.
- Fill out the automation client details, then click Create.
- 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.
Run the following cURL command to request a JWT. Replace the placeholder values with your client ID and client secret.
curl -X POST 'https://auth.sitecorecloud.io/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id={YOUR_CLIENT_ID}' \
--data-urlencode 'client_secret={YOUR_CLIENT_SECRET}' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'audience=https://api.sitecorecloud.io'In the response, the access_token key contains the JWT:
{
"access_token": "{YOUR_JWT}",
"scope": "xmcloud.cm:admin",
"expires_in": 86400,
"token_type": "Bearer"
}The 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.
We recommend that you cache the JWT for 24 hours to avoid repeating this POST request while the JWT is still valid.