# Add a component to a page

Adds a component to a specific placeholder on a page. You can specify the component type, placeholder location, and configure its initial settings. Optionally, you can specify its position relative to an existing component.

Endpoint: POST /api/v1/pages/{pageId}/components
Version: v2.0
Security: HTTPBearer

## Security:

  - `HTTPBearer` (unknown)
    http bearer JWT

## Path parameters:

  - `pageId` (string, required)
    The unique identifier of the page. To get this ID, use [List pages of a site](#operation/sites-get_all_pages_by_site).

## Header parameters:

  - `x-sc-job-id` (any)
    A unique identifier for the job, used to trace, audit, and revert actions performed by an AI agent through the Agent API.

## Request fields (application/json):

  - `componentRenderingId` (string, required)
    The unique identifier of the component rendering definition.
    Example: 86a03271-dff4-470a-92bd-b68c67de2e25

  - `placeholderPath` (string, required)
    The path of the placeholder where the component will be placed.
    Example: /main/content

  - `componentItemName` (string, required)
    The name of the component item to create.
    Example: New sidebar component

  - `language` (string)
    The language code for the component.
    Example: en

  - `fields` (any)
    Field values to set on the component or its datasource.

  - `insertBeforeComponentId` (any)
    The unique identifier of the component before which the new component will be inserted.
    Example: 9c6d53e3-fe57-4638-af7b-6d68304c7a94

  - `insertAfterComponentId` (any)
    The unique identifier of the component after which the new component will be inserted.
    Example: 9c6d53e3-fe57-4638-af7b-6d68304c7a94

## Response 201:

  - `201` (unknown)
    Successful response

## Response 201 fields (application/json):

  - `componentId` (string)
    The unique identifier of the newly added component.
    Example: d290f1ee-6c54-4b01-90e6-d701748f0851

  - `pageId` (string)
    The unique identifier of the page to which the component was added.
    Example: 3f2504e0-4f89-11d3-9a0c-0305e82c3301

  - `placeholderId` (any)
    The unique identifier of the placeholder where the component was placed.
    Example: 123e4567-e89b-12d3-a456-426614174000

  - `datasourceId` (any)
    The unique identifier of the datasource used by the component, if applicable.
    Example: 9f8c7e6d-5b4a-4c3d-8e7f-1a2b3c4d5e6f

## Response 422:

  - `422` (unknown)
    Unprocessable entity

## Response 422 fields (application/json):

  - `detail` (array)

  - `detail.loc` (array)
    The location of the error in the request.

  - `detail.msg` (string)
    The error message.

  - `detail.type` (string)
    The type of error.

  - `detail.input` (any)
    The input that caused the error.

  - `detail.ctx` (object)
    The context in which the error occurred.

