Request

Sets the datasource for a specific component on a page. You can specify a new data source item or clear the existing one.

Security
HTTPBearer
Path
pageIdstring, (uuid)(Pageid)required

The unique identifier of the page.To get this ID, use List pages of a site.

Example:f0b81bcc-7388-46be-b109-6e73d1114470
componentIdstring, (uuid)(Componentid)required

The unique identifier of the component on the page. To get this ID, use Retrieve components on a page.

Example:86a03271-dff4-470a-92bd-b68c67de2e25
Headers
x-sc-job-idany(X-Sc-Job-Id)

A unique identifier for the job, used to trace, audit, and revert actions performed by an AI agent through the Agent API.

Example:job-1234
Bodyapplication/jsonrequired
datasourceIdstring, (uuid)(Datasourceid)required

The unique identifier of the datasource to set for the component. To get this ID, you can use the List datasources endpoint.

Example:"3f2504e0-4f89-11d3-9a0c-0305e82c3301"
languagestring or null(Language)
Example:"en"
Any of:

The language for the datasource.

string
variantIdstring or null(Variantid)
Example:"8bd7a9ec96b8490f9b894e3866fefb79_2a5c1e8c8d244f569a44d6b28cbecb05"
Any of:

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.

string
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"
  }'

Responses

Successful response

Bodyapplication/json
successboolean(Success)

Whether the datasource was set successfully.

Example:true
messagestring(Message)

A message providing additional information about the operation.

Example:"Datasource set successfully."
componentIdstring, (uuid)(Componentid)

The unique identifier of the component.

Example:"86a03271-dff4-470a-92bd-b68c67de2e25"
pageIdstring, (uuid)(Pageid)

The unique identifier of the page.

Example:"9f8c7e6d-5b4a-4c3d-8e7f-1a2b3c4d5e6f"
datasourceIdstring, (uuid)(Datasourceid)

The unique identifier of the datasource.

Example:"f0b81bcc-7388-46be-b109-6e73d1114470"
Response
{ "success": true, "message": "Datasource set successfully.", "componentId": "86a03271-dff4-470a-92bd-b68c67de2e25", "pageId": "9f8c7e6d-5b4a-4c3d-8e7f-1a2b3c4d5e6f", "datasourceId": "f0b81bcc-7388-46be-b109-6e73d1114470" }