---
type: api
title: Get a data view
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/v9/operation/operation-get-data-views-v2-id
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/v9/operation/operation-get-data-views-v2-id
products:
  - Kibana
---

# Get a data view

Authentication: required

Availability: Planned

- Server: `https://{kibana_url}`

## Paths

- `GET` `/api/data_views/v2/{id}`
- `GET` `/s/{space_id}/api/data_views/v2/{id}`

#### Path parameters

- `space_id` (string) — optional
  An identifier for the space. If `space_id` is not provided in the URL, the default space is used. Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
- `id` (string · min length: 1 · max length: 1000) — required
  The ID of the data view to return.

## Description

Returns a data view by ID, including its field settings and runtime fields.

## Responses

#### `200`

OK

`application/json`

- `data` (object)
  Defines an stored data source with a mandatory index pattern and optional settings like id, name, show hidden indices and field settings.
  - `allow_hidden_indices` (boolean)
    When `true`, allows the data view to match hidden indices.
  - `field_filters` (string[] · max items: 10000)
    Field filters can be used to exclude one or more fields when fetching a document. They may contain wildcards, such as `user*` which filters fields starting with 'user'.
  - `field_settings` (map string to anyOf)
    Settings for individual fields, keyed by field name. To change how Kibana displays a field from the backing indices, set its label, description, format, or popularity. To define a runtime field, use the runtime field name and set `type`.
  - `id` (string · min length: 1 · max length: 256)
    Kibana provides a unique identifier for each data view, or you can create your own.
  - `index_pattern` (string · min length: 1)
    The index pattern (Elasticsearch index expression) to use as the data source. Example: "my-index-*".
  - `name` (string · min length: 1 · max length: 256)
    The name of the data view. Example: "Sample data view".
  - `time_field` (string)
    The name of the time field in the index. Used for time-based filtering. Example: "@timestamp".
- `id` (string · max length: 1000)
  The ID of the data view.
- `meta` (object)
  Metadata about the data view.
  - `created_at` (string)
    Timestamp when the object was created (ISO 8601).
  - `created_by` (string)
    User profile ID of the user who created the object.
  - `managed` (boolean)
    When `true`, the object is managed by Kibana and cannot be edited by users.
  - `owner` (string)
    Identifier of the plugin or team that owns this object.
  - `spaces` (string[] · max items: 100)
    The IDs of the spaces where the data view is available.
  - `updated_at` (string)
    Timestamp when the object was last updated (ISO 8601).
  - `updated_by` (string)
    User profile ID of the user who last updated the object.
  - `version` (string)
    Internal version identifier for optimistic concurrency control.
#### `404`

not found

## Code examples

#### Console

```console
GET kbn:/api/data_views/v2/ID
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/data_views/v2/${ID}" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## Response examples

#### Data view response

`application/json`

```json
{
  "data": {
    "index_pattern": "logs-*",
    "name": "Web logs",
    "time_field": "@timestamp"
  },
  "id": "c0ffee00-d57a-11ef-9a52-4f3c2a8d0e1b",
  "meta": {
    "managed": false,
    "spaces": [
      "default"
    ],
    "version": "WzEsMV0="
  }
}
```

