---
title: "Upload an asset"
slug: "upload-an-asset"
abstract: "Walkthrough for uploading an asset and creating a media item."
---
# Upload an asset

Content Hub ONE uses a [media management system](https://doc.sitecore.com/ch-one/en/developers/content-hub-one/content-management-api/media-items/content-hub-one-architecture.md "Content Hub ONE architecture") to upload assets and make them available for use in content. This process involves the following steps:

1. For the assets you want to upload, [generate upload links](https://doc.sitecore.com/ch-one/en/developers/content-hub-one/content-management-api/media-items/upload-an-asset.html#UUID-a92c248c-3377-065d-3d22-5a84ba1b2ad5_N1711651031318 "Generate an upload link for a single asset") either one at a time or [in bulk](https://doc.sitecore.com/ch-one/en/developers/content-hub-one/content-management-api/media-items/upload-an-asset.html#UUID-a92c248c-3377-065d-3d22-5a84ba1b2ad5_N1711651045053 "Generate upload links for multiple assets in bulk").
2. Use each link to [upload the corresponding asset](https://doc.sitecore.com/ch-one/en/developers/content-hub-one/content-management-api/media-items/upload-an-asset.html#UUID-a92c248c-3377-065d-3d22-5a84ba1b2ad5_N1711651064747 "Upload the asset").
3. Use the **fileId** of each asset to [complete the upload](https://doc.sitecore.com/ch-one/en/developers/content-hub-one/content-management-api/media-items/upload-an-asset.html#UUID-a92c248c-3377-065d-3d22-5a84ba1b2ad5_N1711651100396 "Complete the upload").
4. Use the **fileId** of each asset to create the media item.

> [!note]
> The [base URL](https://doc.sitecore.com/ch-one/en/developers/content-hub-one/content-management-api/media-items/content-management-api.html "Content Management API") for uploading media assets is `https://mms-upload.sitecorecloud.io`. After uploading an asset, you can [transform it by manipulating the URL](https://doc.sitecore.com/ch-one/en/developers/content-hub-one/content-management-api/media-items/media-transformations.html "Media transformations"). For a full list of fields, parameters, and technical limitations, see the [data model](https://doc.sitecore.com/ch-one/en/developers/content-hub-one/content-management-api/media-items/data-model.html "Data model").

> [!tip]
> An [overview of how to use the Content Management API and the Media Upload API](https://www.youtube.com/watch?v=qxXTiVd8rZ8) is available on the Discover Sitecore channel.

Once the media item exists in Content Hub ONE, content authors can use it in content they create.

## Generate an upload link for a single asset

Use this method to generate an upload link for a single asset.

### Headers

The following mandatory headers are used for validation when generating an upload link:

- *x-mms-content-type* is one of the allowed media types. Content Hub ONE supports a [variety of media](https://doc.sitecore.com/ch-one/en/users/content-hub-one/en/create-a-media-item.html#UUID-5e57dc05-0982-5dd6-0a4f-4a23d37732f1_para-idm273444853277904).
- *x-mms-content-length* is the length in bytes of the file being uploaded. If this header is not present, validation fails.

```curl
curl --location '<BASE_URL>/api/media/v1/upload/link/generate' \
--header 'x-mms-content-type: image/jpeg' \
--header 'x-mms-content-length: 1024' \
--header 'Content-Type: application/json' \
--header 'Authorization: <BEARER_TOKEN>' \
--data '{
 "filename": "bouquet-of-color.jpg"
}'
```

```json
{
  "responses": [
    {
      "link": "<BASE_URL>/41bbf9be-3e5a-4de9-cadc-08db20be01bc-files/b13f5b73ef7549f8927d5eb86e6506d3?se=2023-04-11T18%3a22%3a47Z&sig=YsJ2fdwK6ZzeJKgTETekAsBx%2bWYHN6334wnCr7fPF7Y%3d",
      "fileId": "b13f5b73ef7549f8927d5eb86e6506d3",
      "requestId": "image-one-id"
    },
    {
      "link": "<BASE_URL>/41bbf9be-3e5a-4de9-cadc-08db20be01bc-files/3bff648962084e09add3471d39ae9279?se=2023-04-11T18%3a22%3a47Z&sig=Z0CHxMRnFkKIpJ4EiL7jZAH1%2fEaafyV1HGbAqIp65bU%3d",
      "fileId": "3bff648962084e09add3471d39ae9279",
      "requestId": "image-two-id"
    }
  ],
  "success": true
```

Copy the **link** to use in the next stage of the workflow. You will use the **fileId** when you complete the upload.

## Generate upload links for multiple assets in bulk

Use this method to generate multiple upload links at once. Fewer API calls are made when using the `bulk` method because the `fileIds` and the `URLs` are generated in one call.

```curl
curl --location '<BASE_URL>/api/media/v1/upload/link/generate/bulk' \
--header 'x-mms-content-type: image/jpeg' \
--header 'x-mms-content-length: 1024' \
--header 'Content-Type: application/json' \
--'Authorization: <BEARER_TOKEN>' \
--data '[
 {
  "requestId": "image-one-id",
  "filename": "blue-exploding-lines.jpg",
  "contentType": "image/jpeg",
  "contentLength": "100500"
 },
 {
  "requestId": "image-two-id",
  "filename": "bouquet-of-color.jpg",
  "contentType": "image/jpeg",
  "contentLength": "100501"
 }
]'
```

```json
{
  "responses": [
    {
      "link": "<BASE_URL>/41bbf9be-3e5a-4de9-cadc-08db20be01bc-files/b13f5b73ef7549f8927d5eb86e6506d3?se=2023-04-11T18%3a22%3a47Z&sig=YsJ2fdwK6ZzeJKgTETekAsBx%2bWYHN6334wnCr7fPF7Y%3d",
      "fileId": "b13f5b73ef7549f8927d5eb86e6506d3",
      "requestId": "image-one-id"
    },
    {
      "link": "<BASE_URL>/41bbf9be-3e5a-4de9-cadc-08db20be01bc-files/3bff648962084e09add3471d39ae9279?se=2023-04-11T18%3a22%3a47Z&sig=Z0CHxMRnFkKIpJ4EiL7jZAH1%2fEaafyV1HGbAqIp65bU%3d",
      "fileId": "3bff648962084e09add3471d39ae9279",
      "requestId": "image-two-id"
    }
  ],
  "success": true
```

Copy the **link** for each image to use in the next stage of the workflow. You can only upload one asset at a time. You will use the **fileId** when you complete the upload.

## Upload the asset

Use this method to upload an asset using the generated upload link.

```curl
curl --location --request PUT '<BASE_URL>/41bbf9be-3e5a-4de9-cadc-08db20be01bc-files/b5c45c02f0e942f898898b9f5de2e04c?se=2023-04-14T13%253a05%253a02Z&sig=X7YFq1lpGiZRKu3%252bZuPJ3mzM0yMVrnRftJ4T%252bd9obq8%253d' \
--header 'x-mms-content-type: image/png' \
--header 'x-mms-content-length: 1024' \
--header 'x-ms-blob-type: BlockBlob' \
--header 'Content-Type: text/plain' \
--data '@'
```

## Complete the upload

Use this method to complete the upload of an asset using its **fileId**, which was obtained when the link was generated.

```curl
curl --location '<BASE_URL>/api/media/v1/upload/link/complete' \
--header 'x-mms-content-type: image/jpeg' \
--header 'x-mms-content-length: 1024' \
--header 'Content-Type: application/json' \
--'Authorization: <BEARER_TOKEN>' \
--data '{
  "fileId": "b5c45c02f0e942f898898b9f5de2e04c"
}'
```

```csharp
{
  "fileId": "b5c45c02f0e942f898898b9f5de2e04c",
  "publicLink": null
}
```