# `album.reorder`

<span class="badge">bearer</span>

**Set the manual order of photos within a folder**

Assigns the given order to the listed images (all must belong to the folder). Pure metadata — no re-render.

## Parameters

Passed by name in the `params` object.

| Name | Type | Required | Description |
|---|---|---|---|
| `album_id` | string | yes | Folder UUID |
| `ordered_ids` | `array<string>` | yes | Image UUIDs in the desired order; all must belong to the folder |

## Result

Returns an empty object `{}` on success.

## Errors

| Code | Message | When |
|---|---|---|
| `2001` | `not_found` | No such resource owned by the caller. |

See the [error reference](/docs/errors) for the full catalog, including the authentication codes.

## Example

Request:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "album.reorder",
  "params": {
    "album_id": "018f3a80-1c2d-7e00-9a00-0b1c2d3e4f50",
    "ordered_ids": [
      "018f3a7d-2b8c-7f1a-a4d5-6e7f8a9b0c1d",
      "018f3a7d-2b8c-7f1a-a4d5-6e7f8a9b0c1e"
    ]
  }
}
```

Response:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {}
}
```

**curl**

```bash
curl -s https://peinture.gumeniuk.com/rpc \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"album.reorder","params":{"album_id":"018f3a80-1c2d-7e00-9a00-0b1c2d3e4f50","ordered_ids":["018f3a7d-2b8c-7f1a-a4d5-6e7f8a9b0c1d","018f3a7d-2b8c-7f1a-a4d5-6e7f8a9b0c1e"]}}'
```

**JavaScript**

```js
const res = await fetch("https://peinture.gumeniuk.com/rpc", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": `Bearer ${token}`,
  },
  body: JSON.stringify({
    jsonrpc: "2.0", id: 1, method: "album.reorder", params: {"album_id":"018f3a80-1c2d-7e00-9a00-0b1c2d3e4f50","ordered_ids":["018f3a7d-2b8c-7f1a-a4d5-6e7f8a9b0c1d","018f3a7d-2b8c-7f1a-a4d5-6e7f8a9b0c1e"]},
  }),
});
const { result, error } = await res.json();
```

**Go**

```go
body := []byte(`{"jsonrpc":"2.0","id":1,"method":"album.reorder","params":{"album_id":"018f3a80-1c2d-7e00-9a00-0b1c2d3e4f50","ordered_ids":["018f3a7d-2b8c-7f1a-a4d5-6e7f8a9b0c1d","018f3a7d-2b8c-7f1a-a4d5-6e7f8a9b0c1e"]}}`)
req, _ := http.NewRequest("POST", "https://peinture.gumeniuk.com/rpc", bytes.NewReader(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
```

