The Components API lets you retrieve components, get the details of a specific component, search datasources in a component, and create a component datasource.

Request

Creates a new datasource item for a specific component using the provided data field values. The datasource will be created in the appropriate location based on the component's configuration.

Security
HTTPBearer
Path
componentIdstring, (uuid)(Componentid)required

The unique identifier of the component for which to create a datasource. To get this ID, use the List allowed components for a placeholder endpoint.

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
siteNamestring(Sitename)required

The name of the site for which the datasource is created.

Example:"skate-park"
dataFieldsobject(Datafields)required

A key-value map of data field names and their values for the datasource.

Example:
{ "PromoText": "Summer Sale" }
childrenArray of objects or null(Children)
Any of:

A list of child datasource objects, or null if none.

languagestring(Language)

The language code for the datasource.

Default:"en"
Example:"en"
curl -i -X POST \
  https://edge-platform.sitecorecloud.io/stream/ai-agent-api/api/v1/components/86a03271-dff4-470a-92bd-b68c67de2e25/datasources \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'x-sc-job-id: job-1234' \
  -d '{
    "siteName": "skate-park",
    "dataFields": {
      "PromoText": "Summer Sale"
    },
    "children": [
      {}
    ],
    "language": "en"
  }'

Responses

Successful response

Bodyapplication/json
datasourceIdstring, (uuid)(Datasourceid)

The unique identifier of the created datasource.

Example:"9f8c7e6d-5b4a-4c3d-8e7f-1a2b3c4d5e6f"
datasourceLocationstring(Datasourcelocation)

The location path of the created datasource.

Example:"/sitecore/content/Verticals/SkatePark/Data/Promos"
Response
{ "datasourceId": "9f8c7e6d-5b4a-4c3d-8e7f-1a2b3c4d5e6f", "datasourceLocation": "/sitecore/content/Verticals/SkatePark/Data/Promos" }