# App Search error create engine

**URL:** <https://discuss.elastic.co/t/app-search-error-create-engine/326827>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [March 2, 2023, 7:58am UTC](https://discuss.elastic.co/t/app-search-error-create-engine/326827 "2023-03-02T07:58:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GHostlyFOX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghostlyfox/32/77310_2.png) [@GHostlyFOX](https://discuss.elastic.co/u/GHostlyFOX)\
**Post date:** [March 2, 2023, 7:58am UTC](https://discuss.elastic.co/t/app-search-error-create-engine/326827/1 "2023-03-02T07:58:11Z")

</div>

The documentation describes the process of creating a new Engine through the API but with the default type.

How to create a Engine with elasticsearch type?

I look at debugging requests that come from Kibana, repeat the same request from the API - I get a 400 bad request response.

```auto
POST "/api/as/v0/engines"
{"name"=>"ix-name", "search_index"=>{"type"=>"elasticsearch", "index_name"=>"ix_name", "alias_name"=>"search-ix-name-alias"}}

```

```auto
POST "/api/as/v1/engines"
{"name"=>"ix-name", "search_index"=>{"type"=>"elasticsearch", "index_name"=>"ix_name", "alias_name"=>"search-ix-name-alias"}}

```

---

<div class="post-metadata">

**Author:** ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)\
**Post date:** [March 2, 2023, 8:17am UTC](https://discuss.elastic.co/t/app-search-error-create-engine/326827/2 "2023-03-02T08:17:22Z")

</div>

Hi @GHostlyFOX , welcome back!

The following should work:

`POST "/api/as/v0/engines"`

```auto
{
    "name": "engine-name",
    "type": "elasticsearch",
    "index_name": "search-existing-es-index-name"
}

```

Where "index\_name" must be an existing Search Index name. It must start with `search-` to make sure Enterprise Search is able to manage it.

Please keep in mind that this API is in Beta, and is subject to change in the future.

---

<div class="post-metadata">

**Author:** ![GHostlyFOX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ghostlyfox/32/77310_2.png) [@GHostlyFOX](https://discuss.elastic.co/u/GHostlyFOX)\
**Post date:** [March 2, 2023, 8:51am UTC](https://discuss.elastic.co/t/app-search-error-create-engine/326827/3 "2023-03-02T08:51:21Z")

</div>

I solved the problem.  
The error was due to the restriction of user roles.  
The user created inside the module does not have rights to add such a Engine.  
And API keys too.

Only assigning roles enterprise-search-workplace-search-admin and enterprise-search-app-search-owner made it possible to add Engine type = elasticsearch.

At the same time, the procedure for adding this type of sources is not described anywhere in the documentation.

---

<div class="post-metadata">

**Author:** ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)\
**Post date:** [March 2, 2023, 9:13am UTC](https://discuss.elastic.co/t/app-search-error-create-engine/326827/4 "2023-03-02T09:13:24Z")

</div>

I'm glad you solved the problem, @GHostlyFOX !

This is not documented yet, as this is a beta feature that is undergoing changes at this very moment. We have lots of plans for Elasticsearch based Engines. Stay tuned!

---

<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:** [March 30, 2023, 9:14am UTC](https://discuss.elastic.co/t/app-search-error-create-engine/326827/5 "2023-03-30T09:14:01Z")

</div>

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