- 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.
The unique identifier of the page. To get this ID, use List pages of a site.
The unique identifier of the component rendering definition.
The path of the placeholder where the component will be placed.
The name of the component item to create.
The unique identifier of the component before which the new component will be inserted.
- Production serverhttps://edge-platform.sitecorecloud.io/stream/ai-agent-api/api/v1/pages/{pageId}/components
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://edge-platform.sitecorecloud.io/stream/ai-agent-api/api/v1/pages/f0b81bcc-7388-46be-b109-6e73d1114470/components \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-H 'x-sc-job-id: job-1234' \
-d '{
"componentRenderingId": "86a03271-dff4-470a-92bd-b68c67de2e25",
"placeholderPath": "/main/content",
"componentItemName": "New sidebar component",
"language": "en",
"fields": {},
"insertBeforeComponentId": "9c6d53e3-fe57-4638-af7b-6d68304c7a94",
"insertAfterComponentId": "9c6d53e3-fe57-4638-af7b-6d68304c7a94"
}'Successful response
The unique identifier of the newly added component.
The unique identifier of the page to which the component was added.
The unique identifier of the placeholder where the component was placed.
{ "componentId": "d290f1ee-6c54-4b01-90e6-d701748f0851", "pageId": "3f2504e0-4f89-11d3-9a0c-0305e82c3301", "placeholderId": "123e4567-e89b-12d3-a456-426614174000", "datasourceId": "9f8c7e6d-5b4a-4c3d-8e7f-1a2b3c4d5e6f" }