# List media assets

_NgCms / Media Assets_

`GET /ng-cms/media/{projectId}`

## Parameters

- `projectId` (string, required) — The unique identifier of the project (bucket)
- `search` (string, optional) — Search term applied against asset title and filename
- `offset` (number, optional, default: `0`) — Number of assets to skip (0-based)
- `limit` (number, optional, default: `50`) — Maximum number of assets to return

## Responses

### `200` — Paginated list of media assets for the project.

Type: `PagedApiResponse<CmsMediaAssetDto>`


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


### `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 GET \
  --url 'https://apis-spb.konso.io/ng-cms/media/{projectId}?offset=0&limit=50' \
  --header 'Authorization: Bearer <token>'
```

### javascript

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

fetch('https://apis-spb.konso.io/ng-cms/media/{projectId}?offset=0&limit=50', 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.GetAsync("https://apis-spb.konso.io/ng-cms/media/{projectId}?offset=0&limit=50");
var result = await response.Content
    .ReadFromJsonAsync<PagedApiResponse<CmsMediaAssetDto>>();
```

### python

```python
import requests

url = "https://apis-spb.konso.io/ng-cms/media/{projectId}"
headers = { "Authorization": "Bearer <token>" }
params = { "offset": 0, "limit": 50 }

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

### Response Example (200)

```json
{
  "total": 2,
  "list": [
    {
      "id": "ma_f1e2d3c4b5a6",
      "projectId": "my-project-id",
      "fileName": "hero.jpg",
      "title": "Hero Image",
      "description": "Main banner image",
      "mimeType": "image/jpeg",
      "sizeBytes": 204800,
      "storageProvider": "s3",
      "storageKey": "hero.jpg",
      "publicUrl": "https://cdn.example.com/my-project-id/hero.jpg",
      "metadata": {},
      "createdBy": 42,
      "createdAt": "2025-05-01T09:00:00Z",
      "updatedAt": null,
      "updatedBy": null,
      "updatedByName": null,
      "publishedAt": null,
      "publishedBy": null
    },
    {
      "id": "ma_a6b5c4d3e2f1",
      "projectId": "my-project-id",
      "fileName": "logo.png",
      "title": "Company Logo",
      "description": null,
      "mimeType": "image/png",
      "sizeBytes": 51200,
      "storageProvider": "s3",
      "storageKey": "logo.png",
      "publicUrl": "https://cdn.example.com/my-project-id/logo.png",
      "metadata": {},
      "createdBy": 42,
      "createdAt": "2025-04-15T14:30:00Z",
      "updatedAt": "2025-04-20T10:00:00Z",
      "updatedBy": 42,
      "updatedByName": "Jane Smith",
      "publishedAt": null,
      "publishedBy": null
    }
  ]
}
```

## Repositories

- [konso-cms-nodejs](https://gitverse.ru/konso/konso-cms-nodejs)
- [konso-cms-dotnet](https://gitverse.ru/konso/konso-cms-dotnet)

## Packages

- `dotnet add package Konso.Clients.Cms` — [Konso.Clients.Cms](https://nugetprodusnc-northcentralus-01.regional.azure-api.net/packages/Konso.Clients.Cms)
- `npm install @konso/cms-client` — [@konso/cms-client](https://www.npmjs.com/package/@konso/cms-client)
