---
title: "Upload or replace a hosted asset"
method: PUT
path: "/groups/{groupId}/apps/{appId}/hosting/assets/asset"
tags: ["hosting"]
---

# Upload or replace a hosted asset

`PUT /groups/{groupId}/apps/{appId}/hosting/assets/asset`

Upload or replace a hosted asset at a specific resource path.

## Query parameters

- `path` string, required

## Request body

- object
  - `meta` AssetMetadata
    - `path` string — The resource path of the asset
    - `size` integer — The size of the asset in bytes
    - `attrs` MetadataAttribute[] — An array of documents that each describe a [metadata attribute](https://www.mongodb.com/docs/atlas/app-services/hosting/file-metadata-attributes) that applies to the asset.
      - `name` string — The [metadata attribute](https://www.mongodb.com/docs/atlas/app-services/hosting/file-metadata-attributes) name.
      - `value` string — The [metadata attribute](https://www.mongodb.com/docs/atlas/app-services/hosting/file-metadata-attributes) value.
    - `hash` string — The MD5 checksum hash for the asset
  - `file` string, binary — The asset file to upload (encoded as binary).

## Response `204`

Successfully added/replaced the hosted asset.

## Other responses

- `400` — There is an error in the request.

---

[API](https://skmtc.net/mongodb/apis/mongodb-atlas-app-services-admin-api.md) · [All operations](https://skmtc.net/mongodb/apis/mongodb-atlas-app-services-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mongodb/mongodb-atlas-app-services-admin-api/revisions/1365ab72bc03/schema)
