# Upload an asset

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

Endpoint: POST /api/v1/assets/upload
Version: v2.0
Security: HTTPBearer

## Security:

  - `HTTPBearer` (unknown)
    http bearer JWT

## Header parameters:

  - `x-sc-job-id` (any)
    A unique identifier for the job, used to trace, audit, and revert actions performed by an AI agent through the Agent API.

## Request fields (multipart/form-data):

  - `file` (string, required)
    The file to upload as an asset. You must select a file from your local machine.

  - `upload_request` (string, 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:

```json
{
"name":  "{YOUR_ASSETNAME}.jpg",
"itemPath": "/sitecore/Media Library/Images",
"language": "en",
"extension": "jpg",
"siteName": "skate-park"
}
```
    Example: {
  "name":"homeimage.jpg",
 "itemPath": "/sitecore/Media Library/Images",
 "language": "en",
 "extension": "jpg",
 "siteName": "skate-park"
  }

## Response 201:

  - `201` (unknown)
    Successful response

## Response 201 fields (application/json):

  - `success` (boolean)
    Whether the asset upload was successful.
    Example: true

  - `mediaItem` (object)

  - `mediaItem.id` (string)
    The unique identifier of the media item.
    Example: 3f2504e0-4f89-11d3-9a0c-0305e82c3301

  - `mediaItem.embedUrl` (string)
    The URL to embed or access the media item.
    Example: https://example.com/media/3f2504e0-4f89-11d3-9a0c-0305e82c3301

  - `mediaItem.size` (integer)
    The size of the media item in bytes.
    Example: 204800

  - `mediaItem.dimensions` (string)
    The dimensions of the media item.
    Example: 1920x1080

  - `mediaItem.extension` (string)
    The file extension of the media item.
    Example: mp4

## Response 422:

  - `422` (unknown)
    Unprocessable entity

## Response 422 fields (application/json):

  - `detail` (array)

  - `detail.loc` (array)
    The location of the error in the request.

  - `detail.msg` (string)
    The error message.

  - `detail.type` (string)
    The type of error.

  - `detail.input` (any)
    The input that caused the error.

  - `detail.ctx` (object)
    The context in which the error occurred.

