The Assets API lets you upload, search assets, retrieve asset details, and update asset metadata.

Request

Uploads a new digital asset to the system and stores it with the provided metadata.

Security
HTTPBearer
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
Bodymultipart/form-datarequired
filestring(File)required

The file to upload as an asset. You must select a file from your local machine.

upload_requeststring(Upload Request)required

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

Responses

Successful response

Bodyapplication/json
successboolean(Success)

Whether the asset upload was successful.

Example:true
mediaItemobject(MediaItem)

The uploaded media item details.

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