# List component drafts

Lists component drafts.

Endpoint: GET /api/v1/components/drafts
Version: v1
Security: Bearer

## Security:

  - `Bearer` (unknown)
    http Bearer

## Query parameters:

  - `environmentId` (string)
    The environment identifier.

## Response 200:

  - `200` (unknown)
    Successful operation. The content type draft in the response body is the content type draft associated with this component draft.

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

