# How to create an index-pattern for a specific Space using the API?

**URL:** <https://discuss.elastic.co/t/how-to-create-an-index-pattern-for-a-specific-space-using-the-api/166341>\
**Category:** Kibana\
**Created:** [January 30, 2019, 11:26am UTC](https://discuss.elastic.co/t/how-to-create-an-index-pattern-for-a-specific-space-using-the-api/166341 "2019-01-30T11:26:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomeri](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@tomeri](https://discuss.elastic.co/u/tomeri)\
**Post date:** [January 30, 2019, 11:26am UTC](https://discuss.elastic.co/t/how-to-create-an-index-pattern-for-a-specific-space-using-the-api/166341/1 "2019-01-30T11:26:19Z")

</div>

Hi,

Is it possible to use the [Saved Objects API](https://www.elastic.co/guide/en/kibana/6.6/saved-objects-api.html) to create a new index-pattern for a specific Space?

It's not explained in the above documentation and i couldn't make it work after trying various syntax.

Kibana version 6.5.4

Thanks,

---

<div class="post-metadata">

**Author:** ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)\
**Post date:** [January 30, 2019, 7:38pm UTC](https://discuss.elastic.co/t/how-to-create-an-index-pattern-for-a-specific-space-using-the-api/166341/2 "2019-01-30T19:38:37Z")

</div>

hi @tomeri

You can prepend the Space name in the URL

so instead of `http://localhost:5601/api/saved_objects` it would be `http://localhost:5601/s/foo/api/saved_objects`

---

<div class="post-metadata">

**Author:** ![tomeri](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@tomeri](https://discuss.elastic.co/u/tomeri)\
**Post date:** [January 31, 2019, 3:40pm UTC](https://discuss.elastic.co/t/how-to-create-an-index-pattern-for-a-specific-space-using-the-api/166341/4 "2019-01-31T15:40:12Z")

</div>

Works thanks!

---

<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:** [February 28, 2019, 3:40pm UTC](https://discuss.elastic.co/t/how-to-create-an-index-pattern-for-a-specific-space-using-the-api/166341/5 "2019-02-28T15:40:16Z")

</div>

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