Update a component draft

Request

Fully replaces a component draft. All user-editable fields are replaced with the provided values. Null values reset optional fields to their defaults. Unlike PATCH, the entire Variants collection is replaced — any existing variant not present in the request body is removed.

Security
Bearer
Path
componentDraftIdstringrequired

The component draft identifier.

Example:2492bac4-da07-4c86-87f0-9873d40e2276
Query
environmentIdstring

The environment identifier.

Example:environmentId=main
Bodyrequired

Details of the component draft to update.

namestring, [ 0 .. 50 ] charactersrequired

The component draft name.

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

The component draft display name. Falls back to name when empty.

Example:"Promo"
descriptionstring or null

The component draft description.

Example:"Promo description"
categoryobject(ComponentCategoryInput)

Details of the component category.

modelIdstring or null

The content type identifier.

Example:"ae070691-099d-4081-856c-4c4a7e3543df"
renderingParametersArray of objects or null(RenderingParameterInput)

The rendering parameters. Replaces the entire stored list. Send an empty array to clear all rendering parameters.

settingsobject or null

Other component draft settings. Replaces the entire stored dictionary. Send an empty object to clear all settings.

contentModelobject(ContentModelDraft)

The content type draft associated with component draft.

variantsArray of objects or null(ComponentVariantDraft)

The full variant list. Replaces the entire stored variants dictionary. Variants not present in this list are removed. Send an empty array to clear all variants. Variant names must be unique.

availabilityobject(AvailabilityInput)

Represents the availability constraints for a component, specifying which sites, placeholders, and page models the component can be used with.

curl -i -X PUT \
  '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": "Promo description",
    "category": {
      "id": "ae070691-099d-4081-856c-4c4a7e3543df",
      "name": "Page Content"
    },
    "modelId": "ae070691-099d-4081-856c-4c4a7e3543df",
    "renderingParameters": [
      {
        "name": "Promo",
        "displayName": "Promo",
        "editingControl": {
          "type": "Single-Line Text",
          "value": "Placeholder text"
        }
      }
    ],
    "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"
      ]
    }
  }'

Responses

Successful operation

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": [ … ] } }