---
title: "Rename or relabel a media library file"
type: reference
method: POST
path: /rest-api/media-library/assets/{assetId}/update.do
tag: "Media Library"
---

# Rename or relabel a media library file

`POST https://YOUR-NETWORK-DOMAIN/rest-api/media-library/assets/{assetId}/update.do`

Changes the display 'name' and/or the 'advertiserId' label of a file; 'advertiserId' 0 removes the label. The stored file never changes; a parameter not sent keeps its value. A user with shared advertisers may change only files uploaded for one of their advertisers, and may relabel them only to another of theirs, never to none. Requires the MEDIA_LIBRARY permission and update rights on campaigns.

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `assetId` | integer | yes | `42` | Media library file id |

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `name` | string | no | `Spring sale 30s v2` | New display name, up to 255 characters |
| `advertiserId` | integer | no | `1001` | New advertiser label; 0 removes it |

## Responses

- `200` — {success, asset:{...}}
- `400` — Field errors under 'errors': 'name' blank or longer than 255 characters; 'advertiserId' 0 from a user with shared advertisers
- `401` — Authentication error
- `403` — The role lacks MEDIA_LIBRARY or campaign update rights, or no rights on the file's advertiser
- `404` — No such file, it is deleted, or the user cannot see it

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/media-library/assets/42/update.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'advertiserId=1001' \
  --data-urlencode 'name=Spring sale 30s v2'
```

Source: https://epom.com/ad-server/docs/api/media-library/post-media-library-assets-update