# Delete a content type

_NgCms / Content Types_

`DELETE /ng-cms/content-types/{projectId}/{key}`

## Parameters

- `projectId` (string, required) — The unique identifier of the project (bucket)
- `key` (string, required) — The ID or key of the content type to delete

## Responses

### `200` — Content type archived successfully. Returns the ID of the deleted content type.

Type: `ApiResponse<string>`

- `success` (boolean) — Indicates whether the request was successful
- `result` (string) — The ID of the deleted content type
- `errors` (ErrorDetail[]) — List of errors (empty on success)

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


### `404` — Not Found. No content type exists with the given ID or key.


### `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/content-types/{projectId}/{key} \\
  --header 'Authorization: Bearer <token>'
```

### javascript

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

fetch('https://apis-spb.konso.io/ng-cms/content-types/{projectId}/{key}', 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/content-types/{projectId}/{key}");
var result = await response.Content.ReadFromJsonAsync<ApiResponse<string>>();
```

### python

```python
import requests

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

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

### Response Example (200)

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

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