# Publish a content entry

_NgCms / Content Entries_

`POST /ng-cms/content/{projectId}/{typeKey}/{entryId}/publish`

## Parameters

- `projectId` (string, required) — Unique identifier of the project
- `typeKey` (string, required) — Key of the content type the entry belongs to
- `entryId` (string, required) — Unique identifier of the content entry to publish
- `publishedAt` (string, optional) — Optional ISO 8601 date-time to schedule the publish time. If omitted, the entry is published immediately.

## Responses

### `200` — Entry successfully published.

Type: `ApiResponse<bool>`

- `success` (boolean) — Always true on success
- `result` (boolean) — true when the entry was published
- `errors` (ErrorDetail[]) — Empty on success

### `401` — Unauthorized. A valid API key is required.


### `404` — Not Found. No content entry or project exists for the given identifiers.


### `500` — Unexpected server error.

Type: `ApiResponse<bool>`

- `success` (boolean) — Always false
- `errors` (ErrorDetail[]) — Server-side errors
  - `correlationId` (string) — Trace ID
  - `message` (string) — Error message
  - `stack` (string) — Stack trace (non-production only)


## Code Examples

### curl

```curl
curl --request POST \
  --url https://apis-spb.konso.io/ng-cms/content/{projectId}/{typeKey}/{entryId}/publish \
  --header 'x-api-key: <token>'
```

### javascript

```js
fetch('https://apis-spb.konso.io/ng-cms/content/{projectId}/{typeKey}/{entryId}/publish', {
  method: 'POST',
  headers: { 'x-api-key': '<token>' }
})
  .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", "<token>");
var response = await client.PostAsync("https://apis-spb.konso.io/ng-cms/content/{projectId}/{typeKey}/{entryId}/publish", null);
var result = await response.Content.ReadFromJsonAsync<ApiResponse<bool>>();
```

### python

```python
import requests

response = requests.post(
    'https://apis-spb.konso.io/ng-cms/content/{projectId}/{typeKey}/{entryId}/publish',
    headers={'x-api-key': '<token>'}
)
print(response.json())
```

### Request Body Example

```json
{
  "projectId": "example-string",
  "typeKey": "example-string",
  "entryId": "example-string",
  "publishedAt": "example-string"
}
```

### Response Example (200)

```json
{
  "success": true,
  "result": true,
  "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)
