Dataview id from API request does not correlate with actual dataview id

I have been trying to use the Kibana API in order to get a list of all the dataviews and use their ID for link generation purposes.

Following this doc [get all dataviews]: https://www.elastic.co/guide/en/kibana/current/data-views-api.html
Action: GET /api/data_views

I succesfully recieve all the dataviews and their ids but there is a weird behaviour I noticed.

The id presented in the dataview json does not correlate with the actual dataview id presented in the Discover and Managment>Dataviews.

Therefore the link to the discover (I have been trying to generate) does not work and I recieve an error saying the dataview id does not exist.

I will truly appreciate any clarification regarding the ids, api behaviour or the correct solution.

Hi @elasticexpert2,

Your expectations are correct and ids should match. Can you please share screenshots or json with data you get on DevTools and Management pages? And examples of Discover URLs you are constructing. Thanks in advance!

Please also check how data views are distributed between spaces as it affects whether they can be opened in Discover and what URL to construct.

Hi @jughosta,
Thanks for your response.

Checking the dataviews in spaces, searching the id in an admin space does return the correct result.
So it is a space issue.
Do you have any idea of how could I receive the dataviews from a single space only? as dataviews with the same name in difference spaces override each other.