Activate a component draft

Request

Activates an existing component draft by creating the corresponding content type (when present), component, and variants, then permanently removes the draft from storage. Activation is a one-way operation — once successful the draft is no longer retrievable. When activation availability is omitted, the endpoint falls back to the draft's stored availability. If neither activation input nor the stored draft defines site assignments, the component is created without site assignments.

Security
Bearer
Path
componentDraftIdstringrequired

The component draft identifier.

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

The environment identifier.

Example:environmentId=main
Bodyrequired

Optional availability overrides and variant names to activate.

variantNamesArray of stringsrequired

The names of the draft variants that should be activated.

Example:
[ "Default", "Dark" ]
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 POST \
  'https://edge-platform.sitecorecloud.io/authoring/api/v1/components/drafts/2492bac4-da07-4c86-87f0-9873d40e2276/activation?environmentId=main' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "availability": {
      "sites": [
        "4f2d7c8b9e1a4f0d8f3c2b176a4e9d22",
        "c1378a9fe2bd4e56a1c4d9f87b33a6c4"
      ],
      "placeholders": [
        "4f2d7c8b9e1a4f0d8f3c2b176a4e9d22",
        "c1378a9fe2bd4e56a1c4d9f87b33a6c4"
      ],
      "pageModels": [
        "4f2d7c8b9e1a4f0d8f3c2b176a4e9d22",
        "c1378a9fe2bd4e56a1c4d9f87b33a6c4"
      ]
    },
    "variantNames": [
      "Default",
      "Dark"
    ]
  }'

Responses

Successful operation

Bodyapplication/json
componentIdstring or null

The identifier of the created component.

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

The identifier of the created content type, or null when the draft had no content type definition.

Example:"2f34355e-c52d-450e-b1b9-d4e9cbe64af2"
Response
{ "componentId": "2492bac4-da07-4c86-87f0-9873d40e2276", "contentModelId": "2f34355e-c52d-450e-b1b9-d4e9cbe64af2" }