# Update a content

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

## `PUT /contents/:id`

**Update a content**

Updates an existing content. Only the fields you include in the
request body are modified — omitted fields remain unchanged.

Updating a published content does **not** unpublish it. To change
status, use the dedicated publish/archive endpoints.

Required permissions: `contents.update`

### Parameters

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


### Request Body

Content-Type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | "post" | No | Resource type. One of: post |
| `title` | string | No | Display title. 1-500 characters |
| `slug` | string | No | URL-friendly identifier, unique per site and locale. 1-500 characters |
| `excerpt` | string | No | Short summary for previews |
| `body` | object | No | Rich text content as TipTap JSON |
| `bodyMarkdown` | string | No | Content as Markdown (converted to TipTap JSON on save) |
| `status` | "draft" \| "published" \| "archived" \| "scheduled" | No | One of: draft, published, archived, scheduled |
| `featuredImage` | string | No | Featured image URL |
| `scheduledAt` | string | No | Scheduled publication datetime (ISO 8601) |
| `metaTitle` | string | No | Custom meta title for SEO. Max 255 characters |
| `metaDescription` | string | No | Meta description for search engines. Max 500 characters |
| `keywords` | string | No | Comma-separated SEO keywords. Max 500 characters |
| `canonicalUrl` | string | No | Canonical URL override. Max 1000 characters |
| `ogImage` | string | No | Open Graph image URL for social sharing. Max 1000 characters |
| `authorName` | string \| null | No |  |
| `authorUrl` | string \| null | No |  |
| `meta` | object | No | Additional metadata |
| `categoryIds` | string[] | No | Min 1 character. Array of strings |
| `tagIds` | string[] | No | Array of strings |
| `customData` | object \| null | No | Custom fields data (structured content) |
| `faqSettings` | object | No | FAQ detection and JSON-LD settings |
| `jsonLdGraph` | object[] | No | Max 50 characters. Array of objects |
| `jsonLdExclusions` | string[] | No | Max 50 characters. Array of strings |
| `displayOrder` | number | No | Number |


### Responses

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


> **Notes:** - Creates a new revision automatically. Use `GET /contents/{id}/revisions` to view history.
> 
> - Changing the `slug` does not create a redirect — manage redirects separately.

### Examples

```bash
curl -X PUT https://api.lynkow.com/v1/contents/42 \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Updated Title",
    "excerpt": "Updated excerpt for the article."
  }'
```

### Response Example

```json
{
  "data": {
    "id": 42,
    "title": "Updated Title",
    "slug": "getting-started-with-lynkow",
    "type": "post",
    "status": "published",
    "excerpt": "Updated excerpt for the article.",
    "bodyHtml": "<h1>Welcome</h1><p>This is your first article...</p>",
    "locale": "en",
    "categories": [
      {
        "id": 1,
        "name": "Tutorials",
        "slug": "tutorials"
      }
    ],
    "tags": [
      {
        "id": 5,
        "name": "Getting Started",
        "slug": "getting-started"
      }
    ],
    "author": {
      "id": 1,
      "fullName": "Jane Doe"
    },
    "publishedAt": "2025-03-15T10:30:00.000Z",
    "createdAt": "2025-03-14T08:00:00.000Z",
    "updatedAt": "2025-04-06T14:00:00.000Z"
  }
}
```

---