# How to use the bulk api from kibana

**URL:** <https://discuss.elastic.co/t/how-to-use-the-bulk-api-from-kibana/374081>\
**Category:** Elasticsearch\
**Created:** [February 4, 2025, 8:13pm UTC](https://discuss.elastic.co/t/how-to-use-the-bulk-api-from-kibana/374081 "2025-02-04T20:13:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlos\_Fernando\_Palm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_fernando_palm/32/77804_2.png) [@Carlos\_Fernando\_Palm](https://discuss.elastic.co/u/Carlos_Fernando_Palm)\
**Post date:** [February 4, 2025, 8:13pm UTC](https://discuss.elastic.co/t/how-to-use-the-bulk-api-from-kibana/374081/1 "2025-02-04T20:13:11Z")

</div>

I am trying to upload data using the bulk api from kibana.

I was following this

> **[Using the Elasticsearch Bulk API for High-Performance Indexing - GeeksforGeeks](https://www.geeksforgeeks.org/using-the-elasticsearch-bulk-api-for-high-performance-indexing/)**
>
> A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.

I have tried a syntax like this:

```auto
POST /my-index/_bulk
{
  { "index": { "_index": "myindex", "_id": "1" } }
  { "name": "John Doe", "age": 30, "city": "New York" }
}

```

But then I get this:

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "x_content_e_o_f_exception",
        "reason": """com.fasterxml.jackson.core.io.JsonEOFException: Unexpected end-of-input: expected close marker for Object (start marker at [Source: (byte[])"{"; line: 1, column: 1])
 at [Source: (byte[])"{"; line: 1, column: 2]"""
      }
    ],
    "type": "x_content_e_o_f_exception",
    "reason": """com.fasterxml.jackson.core.io.JsonEOFException: Unexpected end-of-input: expected close marker for Object (start marker at [Source: (byte[])"{"; line: 1, column: 1])
 at [Source: (byte[])"{"; line: 1, column: 2]""",
    "caused_by": {
      "type": "json_e_o_f_exception",
      "reason": """Unexpected end-of-input: expected close marker for Object (start marker at [Source: (byte[])"{"; line: 1, column: 1])
 at [Source: (byte[])"{"; line: 1, column: 2]"""
    }
  },
  "status": 500
}

```

Then I tried something like this so that the json is valid:

```auto
POST /my-index/_bulk
{
    "index": {
        "_index": "my-index",
        "_id": "1"
    },
    "source": {
        "sourceId": "1"
    }
}

```

but I get the following error:

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "x_content_e_o_f_exception",
        "reason": """com.fasterxml.jackson.core.io.JsonEOFException: Unexpected end-of-input: expected close marker for Object (start marker at [Source: (byte[])"{"; line: 1, column: 1])
 at [Source: (byte[])"{"; line: 1, column: 2]"""
      }
    ],
    "type": "x_content_e_o_f_exception",
    "reason": """com.fasterxml.jackson.core.io.JsonEOFException: Unexpected end-of-input: expected close marker for Object (start marker at [Source: (byte[])"{"; line: 1, column: 1])
 at [Source: (byte[])"{"; line: 1, column: 2]""",
    "caused_by": {
      "type": "json_e_o_f_exception",
      "reason": """Unexpected end-of-input: expected close marker for Object (start marker at [Source: (byte[])"{"; line: 1, column: 1])
 at [Source: (byte[])"{"; line: 1, column: 2]"""
    }
  },
  "status": 500
}

```

Is there an example of using the bulk api via kibana?

---

<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:** [February 4, 2025, 8:20pm UTC](https://discuss.elastic.co/t/how-to-use-the-bulk-api-from-kibana/374081/2 "2025-02-04T20:20:28Z")

</div>

Hi @Carlos_Fernando_Palm

So close... 🙂 see [the docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html)

```auto
POST /news_v11/_bulk
{ "index": { "_index": "myindex", "_id": "1" } }
{ "name": "John Doe", "age": 30, "city": "New York" }

```
