# List saved views

Source: https://docs.maylee.app/api-reference/views/list-views

`GET https://api.maylee.app/api/v1/views`

Scope: `read`.

Apply one with `?viewId=` on `GET /emails`. `filters` is the view definition, in the same DSL as `?filters=`.

## Example request

```bash
curl -X GET "https://api.maylee.app/api/v1/views" \
  -H "Authorization: Bearer $MAYLEE_KEY"
```

## Responses

### 200

Saved views.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `items` | array of View | yes |  |
| `items[].createdAt` | string (date-time) | yes |  |
| `items[].filters` | object or object or object | yes | Filter tree in the public DSL, or `{}` for no filter. |
| `items[].icon` | string or null | yes |  |
| `items[].id` | string | yes |  |
| `items[].mailboxIds` | array of string | yes | Mailboxes the view is restricted to. Empty means all. |
| `items[].name` | string | yes |  |

```json
{
  "items": [
    {
      "createdAt": "2026-07-01T10:00:00.000Z",
      "filters": {
        "_and": [
          {
            "id": "c1",
            "label": "ai_label",
            "type": "contains",
            "value": "cmtgai1b2c3d4e5f6g7h8i9j"
          },
          {
            "id": "c2",
            "label": "read_status",
            "type": "is_false",
            "value": ""
          }
        ],
        "id": "g1"
      },
      "icon": "🎯",
      "id": "cmvw1a2b3c4d5e6f7g8h9i0j",
      "mailboxIds": [],
      "name": "Leads to answer"
    }
  ]
}
```

### 401

Missing, malformed, revoked or expired API key.

### 403

Key lacks the required scope, or outbound sending is not enabled on it.

### 429

Per-minute rate limit (`RATE_LIMIT_EXCEEDED`) or monthly quota (`QUOTA_EXCEEDED`) exhausted.

Errors use the format `{ "code", "error", "details" }`: see [Errors](/errors.md).
