Sitecore API catalog/Components API//
- Create a component
Retrieve a component draft
Update a component draft
Update a component draft
Delete a component draft
List component drafts
Create a component draft
List components
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
Create a component
Creates a component.
Security
Bearer
Details of the component to create.
The component name. Letters, numbers, spaces, underscores, and hyphens only.
Example:"Promo"
The component rendering parameters.
The component settings.
Example:
{ "IsRenderingsWithDynamicPlaceholders": "true", "RandomNumber": "10" }
- Production serverhttps://edge-platform.sitecorecloud.io/authoring/api/v1/components
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
- application/json
- text/json
- application/*+json
curl -i -X POST \
'https://edge-platform.sitecorecloud.io/authoring/api/v1/components?environmentId=main' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"name": "Promo",
"displayName": "Promo",
"category": {
"id": "ae070691-099d-4081-856c-4c4a7e3543df",
"name": "Page Content"
},
"iconUrl": "Office/32x32/window_dialog.png",
"modelId": "dfed4457-d760-457a-bec1-c0dccdc44381",
"renderingParameters": [
{
"name": "Promo",
"displayName": "Promo",
"editingControl": {
"type": "Single-Line Text",
"value": "Placeholder text"
}
}
],
"settings": {
"IsRenderingsWithDynamicPlaceholders": "true",
"RandomNumber": "10"
},
"description": "This is a promo component.",
"availability": {
"sites": [
"4f2d7c8b9e1a4f0d8f3c2b176a4e9d22",
"c1378a9fe2bd4e56a1c4d9f87b33a6c4"
],
"placeholders": [
"4f2d7c8b9e1a4f0d8f3c2b176a4e9d22",
"c1378a9fe2bd4e56a1c4d9f87b33a6c4"
],
"pageModels": [
"4f2d7c8b9e1a4f0d8f3c2b176a4e9d22",
"c1378a9fe2bd4e56a1c4d9f87b33a6c4"
]
}
}'Successful operation. The variants array in the response body will be empty on create as no variants exist yet
The component description.
Example:"A promo component is a content block designed to showcase promotions using a combination of text and visuals"
The component icon URL.
Example:"https://xmc-instance.sitecore-staging.cloud/-/icon/SXA_MDI/16x16/Promo.png"
Datasource template item path.
Example:"/sitecore/templates/Feature/Promos"
The component rendering parameters.
Example:
{ "ButtonText": "Click me!" }
The component settings.
Example:
{ "IsRenderingsWithDynamicPlaceholders": "true", "RandomNumber": "10" }
The component variants.
Example:
[ { "name": "Default", "id": "2492bac4-da07-4c86-87f0-9873d40e2276", "siteId": "497f6eca-6276-4993-bfeb-53cbbbba6f08" }, { "name": "Advanced", "id": "2f34355e-c52d-450e-b1b9-d4e9cbe64af2", "siteId": "497f6eca-6276-4993-bfeb-53cbbbba6f08" } ]
Response
{ "id": "2492bac4-da07-4c86-87f0-9873d40e2276", "name": "Hero Banner", "displayName": "Banner", "systemName": "HeroBanner", "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" }, "icon": "https://xmc-instance.sitecore-staging.cloud/-/icon/SXA_MDI/16x16/Promo.png", "datasourceTemplateField": "/sitecore/templates/Feature/Promos", "modelId": "/sitecore/templates/Feature/Promos", "renderingParameters": { "ButtonText": "Click me!" }, "settings": { "IsRenderingsWithDynamicPlaceholders": "true", "RandomNumber": "10" }, "variants": [ { … }, { … } ], "system": { "created": "2023-01-01T00:00:00Z", "createdBy": "sitecore admin", "updated": "2023-01-01T00:00:00Z", "updatedBy": "sitecore admin" }, "type": "Code" }