> ## Documentation Index
> Fetch the complete documentation index at: https://docs.molesignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 创建保存的视图

> 把查询保存为可复用视图。

```http theme={null}
POST /api/v1/saved_views
```

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST http://localhost:5080/api/v1/saved_views \
    -H "authorization: Bearer $MS_JWT" \
    -H 'content-type: application/json' \
    -d '{
      "name": "Recent errors",
      "language": "sql",
      "statement": "SELECT * FROM app WHERE level = '\''error'\''",
      "time_range_secs": 3600,
      "stream": "app",
      "tags": ["operations"],
      "pinned": true
    }'
  ```
</RequestExample>

`time_range_secs` 必须在 1 到 31,622,400 之间。创建视图需要 `saved_views.create`。
