# `album.list`

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

**List the caller's folders (default first)**

Returns every folder with its live-image count. The default folder is pinned first and is immutable (cannot be renamed or deleted).

## Parameters

_None._

## Result

Returns `albumListResult`:

| Field | Type | Description |
|---|---|---|
| `albums *` | `array<albumDTO>` |  |

## Example

Request:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "album.list"
}
```

Response:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "albums": [
      {
        "id": "018f3a7c-0000-7000-9a00-0b1c2d3e4f50",
        "name": "Library",
        "description": "",
        "is_default": true,
        "visibility": "private",
        "image_count": 128,
        "created_at": "2026-01-01T00:00:00Z"
      },
      {
        "id": "018f3a80-1c2d-7e00-9a00-0b1c2d3e4f50",
        "name": "Iceland 2024",
        "description": "Ring road, March.",
        "is_default": false,
        "visibility": "private",
        "image_count": 42,
        "created_at": "2026-02-11T07:03:00Z"
      }
    ]
  }
}
```

**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.list"}'
```

**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.list", params: {},
  }),
});
const { result, error } = await res.json();
```

**Go**

```go
body := []byte(`{"jsonrpc":"2.0","id":1,"method":"album.list"}`)
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)
```

