- Set the component datasource
Sets the datasource for a specific component on a page. You can specify a new data source item or clear the existing one.
The unique identifier of the page.To get this ID, use List pages of a site.
The unique identifier of the component on the page. To get this ID, use Retrieve components on a page.
The unique identifier of the datasource to set for the component. To get this ID, you can use the List datasources endpoint.
The unique identifier of personalization or A/B/n test variant to update. To get this ID, you can use the List flow definitions endpoint. Use the transpiledVariants[].ref, or variants[].ref when available.
If you provide this value, the datasource update applies only to the specified variant. If you omit this value, the change applies to the base page.
- Production serverhttps://edge-platform.sitecorecloud.io/stream/ai-agent-api/api/v1/pages/{pageId}/components/{componentId}/datasource
- 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/86a03271-dff4-470a-92bd-b68c67de2e25/datasource \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-H 'x-sc-job-id: job-1234' \
-d '{
"datasourceId": "3f2504e0-4f89-11d3-9a0c-0305e82c3301",
"language": "en",
"variantId": "8bd7a9ec96b8490f9b894e3866fefb79_2a5c1e8c8d244f569a44d6b28cbecb05"
}'Successful response
A message providing additional information about the operation.
The unique identifier of the component.
The unique identifier of the page.
{ "success": true, "message": "Datasource set successfully.", "componentId": "86a03271-dff4-470a-92bd-b68c67de2e25", "pageId": "9f8c7e6d-5b4a-4c3d-8e7f-1a2b3c4d5e6f", "datasourceId": "f0b81bcc-7388-46be-b109-6e73d1114470" }