# Retrieve component metadata

Fetches the metadata of a component.

Endpoint: GET /api/v1/components/{componentId}/metadata
Version: v1
Security: Bearer

## Security:

  - `Bearer` (unknown)
    http Bearer

## Path parameters:

  - `componentId` (string, required)
    The component identifier.

## Query parameters:

  - `siteId` (string, required)
    The site identifier.

  - `contextItemId` (string, required)
    The context item identifier.

  - `componentName` (string)
    The component name.

  - `renderingHostName` (string, required)
    The rendering host name.

  - `environmentId` (string)
    The environment identifier.

## Response 200:

  - `200` (unknown)
    Successful operation

## Response 200 fields (application/json):

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

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

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

  - `code` (string)
    The component code.
    Example: const Greeting = () => <h1>Hello!</h1>;

  - `renderingParameters` (array)
    Rendering parameters

  - `renderingParameters.name` (string)
    The rendering parameter name
    Example: styles

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

  - `renderingParameters.editingControls` (array)

  - `renderingParameters.editingControls.id` (string)
    The editing control identifier.
    Example: {18293E6E-708E-4B15-84C3-AE52CC17A1}

  - `renderingParameters.editingControls.name` (string)
    The editing control name.
    Example: Spacing

  - `renderingParameters.editingControls.displayName` (string)
    The editing control display name.
    Example: Spacing

  - `renderingParameters.editingControls.type` (string)
    The editing control type.
    Example: icon-button-group-check

  - `renderingParameters.editingControls.tooltip` (string)
    The editing control tooltip.
    Example: Use this control to adjust the spacing of your component.

  - `renderingParameters.editingControls.values` (array)

  - `renderingParameters.editingControls.values.id` (string)
    The editing control value identifier.
    Example: {18293E6E-708E-4B15-84C3-AE52CC17A1EE}

  - `renderingParameters.editingControls.values.name` (string)
    The editing control value name.
    Example: Indent top

  - `renderingParameters.editingControls.values.icon` (string)
    The editing control value icon.
    Example: add-spacing-top

  - `renderingParameters.editingControls.values.value` (string)
    The editing control value.
    Example: indent-top

  - `renderingParameters.editingControls.values.tooltip` (string)
    The editing control tooltip.
    Example: Top spacing

  - `settings` (object)
    Component settings.

  - `availability` (object)
    The component availability model

  - `availability.sites` (array)
    List of sites the component is assigned to.

  - `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.pageModels` (array)
    The content types where component is allowed.

  - `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 or site 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.

