Sitecore API catalog/Components API//
- Update a component draft
Retrieve a component draft
Update a component draft
Delete a component draft
List component drafts
Create a component draft
List components
Create a component
List component summaries
Retrieve a component
Update a component
Retrieve component metadata
Retrieve component variant metadata by ID
Get sites where specified component is allowed
Generate a draft content type suggestion
Activate a component draft
Generate a component draft suggestion
Update a component draft
Updates a component draft.
Security
Bearer
Details of the component draft to update.
Component draft description.
Example:"A promo component is a content block designed to showcase promotions using a combination of text and visuals"
Variant drafts to add or replace by name.
Variant names must be unique.null — existing variants are left unchanged.[] — all existing variants are removed.
- Production serverhttps://edge-platform.sitecorecloud.io/authoring/api/v1/components/drafts/{componentDraftId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
- application/json
- text/json
- application/*+json
curl -i -X PATCH \
'https://edge-platform.sitecorecloud.io/authoring/api/v1/components/drafts/2492bac4-da07-4c86-87f0-9873d40e2276?environmentId=main' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"name": "Promo",
"displayName": "Promo",
"description": "A promo component is a content block designed to showcase promotions using a combination of text and visuals",
"category": {
"id": "ae070691-099d-4081-856c-4c4a7e3543df",
"name": "Page Content"
},
"modelId": "d4e5f6a7-b8c9-0123-4567-89abcdef0123",
"settings": {
"property1": "string",
"property2": "string"
},
"contentModel": {
"name": "Promo",
"description": "Draft content type",
"fieldGroups": [
{
"name": "GroupName",
"sortOrder": 1,
"fields": [
{
"name": "PromoText",
"type": "Single-Line Text",
"helperText": "Helper Text",
"value": {
"text": "Field Value Text"
},
"source": "/sitecore/content/Tenant/Site/Home",
"sortOrder": 1,
"validationRules": [
"59D4EE10-627C-4FD3-A964-61A88B092CBC",
"A76C1092-EE2E-4021-B9EE-21E541CDA1D7"
]
}
]
}
]
},
"variants": [
{
"name": "Default",
"code": "<Button>Click</Button>"
}
],
"availability": {
"sites": [
"4f2d7c8b9e1a4f0d8f3c2b176a4e9d22",
"c1378a9fe2bd4e56a1c4d9f87b33a6c4"
],
"placeholders": [
"4f2d7c8b9e1a4f0d8f3c2b176a4e9d22",
"c1378a9fe2bd4e56a1c4d9f87b33a6c4"
],
"pageModels": [
"4f2d7c8b9e1a4f0d8f3c2b176a4e9d22",
"c1378a9fe2bd4e56a1c4d9f87b33a6c4"
]
}
}'Successful operation
The identifier of the component draft.
Example:"2492bac4-da07-4c86-87f0-9873d40e2276"
The component draft description.
Example:"A promo component is a content block designed to showcase promotions using a combination of text and visuals"
The component draft rendering parameters.
Example:
{ "ButtonText": "Click me!" }
The component draft settings.
Example:
{ "IsRenderingsWithDynamicPlaceholders": "true", "RandomNumber": "10" }
The variant drafts associated with this component draft.
Response
{ "id": "2492bac4-da07-4c86-87f0-9873d40e2276", "name": "Hero Banner", "displayName": "Banner", "description": "A promo component is a content block designed to showcase promotions using a combination of text and visuals", "category": { "id": "ae070691-099d-4081-856c-4c4a7e3543df", "name": "Page Content", "path": "/sitecore/content/Tenant/Site/Home/Categories/Page-Content" }, "modelId": "dfed4457-d760-457a-bec1-c0dccdc44381", "renderingParameters": { "ButtonText": "Click me!" }, "settings": { "IsRenderingsWithDynamicPlaceholders": "true", "RandomNumber": "10" }, "system": { "createdAt": "2023-01-01T00:00:00Z", "createdBy": "sitecore\\admin", "updatedAt": "2023-01-01T00:00:00Z", "updatedBy": "sitecore\\admin" }, "contentModel": { "name": "Promo", "description": "Draft content type", "fieldGroups": [ … ] }, "variants": [ { … } ], "type": "Code", "availability": { "sites": [ … ], "placeholders": [ … ], "pageModels": [ … ] } }