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
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
The name of the site for which the datasource is created.
Example:"skate-park"
A key-value map of data field names and their values for the datasource.
Example:
{ "PromoText": "Summer Sale" }
Any of:
A list of child datasource objects, or null if none.
- Production serverhttps://edge-platform.sitecorecloud.io/stream/ai-agent-api/api/v1/components/{componentId}/datasources
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
- Array of objects
- null
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"
}'Successful response
Response
{ "datasourceId": "9f8c7e6d-5b4a-4c3d-8e7f-1a2b3c4d5e6f", "datasourceLocation": "/sitecore/content/Verticals/SkatePark/Data/Promos" }