Request

Creates a component draft.

Security
Bearer
Query
environmentIdstring

The environment identifier.

Example:environmentId=main
Bodyrequired

Details of the component draft to create.

namestring, [ 0 .. 50 ] charactersrequired

The component draft name.

Example:"Promo"
displayNamestring or null, [ 0 .. 50 ] characters

The component draft display name.

Example:"Promo"
categoryobject(ComponentCategoryInput)

Details of the component category.

iconUrlstring or null

The component draft icon URL.

Example:"/temp/iconcache/sxa_mdi/32x32/promo.png"
renderingParametersArray of objects or null(RenderingParameterInput)

The component draft rendering parameters.

settingsobject or null

The component draft settings.

Example:
{ "Sample": "10" }
descriptionstring or null

The component draft description.

Example:"Promo description"
typestring(DraftType)

Specifies the delivery model of a component draft.

Enum:"Code""Hosted"
curl -i -X POST \
  'https://edge-platform.sitecorecloud.io/authoring/api/v1/components/drafts?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": "/temp/iconcache/sxa_mdi/32x32/promo.png",
    "renderingParameters": [
      {
        "name": "Promo",
        "displayName": "Promo",
        "editingControl": {
          "type": "Single-Line Text",
          "value": "Placeholder text"
        }
      }
    ],
    "settings": {
      "Sample": "10"
    },
    "description": "Promo description",
    "type": "Code"
  }'

Responses

Successful operation. ContentModel object can be empty once created but it can be populated subsequently using the Patch/Update Draft endpoint.

Bodyapplication/json
idstring or null

The identifier of the component draft.

Example:"2492bac4-da07-4c86-87f0-9873d40e2276"
namestring or null

The name of the component draft.

Example:"Hero Banner"
displayNamestring or null

The component draft display name.

Example:"Banner"
descriptionstring or null

The component draft description.

Example:"A promo component is a content block designed to showcase promotions using a combination of text and visuals"
categoryobject(ComponentCategory)
modelIdstring or null

The content type identifier.

Example:"dfed4457-d760-457a-bec1-c0dccdc44381"
renderingParametersobject or null

The component draft rendering parameters.

Example:
{ "ButtonText": "Click me!" }
settingsobject or null

The component draft settings.

Example:
{ "IsRenderingsWithDynamicPlaceholders": "true", "RandomNumber": "10" }
systemobject(ComponentSystem)

Component system information.

contentModelobject(ContentModelDraft)

The content type draft associated with component draft.

variantsArray of objects or null(ComponentVariantDraft)

The variant drafts associated with this component draft.

typestring(DraftType)

Specifies the delivery model of a component draft.

Enum:"Code""Hosted"
availabilityobject(ComponentDraftAvailabilityModel)

The availability settings stored on a 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": [ … ] } }