# Delete a media asset

_NgCms / Media Assets_

`DELETE /ng-cms/media/{projectId}/{mediaId}`

## Parameters

- `projectId` (string, required) — The unique identifier of the project (bucket)
- `mediaId` (string, required) — The unique identifier of the media asset to delete

## Responses

### `200` — Media asset deleted successfully.

Type: `ApiResponse<boolean>`

- `success` (boolean) — Indicates whether the request was successful
- `result` (boolean) — Always true on success
- `errors` (ErrorDetail[]) — List of errors (empty on success)

### `401` — Unauthorized. A valid bearer token is required.


### `404` — Not Found. No media asset exists with the given ID.


### `412` — Precondition Failed. The project's current plan does not allow access to this resource, or payment is required to proceed.


### `500` — Unexpected server error.

Type: `ApiResponse<T>`

- `success` (boolean) — Always false
- `errors` (ErrorDetail[]) — List of server-side errors
  - `correlationId` (string) — Unique ID for tracing the error
  - `message` (string) — Error message
  - `stack` (string) — Stack trace (non-production only)


## Code Examples

### curl

```curl
curl --request DELETE \
  --url https://apis-spb.konso.io/ng-cms/media/{projectId}/{mediaId} \
  --header 'Authorization: Bearer <token>'
```

### javascript

```js
const options = {
  method: 'DELETE',
  headers: { Authorization: 'Bearer <token>' }
};

fetch('https://apis-spb.konso.io/ng-cms/media/{projectId}/{mediaId}', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
```

### dotnet

```dotnet
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", "<token>");

var response = await client.DeleteAsync("https://apis-spb.konso.io/ng-cms/media/{projectId}/{mediaId}");
var result = await response.Content.ReadFromJsonAsync<ApiResponse<bool>>();
```

### python

```python
import requests

url = "https://apis-spb.konso.io/ng-cms/media/{projectId}/{mediaId}"
headers = { "Authorization": "Bearer <token>" }

response = requests.delete(url, headers=headers)
print(response.json())
```

### Response Example (200)

```json
{
  "success": true,
  "result": true,
  "errors": []
}
```
