# Update a category

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

## `PUT /categories/:id`

**Update a category**

Updates a category's name, slug, description, parent, or schema.
Moving a category to a different parent re-organizes the tree.

Required permissions: `categories.update`

### Parameters

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


### Request Body

Content-Type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | No | Display name. 1-255 characters |
| `slug` | string | No | URL-friendly identifier, unique per site and locale. 1-255 characters |
| `description` | string \| null | No | Description text |
| `image` | string \| null | No | Image URL |
| `parentId` | string \| null | No | Parent resource ID |
| `sitemapPriority` | number \| null | No | Sitemap priority (0.0-1.0) |
| `sitemapChangefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" \| null | No | Sitemap change frequency (daily, weekly, monthly) |
| `contentMode` | "standard" \| "structured" | No | One of: standard, structured |
| `schema` | object | No | Field schema definition |
| `schemaSource` | "own" \| "inherit" | No | One of: own, inherit |
| `displayOrder` | number | No | Number |
| `jsonLdGraph` | object[] | No | Max 50 characters. Array of objects |
| `jsonLdExclusions` | string[] | No | Max 50 characters. Array of strings |


### Responses

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


> **Notes:** - Changing the slug does not update content URLs — only the category's own slug changes.

### Examples

```bash
curl -X PUT https://api.lynkow.com/v1/categories/5 \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "REST API Guides",
    "description": "Updated description for API guides"
  }'
```

### Response Example

```json
{
  "data": {
    "id": 5,
    "name": "REST API Guides",
    "slug": "api-guides",
    "description": "Updated description for API guides",
    "parentId": 1,
    "locale": "en",
    "contentCount": 5,
    "createdAt": "2025-04-06T12:00:00.000Z",
    "updatedAt": "2025-04-06T16:00:00.000Z"
  }
}
```

---