# Update a component draft

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.

Endpoint: PUT /api/v1/components/drafts/{componentDraftId}
Version: v1
Security: Bearer

## Security:

  - `Bearer` (unknown)
    http Bearer

## Path parameters:

  - `componentDraftId` (string, required)
    The component draft identifier.

## Query parameters:

  - `environmentId` (string)
    The environment identifier.

## Request body:

  - `application/json, text/json, application/*+json` (unknown)
    Details of the component draft to update.

## Request fields (application/json):

  - `name` (string, required)
    The component draft name.
    Example: Promo

  - `displayName` (string)
    The component draft display name. Falls back to name when empty.
    Example: Promo

  - `description` (string)
    The component draft description.
    Example: Promo description

  - `category` (object)
    Details of the component category.

  - `category.id` (string)
    The category identifier.
    Example: ae070691-099d-4081-856c-4c4a7e3543df

  - `category.name` (string)
    The category name. Letters, numbers, spaces, underscores, and hyphens only.
    Example: Page Content

  - `modelId` (string)
    The content type identifier.
    Example: ae070691-099d-4081-856c-4c4a7e3543df

  - `renderingParameters` (array)
    The rendering parameters. Replaces the entire stored list.
Send an empty array to clear all rendering parameters.

  - `renderingParameters.name` (string, required)
    The parameter name.
    Example: Promo

  - `renderingParameters.displayName` (string)
    The parameter display name.
    Example: Promo

  - `renderingParameters.editingControl` (object, required)
    The rendering parameter editing control input.

  - `renderingParameters.editingControl.type` (string)
    The control type.
    Example: Single-Line Text

  - `renderingParameters.editingControl.value` (string)
    The control value.
    Example: Placeholder text

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

  - `contentModel` (object)
    The content type draft associated with component draft.

  - `contentModel.name` (string)
    The content type draft name.
    Example: Promo

  - `contentModel.description` (string)
    The description of the content type draft.
    Example: Draft content type

  - `contentModel.fieldGroups` (array)
    The content type draft field groups.

  - `contentModel.fieldGroups.name` (string)
    The name of the field group.
    Example: GroupName

  - `contentModel.fieldGroups.sortOrder` (integer)
    The sort order.
    Example: 1

  - `contentModel.fieldGroups.fields` (array)
    The content type draft fields.

  - `contentModel.fieldGroups.fields.name` (string)
    The field draft name.
    Example: PromoText

  - `contentModel.fieldGroups.fields.type` (string)
    The field draft type.
    Example: Single-Line Text

  - `contentModel.fieldGroups.fields.helperText` (string)
    Help text for the field draft.
    Example: Helper Text

  - `contentModel.fieldGroups.fields.value` (object)
    The default value of the field draft. Accepts string or object types.
    Example: {"text":"Field Value Text"}

  - `contentModel.fieldGroups.fields.source` (string)
    The source of the field.
    Example: /sitecore/content/Tenant/Site/Home

  - `contentModel.fieldGroups.fields.sortOrder` (integer)
    The sort order.
    Example: 1

  - `contentModel.fieldGroups.fields.validationRules` (array)
    The validation rules assigned to the field as a list of validation rule item IDs.
    Example: ["59D4EE10-627C-4FD3-A964-61A88B092CBC","A76C1092-EE2E-4021-B9EE-21E541CDA1D7"]

  - `variants` (array)
    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.

  - `variants.name` (string)
    The variant name. Used as the unique key for add-or-replace operations.
    Example: Default

  - `variants.code` (string)
    The variant code.
    Example: <Button>Click</Button>

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

  - `availability.sites` (array)
    The list of sites where the component will be assigned.
    Example: ["4f2d7c8b9e1a4f0d8f3c2b176a4e9d22","c1378a9fe2bd4e56a1c4d9f87b33a6c4"]

  - `availability.placeholders` (array)
    The list of placeholders where the component can be used.
    Example: ["4f2d7c8b9e1a4f0d8f3c2b176a4e9d22","c1378a9fe2bd4e56a1c4d9f87b33a6c4"]

  - `availability.pageModels` (array)
    The list of allowed page models.
    Example: ["4f2d7c8b9e1a4f0d8f3c2b176a4e9d22","c1378a9fe2bd4e56a1c4d9f87b33a6c4"]

## Response 200:

  - `200` (unknown)
    Successful operation

