# `PUT /category/order` Protected. Requires a valid session cookie (`credentials: 'include'`). Reorder sibling categories Sets the sibling sort order of `categoryIds` under `parentId`. `categoryIds` must be exactly the current child set of `parentId` (same count, no foreign/duplicate ids). Each child's `sort` is set to its index `0..n-1` in one transaction. ## Body (JSON) | Field | Required | Type | Description | |-------|----------|------|-------------| | `parentId` | yes | integer | Parent category under which sibling order applies | | `categoryIds` | yes | integer[] | | ```json { "parentId": 1, "categoryIds": [ 2, 4, 3, 5 ] } ``` ## Signals On success, emits SSE signal: `category` (see [`GET /events`](../events.md)). ## Response `200` New sibling order ```json { "categoryIds": [ 1 ] } ``` ## Errors | Status | Description | |--------|-------------| | 400 | Invalid category order — `{"error":"…"}` | | 401 | Unauthorized — `{"error":"…"}` | | 403 | Not authorized — `{"error":"…"}` | | 404 | Parent category not found — `{"error":"…"}` | --- _Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._