# Publish a content

**Publié le** : 2026-05-08
**Catégorie** : Core CMS

## `POST /contents/:id/publish`

**Publish a content**

Transitions a content from `draft` or `scheduled` to `published`.
Sets `publishedAt` to the current timestamp if not already set.

Required permissions: `contents.publish`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | Yes | Unique identifier |


### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
| `401` | Unauthorized — invalid or missing API token |
| `403` | Forbidden — insufficient permissions |
| `404` | Not found |
| `422` | Validation error |


> **Notes:** - Triggers `content.published` webhook.
> 
> - Triggers IndexNow submission if configured.
> - Cannot publish an already archived content — restore it to draft first.

### Examples

```bash
curl -X POST https://api.lynkow.com/v1/contents/42/publish \
  -H "Authorization: Bearer $API_TOKEN"
```

### Response Example

```json
{
  "data": {
    "id": 42,
    "title": "Getting Started with Lynkow",
    "slug": "getting-started-with-lynkow",
    "type": "post",
    "status": "published",
    "excerpt": "Learn how to set up your first headless CMS.",
    "locale": "en",
    "publishedAt": "2025-04-06T14:30:00.000Z",
    "createdAt": "2025-03-14T08:00:00.000Z",
    "updatedAt": "2025-04-06T14:30:00.000Z"
  }
}
```

---