# Get views

URL: https://docs.hanzo.ai/docs/openapi/o11y/get-o11y-explorer-views-by-viewid

> Returns one saved explorer view by id.

`GET /v1/o11y/explorer/views/{viewId}`

> [O11y →](https://docs.hanzo.ai/docs/openapi/o11y) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                        |
| ------------- | ------------------------------------------------------ |
| **Address**   | `https://api.hanzo.ai/v1/o11y/explorer/views/{viewId}` |
| **Method**    | `GET`                                                  |
| **Operation** | `get_o11y_explorer_views_by_viewid`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`                 |

Returns one saved explorer view by id.

Callers need the viewer role; the runtime's own gate enforces it.

## Request

1 field.

| Field    | In   | Type   | Required | Description              |
| -------- | ---- | ------ | -------- | ------------------------ |
| `viewId` | path | string | yes      | ViewID is the view's id. |

## Response

| Status    | Body                  | Meaning           |
| --------- | --------------------- | ----------------- |
| `200`     | o11y.O11ySavedViewOut | ok                |
| `202`     | Approval              | held for approval |
| `default` | problem-details       | refused           |

`200` body — 92 fields.

| Field                                                               | In   | Type                   | Always | Description                                                                                               |
| ------------------------------------------------------------------- | ---- | ---------------------- | ------ | --------------------------------------------------------------------------------------------------------- |
| `data`                                                              | body | o11y.SavedView         | —      |                                                                                                           |
| `data.category`                                                     | body | string                 | —      |                                                                                                           |
| `data.compositeQuery`                                               | body | o11y.v3.CompositeQuery | —      |                                                                                                           |
| `data.compositeQuery.builderQueries`                                | body | object                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*`                              | body | o11y.BuilderQuery      | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.IsAnomaly`                    | body | boolean                | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.QueriesUsedInFormula`         | body | string\[]              | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.ShiftBy`                      | body | integer (int64)        | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.aggregateAttribute`           | body | o11y.AttributeKey      | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.aggregateAttribute.dataType`  | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.aggregateAttribute.isColumn`  | body | boolean                | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.aggregateAttribute.isJSON`    | body | boolean                | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.aggregateAttribute.key`       | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.aggregateAttribute.type`      | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.aggregateOperator`            | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.dataSource`                   | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.disabled`                     | body | boolean                | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.expression`                   | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.filters`                      | body | o11y.FilterSet         | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.filters.items`                | body | o11y.FilterItem\[]     | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.filters.items[].key`          | body | o11y.AttributeKey      | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.filters.items[].key.dataType` | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.filters.items[].key.isColumn` | body | boolean                | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.filters.items[].key.isJSON`   | body | boolean                | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.filters.items[].key.key`      | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.filters.items[].key.type`     | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.filters.items[].op`           | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.filters.items[].value`        | body | any                    | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.filters.op`                   | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.functions`                    | body | o11y.Function\[]       | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.functions[].args`             | body | any\[]                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.functions[].name`             | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.functions[].namedArgs`        | body | object                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.functions[].namedArgs.*`      | body | any                    | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.groupBy`                      | body | o11y.AttributeKey\[]   | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.groupBy[].dataType`           | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.groupBy[].isColumn`           | body | boolean                | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.groupBy[].isJSON`             | body | boolean                | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.groupBy[].key`                | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.groupBy[].type`               | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.having`                       | body | o11y.Having\[]         | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.having[].columnName`          | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.having[].op`                  | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.having[].value`               | body | any                    | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.legend`                       | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.limit`                        | body | integer (uint64)       | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.offset`                       | body | integer (uint64)       | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.orderBy`                      | body | o11y.OrderBy\[]        | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.orderBy[].columnName`         | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.orderBy[].order`              | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.pageSize`                     | body | integer (uint64)       | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.queryName`                    | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.reduceTo`                     | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.selectColumns`                | body | o11y.AttributeKey\[]   | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.selectColumns[].dataType`     | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.selectColumns[].isColumn`     | body | boolean                | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.selectColumns[].isJSON`       | body | boolean                | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.selectColumns[].key`          | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.selectColumns[].type`         | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.seriesAggregation`            | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.spaceAggregation`             | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.stepInterval`                 | body | integer (int64)        | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.temporality`                  | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.builderQueries.*.timeAggregation`              | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.chQueries`                                     | body | object                 | —      |                                                                                                           |
| `data.compositeQuery.chQueries.*`                                   | body | o11y.DatastoreQuery    | —      |                                                                                                           |
| `data.compositeQuery.chQueries.*.disabled`                          | body | boolean                | —      |                                                                                                           |
| `data.compositeQuery.chQueries.*.legend`                            | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.chQueries.*.query`                             | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.fillGaps`                                      | body | boolean                | —      | FillGaps is used to fill the gaps in the time series data                                                 |
| `data.compositeQuery.panelType`                                     | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.promQueries`                                   | body | object                 | —      |                                                                                                           |
| `data.compositeQuery.promQueries.*`                                 | body | o11y.PromQuery         | —      |                                                                                                           |
| `data.compositeQuery.promQueries.*.disabled`                        | body | boolean                | —      |                                                                                                           |
| `data.compositeQuery.promQueries.*.legend`                          | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.promQueries.*.query`                           | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.promQueries.*.stats`                           | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.queries`                                       | body | o11y.QueryEnvelope\[]  | —      |                                                                                                           |
| `data.compositeQuery.queries[].spec`                                | body | any                    | —      | Spec is the deferred decoding of the query if any.                                                        |
| `data.compositeQuery.queries[].type`                                | body | any                    | —      | Type is the type of the query.                                                                            |
| `data.compositeQuery.queryType`                                     | body | string                 | —      |                                                                                                           |
| `data.compositeQuery.unit`                                          | body | string                 | —      | Unit for the time series data shown in the graph This is used in alerts to format the value and threshold |
| `data.createdAt`                                                    | body | string (date-time)     | —      |                                                                                                           |
| `data.createdBy`                                                    | body | string                 | —      |                                                                                                           |
| `data.extraData`                                                    | body | string                 | —      | ExtraData is JSON encoded data used by frontend to store additional data                                  |
| `data.id`                                                           | body | any                    | —      |                                                                                                           |
| `data.name`                                                         | body | string                 | —      |                                                                                                           |
| `data.sourcePage`                                                   | body | string                 | —      |                                                                                                           |
| `data.tags`                                                         | body | string\[]              | —      |                                                                                                           |
| `data.updatedAt`                                                    | body | string (date-time)     | —      |                                                                                                           |
| `data.updatedBy`                                                    | body | string                 | —      |                                                                                                           |
| `status`                                                            | body | string                 | —      | Status is "success".                                                                                      |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo o11y explorer views get <viewId>
```

**SDK**

**.ts**

```ts
import { Configuration, O11yApi } from 'hanzoai';

const api = new O11yApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getO11yExplorerViewsByViewid({ viewId: 'viewId' });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import O11yApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = O11yApi(client).get_o11y_explorer_views_by_viewid(view_id='viewId')
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.O11yAPI.GetO11yExplorerViewsByViewid(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, o11y_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = o11y_api::get_o11y_explorer_views_by_viewid(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.O11yApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new O11yApi(client).getO11yExplorerViewsByViewid();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/o11y/explorer/views/<viewId> \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **o11y** through the `o11y` tool, which names its 307 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_o11y_autocomplete_aggregate_attributes"
         }
       }
     }'
```

---

[O11y API](https://docs.hanzo.ai/docs/openapi/o11y) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