## Response 200 fields (application/json):

  - `id` (string)
    The identifier of the component draft.
    Example: 2492bac4-da07-4c86-87f0-9873d40e2276

  - `name` (string)
    The name of the component draft.
    Example: Hero Banner

  - `displayName` (string)
    The component draft display name.
    Example: Banner

  - `description` (string)
    The component draft description.
    Example: A promo component is a content block designed to showcase promotions using a combination of text and visuals

  - `category` (object)

  - `category.id` (string)
    The category identifier
    Example: ae070691-099d-4081-856c-4c4a7e3543df

  - `category.name` (string)
    The category name
    Example: Page Content

  - `category.path` (string)
    The path to category item
    Example: /sitecore/content/Tenant/Site/Home/Categories/Page-Content

  - `modelId` (string)
    The content type identifier.
    Example: dfed4457-d760-457a-bec1-c0dccdc44381

  - `renderingParameters` (object)
    The component draft rendering parameters.
    Example: {"ButtonText":"Click me!"}

  - `settings` (object)
    The component draft settings.
    Example: {"IsRenderingsWithDynamicPlaceholders":"true","RandomNumber":"10"}

  - `system` (object)
    Component system information.

  - `system.createdAt` (string)
    The component creation time.
    Example: 2023-01-01T00:00:00Z

  - `system.createdBy` (string)
    The component creator.
    Example: sitecore\admin

  - `system.updatedAt` (string)
    The component last updating time.
    Example: 2023-01-01T00:00:00Z

  - `system.updatedBy` (string)
    The last component updater.
    Example: sitecore\admin

  - `contentModel` (object)
    The content type draft associated with component draft.

  - `contentModel.name` (string)
    The content type draft name.
    Example: Promo

  - `contentModel.description` (string)
    The description of the content type draft.
    Example: Draft content type

  - `contentModel.fieldGroups` (array)
    The content type draft field groups.

  - `contentModel.fieldGroups.name` (string)
    The name of the field group.
    Example: GroupName

  - `contentModel.fieldGroups.sortOrder` (integer)
    The sort order.
    Example: 1

  - `contentModel.fieldGroups.fields` (array)
    The content type draft fields.

  - `contentModel.fieldGroups.fields.name` (string)
    The field draft name.
    Example: PromoText

  - `contentModel.fieldGroups.fields.type` (string)
    The field draft type.
    Example: Single-Line Text

  - `contentModel.fieldGroups.fields.helperText` (string)
    Help text for the field draft.
    Example: Helper Text

  - `contentModel.fieldGroups.fields.value` (object)
    The default value of the field draft. Accepts string or object types.
    Example: {"text":"Field Value Text"}

  - `contentModel.fieldGroups.fields.source` (string)
    The source of the field.
    Example: /sitecore/content/Tenant/Site/Home

  - `contentModel.fieldGroups.fields.sortOrder` (integer)
    The sort order.
    Example: 1

  - `contentModel.fieldGroups.fields.validationRules` (array)
    The validation rules assigned to the field as a list of validation rule item IDs.
    Example: ["59D4EE10-627C-4FD3-A964-61A88B092CBC","A76C1092-EE2E-4021-B9EE-21E541CDA1D7"]

  - `variants` (array)
    The variant drafts associated with this component draft.

  - `variants.name` (string)
    The variant name. Used as the unique key for add-or-replace operations.
    Example: Default

  - `variants.code` (string)
    The variant code.
    Example: <Button>Click</Button>

  - `type` (string)
    Specifies the delivery model of a component draft.
    Enum: "Code", "Hosted"

  - `availability` (object)
    The availability settings stored on a component draft.

  - `availability.sites` (array)
    The sites where the draft is available.

  - `availability.sites.id` (string)
    The identifier of the site.
    Example: 497f6eca-6276-4993-bfeb-53cbbbba6f08

  - `availability.sites.name` (string)
    The name of the site.
    Example: skate-park

  - `availability.sites.displayName` (string)
    The display name of the site.
    Example: Skate Park Website

  - `availability.sites.links` (object)
    Hypermedia links associated with a Site resource.

  - `availability.sites.links.self` (object)
    A single hypermedia link (RFC 8288).

  - `availability.sites.links.self.href` (string)
    The relative URL of the linked resource.
    Example: /api/v1/sites/497f6eca-6276-4993-bfeb-53cbbbba6f08

  - `availability.placeholders` (array)
    The placeholders where the draft is available.

  - `availability.placeholders.id` (string)
    The identifier of the placeholder
    Example: 6f9619ff-8b86-d011-b42d-00c04fc964ff

  - `availability.placeholders.name` (string)
    The name of the placeholder
    Example: Main Content

  - `availability.placeholders.placeholderKey` (string)
    The placeholder key.
    Example: main-content

  - `availability.pageModels` (array)
    The page models where the draft is available.

  - `availability.pageModels.id` (string)
    The content type identifier.
    Example: d4e5f6a7-b8c9-0123-4567-89abcdef0123

  - `availability.pageModels.name` (string)
    The content type name.
    Example: Promo

  - `availability.pageModels.created` (string)
    The content type creation date.
    Example: 2024-01-01T12:00:00Z

  - `availability.pageModels.createdBy` (string)
    The content type author.
    Example: sitecore\admin

  - `availability.pageModels.updated` (string)
    The content type last update date.
    Example: 2024-01-02T12:00:00Z

  - `availability.pageModels.updatedBy` (string)
    The author of the last update to the content type.
    Example: sitecore\admin

## Response 400:

  - `400` (unknown)
    One or more validation errors occurred

## Response 400 fields (application/json):

  - `type` (string)
    The type of the error response entity.

  - `title` (string)
    The title of the error response entity.

  - `status` (integer)
    The response status code.

  - `detail` (string)
    A detailed explanation, specific to this occurrence of the problem.

  - `instance` (string)
    If available, a URI reference that identifies the specific occurrence of the problem.

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `type` (string)
    The type of the error response entity.

  - `title` (string)
    The title of the error response entity.

  - `status` (integer)
    The response status code.

  - `detail` (string)
    A detailed explanation, specific to this occurrence of the problem.

  - `instance` (string)
    If available, a URI reference that identifies the specific occurrence of the problem.

## Response 404:

  - `404` (unknown)
    Invalid component draft id

## Response 404 fields (application/json):

  - `type` (string)
    The type of the error response entity.

  - `title` (string)
    The title of the error response entity.

  - `status` (integer)
    The response status code.

  - `detail` (string)
    A detailed explanation, specific to this occurrence of the problem.

  - `instance` (string)
    If available, a URI reference that identifies the specific occurrence of the problem.

## Response 502:

  - `502` (unknown)
    Bad Gateway

