# Creating Elasticsearch Indexes from JSON with Elastic.Clients.Elasticsearch in .NET

**URL:** https://discuss.elastic.co/t/creating-elasticsearch-indexes-from-json-with-elastic-clients-elasticsearch-in-net/357580
**Category:** Elasticsearch
**Tags:** language-clients
**Created:** [April 17, 2024, 8:25am UTC](https://discuss.elastic.co/t/creating-elasticsearch-indexes-from-json-with-elastic-clients-elasticsearch-in-net/357580 "2024-04-17T08:25:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jacques\_du\_Plessis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jacques_du_plessis/32/35413_2.png) [@Jacques\_du\_Plessis](https://discuss.elastic.co/u/Jacques_du_Plessis)
#### Post date: [April 17, 2024, 8:25am UTC](https://discuss.elastic.co/t/creating-elasticsearch-indexes-from-json-with-elastic-clients-elasticsearch-in-net/357580/1 "2024-04-17T08:25:48Z")

</div>

I'm currently updating my NEST client, which is deprecated, to the latest Elasticsearch client, Elastic.Clients.Elasticsearch. Previously, with NEST, I utilized the low-level client to create indexes from a JSON file containing mappings and settings, like so  
var response = await this.client.LowLevel.Indices.CreateAsync(formattedIndexName, bytes, ctx: cancellationToken);

However, this functionality is not available in the latest client. What would be the recommended approach for achieving a similar outcome with the latest client?

---

<div class="post-metadata">

### Author: ![flobernd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flobernd/32/124877_2.png) [@flobernd](https://discuss.elastic.co/u/flobernd)
#### Post date: [April 17, 2024, 8:38am UTC](https://discuss.elastic.co/t/creating-elasticsearch-indexes-from-json-with-elastic-clients-elasticsearch-in-net/357580/2 "2024-04-17T08:38:56Z")

</div>

Hi @Jacques_du_Plessis,

please have a look at the very last paragraph in the migration guide:

> **[Migration guide: From NEST v7 to .NET Client v8 | Elasticsearch .NET Client...](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/migration-guide.html#_workarounds_for_missing_features)**

It shows an example of how to use the low level transport. It's a little bit more work than what you've been doing before - but not that much. Besides the json payload, you must set the correct HTTP method and path for the endpoint and configure query parameters (these ones you probably don't need for your use-case).

The endpoint is documented here:

> **[Create index API | Elasticsearch Guide \[8.13\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html)**

For your case, the method and path is `PUT /my-index-000001` where `my-index-000001` is the name of the index you want to create.

---

<div class="post-metadata">

### Author: ![Jacques\_du\_Plessis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jacques_du_plessis/32/35413_2.png) [@Jacques\_du\_Plessis](https://discuss.elastic.co/u/Jacques_du_Plessis)
#### Post date: [April 18, 2024, 8:16pm UTC](https://discuss.elastic.co/t/creating-elasticsearch-indexes-from-json-with-elastic-clients-elasticsearch-in-net/357580/3 "2024-04-18T20:16:50Z")

</div>

Hi thanks for the quick reply.

I dud read the migration document but think I missed that last section.

I will give it a go.
