--- method: PUT path: /api/collections/:id/view-settings auth: jwt area: collections --- # Set Collection Chain Order Sets the curated listening order for the collection's episode sequence (plan §10 R2): the chain producer (`buildSmartCollectionSequenceContext`) plays `Play as Sequence` in this order. The key merges into the collection's `view_settings` JSONB — playlist toggles that share the document survive the write. Owner-only. ## Example request ```json example-request { "chain_order": "newest" } ``` ## Example response ```json example-response { "id": "550e8400-e29b-41d4-a716-446655440000", "chain_order": "newest", "view_settings": { "chain_order": "newest" } } ``` ## Fields | Field | Type | Required | Notes | | ----- | ---- | -------- | ----- | | chain_order | string | Yes | One of `native`, `newest`, `oldest`, `reverse`; `native`/empty removes the stored key | ## Errors | Status | Body | When | | ------ | ---- | ---- | | 400 | `{"error": "invalid collection id"}` | malformed id | | 400 | `{"error": "chain_order must be one of: native, newest, oldest, reverse"}` | unknown order | | 404 | `{"error": "collection not found"}` | unknown id | | 401 / 403 | — | missing JWT / not the owner |