# Activate a component draft

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.

Endpoint: POST /api/v1/components/drafts/{componentDraftId}/activation
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)
    Optional availability overrides and variant names to activate.

## Request fields (application/json):

  - `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"]

  - `variantNames` (array, required)
    The names of the draft variants that should be activated.
    Example: ["Default","Dark"]

## Response 200:

  - `200` (unknown)
    Successful operation

## Response 200 fields (application/json):

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

  - `contentModelId` (string)
    The identifier of the created content type, or `null` when the draft had no content type definition.
    Example: 2f34355e-c52d-450e-b1b9-d4e9cbe64af2

## 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)
    Component draft not found

## 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.

