# List content types

_NgCms / Content Types_

`GET /ng-cms/content-types/{projectId}`

## Parameters

- `projectId` (string, required) — The unique identifier of the project
- `from` (number, optional, default: `1`) — Starting offset for pagination (1-based)
- `to` (number, optional, default: `20`) — Maximum number of items to return per page

## Responses

### `200` — Paginated list of content types for the project.

Type: `PagedApiResponse<CmsContentTypeDto>`


### `401` — Unauthorized. A valid API key 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/content-types/{projectId}?from=1&to=20' \\
  --header 'x-api-key: <api-key>'
```

### javascript

```js
const options = {
  method: 'GET',
  headers: { 'x-api-key': '<api-key>' }
};

fetch('https://apis-spb.konso.io/ng-cms/content-types/{projectId}?from=1&to=20', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
```

### dotnet

```dotnet
var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "<api-key>");

var response = await client.GetAsync("https://apis-spb.konso.io/ng-cms/content-types/{projectId}?from=1&to=20");
var result = await response.Content
    .ReadFromJsonAsync<PagedApiResponse<CmsContentTypeDto>>();
```

### python

```python
import requests

url = "https://apis-spb.konso.io/ng-cms/content-types/{projectId}"
headers = { "x-api-key": "<api-key>" }
params = { "from": 1, "to": 20 }

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

### Response Example (200)

```json
{
  "total": 2,
  "list": [
    {
      "id": "ct_a1b2c3d4e5f6",
      "projectId": "my-project-id",
      "name": "Blog Post",
      "key": "blog-post",
      "description": "Standard blog post content type",
      "displayField": "title",
      "schema": [
        {
          "key": "title",
          "label": "Title",
          "type": "text",
          "required": true,
          "maxLength": 300
        },
        {
          "key": "body",
          "label": "Body",
          "type": "richtext",
          "required": true
        }
      ],
      "schemaVersion": 2,
      "fieldsCount": 2,
      "isActive": true,
      "createdBy": 42,
      "updatedBy": 42,
      "updatedByName": "Jane Smith",
      "createdAt": "2025-01-10T12:00:00Z",
      "updatedAt": "2025-03-05T09:30:00Z"
    }
  ]
}
```

## 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)
