# Move a component on a page

Moves a component instance before or after another component instance on the base page layout. Components can move between compatible editable placeholders. Use targetPlaceholderPath when moving into an empty placeholder.

Endpoint: PATCH /api/v1/pages/{pageId}/components/{componentInstanceId}/position
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).

  - `componentInstanceId` (string, required)
    The unique identifier of the component instance on the page.

## 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):

  - `targetPlaceholderPath` (any)
    The destination placeholder path for the moved component.
    Example: /headless-main/column-1-1

  - `insertBeforeComponentId` (any)
    The ID of the page-component instance before which to move the component.
    Example: af4edf9c-aa98-4cd9-9807-88e0a411a7d4

  - `insertAfterComponentId` (any)
    The page-component instance ID after which to move the component.
    Example: 3a6f45e9-9459-42d1-981f-0f2c97404bbd

  - `language` (string)
    The language of the page version to update.
    Example: en

## Response 200:

  - `200` (unknown)
    Successful response

## Response 200 fields (application/json):

  - `success` (boolean)
    Whether the component was moved.
    Example: true

  - `pageId` (string)
    The unique identifier of the page containing the moved component.
    Example: 6c7d6514-9660-4599-b310-240bdff5cb1b

  - `componentInstanceId` (string)
    The instance ID of the moved component.
    Example: 3a6f45e9-9459-42d1-981f-0f2c97404bbd

  - `sourcePlaceholderPath` (any)
    The placeholder from which the component was moved.
    Example: /headless-main/column-1-1

  - `targetPlaceholderPath` (any)
    The placeholder to which the component was moved.
    Example: /headless-main/column-2-1/container-seventy-3

## Response 400:

  - `400` (unknown)
    Invalid move request or target placeholder constraints.

## Response 401:

  - `401` (unknown)
    Missing or invalid authentication token.

## Response 403:

  - `403` (unknown)
    Insufficient permissions to update the page.

## Response 404:

  - `404` (unknown)
    The page, component instance, or anchor was not found.

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

## Response 500:

  - `500` (unknown)
    An unexpected server error occurred.

