Uploads a new digital asset to the system and stores it with the provided metadata.
Security
HTTPBearer
The file to upload as an asset. You must select a file from your local machine.
A JSON string containing the following parameters for uploading an asset:
name- the name of the asset.itemPath- the path to the asset.language- the language code of the asset.extension- the asset's file extension.siteName- the name of the site. process.
JSON structure with example values:
{
"name": "{YOUR_ASSETNAME}.jpg",
"itemPath": "/sitecore/Media Library/Images",
"language": "en",
"extension": "jpg",
"siteName": "skate-park"
}
Example:"{\n \"name\":\"homeimage.jpg\",\n \"itemPath\": \"/sitecore/Media Library/Images\",\n \"language\": \"en\",\n \"extension\": \"jpg\",\n \"siteName\"
- Production serverhttps://edge-platform.sitecorecloud.io/stream/ai-agent-api/api/v1/assets/upload
- 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/assets/upload \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: multipart/form-data' \
-H 'x-sc-job-id: job-1234' \
-F file=string \
-F 'upload_request={
"name":"homeimage.jpg",
"itemPath": "/sitecore/Media Library/Images",
"language": "en",
"extension": "jpg",
"siteName": "skate-park"
}'Response
{ "success": true, "mediaItem": { "id": "3f2504e0-4f89-11d3-9a0c-0305e82c3301", "embedUrl": "https://example.com/media/3f2504e0-4f89-11d3-9a0c-0305e82c3301", "size": 204800, "dimensions": "1920x1080", "extension": "mp4" } }