# Kibana Data View update API request doesn't work

**URL:** https://discuss.elastic.co/t/kibana-data-view-update-api-request-doesnt-work/327435
**Category:** Kibana
**Tags:** data-views, visualisation
**Created:** [March 10, 2023, 10:17am UTC](https://discuss.elastic.co/t/kibana-data-view-update-api-request-doesnt-work/327435 "2023-03-10T10:17:30Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![nilaksha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nilaksha/32/118299_2.png) [@nilaksha](https://discuss.elastic.co/u/nilaksha)
#### Post date: [March 10, 2023, 10:17am UTC](https://discuss.elastic.co/t/kibana-data-view-update-api-request-doesnt-work/327435/1 "2023-03-10T10:17:30Z")

</div>

I'm using latest version of 8.6.2 kibana and i need to change the index pattern in kibana Data View to visualize data dynamically. so i have to do it using kibana rest API and found Data View Update API Documentation. but when I run update request on dev tools for existing Data view id, it shows not found error.  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/2/c2c8346a6204a1f4bb0270f07da5d846310502f2.png)

here the request sent from dev tools

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/4/d4c5d769b1ee71b0fbc7ff19a4ddfc09160619ad.png)

```auto
POST kbn:/api/data_views/data-view/bce27b39-28b9-4f9e-ab15-e92e38140949
{
  "data_view": {
   "title": "insight_*"
  }
}

```

is there is any way to fix this issue.

---

<div class="post-metadata">

### Author: ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)
#### Post date: [March 10, 2023, 4:46pm UTC](https://discuss.elastic.co/t/kibana-data-view-update-api-request-doesnt-work/327435/2 "2023-03-10T16:46:34Z")

</div>

Hi Nilaksha. You have an extra `/` between `kbn:` and `api` in the POST URL. Try

```auto
POST kbn:api/data_views/data-view/bce27b39-28b9-4f9e-ab15-e92e38140949
{
  "data_view": {
   "title": "insight_*"
  }
}

```

---

<div class="post-metadata">

### Author: ![nilaksha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nilaksha/32/118299_2.png) [@nilaksha](https://discuss.elastic.co/u/nilaksha)
#### Post date: [March 11, 2023, 2:26pm UTC](https://discuss.elastic.co/t/kibana-data-view-update-api-request-doesnt-work/327435/3 "2023-03-11T14:26:15Z")

</div>

I tried it. but still getting 404 not found

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [March 11, 2023, 3:49pm UTC](https://discuss.elastic.co/t/kibana-data-view-update-api-request-doesnt-work/327435/4 "2023-03-11T15:49:20Z")

</div>

Hi @nilaksha Welcome to the Community!

I just ran this in 8.6.2.

```auto
POST kbn:api/data_views/data_view
{
  "data_view": {
     "title": "logstash-*",
     "name": "My Logstash Data View"
  }
}

#results
{
  "data_view": {
    "id": "67b6bac1-e601-48da-9e02-2e5e9fa37eb5",
    "version": "WzU0MCwyXQ==",
    "title": "logstash-*",
    "sourceFilters": [],
    "fields": {},
    "typeMeta": {},
    "fieldFormats": {},
    "runtimeFieldMap": {},
    "fieldAttrs": {},
    "allowNoIndex": false,
    "name": "My Logstash Data View"
  }
}

```

Then ran the update

```auto
POST kbn:/api/data_views/data_view/67b6bac1-e601-48da-9e02-2e5e9fa37eb5
{
  "data_view": {
     "title": "logstash-*",
     "name": "My Logstash Updated Data View"
  }
}

# Results

{
  "data_view": {
    "id": "67b6bac1-e601-48da-9e02-2e5e9fa37eb5",
    "version": "WzU2MCwyXQ==",
    "title": "logstash-*",
    "sourceFilters": [],
    "fields": {},
    "typeMeta": {},
    "fieldFormats": {},
    "runtimeFieldMap": {},
    "fieldAttrs": {},
    "allowNoIndex": false,
    "name": "My Logstash Updated Data View"
  }
}

```

Please show us the same commands in text with the same sequence.... perhaps you have a cut and paste issue with the ID.

---

<div class="post-metadata">

### Author: ![nilaksha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nilaksha/32/118299_2.png) [@nilaksha](https://discuss.elastic.co/u/nilaksha)
#### Post date: [March 11, 2023, 4:14pm UTC](https://discuss.elastic.co/t/kibana-data-view-update-api-request-doesnt-work/327435/5 "2023-03-11T16:14:25Z")

</div>

Thank you! this one is worked and I checked the difference of the text in the command. It is a syntax issue with my command.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/2/42d2fa025769a2632bf29357dbdfb4d550ca7f17.png)  
but i copied it from kibana documentation.  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/e/3ecdfa81ea57c4934b4e878310c46c172c1f6341.png)

Thanks for the help.

---

<div class="post-metadata">

### Author: ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)
#### Post date: [March 20, 2023, 3:19pm UTC](https://discuss.elastic.co/t/kibana-data-view-update-api-request-doesnt-work/327435/6 "2023-03-20T15:19:43Z")

</div>

Thanks for reporting this. I've added a PR to update the docs. [[Docs] Fix curl examples in update data view api docs by nickpeihl · Pull Request #153292 · elastic/kibana · GitHub](https://github.com/elastic/kibana/pull/153292)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [April 17, 2023, 3:20pm UTC](https://discuss.elastic.co/t/kibana-data-view-update-api-request-doesnt-work/327435/7 "2023-04-17T15:20:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
