> For the complete documentation index, see [llms.txt](https://docs.apica.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apica.io/observe/prometheus/use-apica-api-to-ingest-json-data.md).

# Use Apica API to ingest JSON data

**Pre-Requisites**

* Ingest Token ([Generating a secure ingest token](https://docs.apica.io/integrations/overview/generating-a-secure-ingest-token))
* Domain name (mydomain.apica.io)

**Request**&#x20;

Endpoint

```
POST https://mydomain.apica.io/v1/json_batch
```

Header

```
Authorization: Bearer ${IngestToken}
```

**Request Body**

Json Example 1

```
[
    {
        "namespace":"my-test",
        "application":"my-awesome-app",
        "message":"This is a test message"
    }
]
```

Json Example 2

```
[
    {
        "namespace":"joakim-test",
        "application":"joakims-awesome-app",
        "message":{
            "host":"localhost",
            "ip":"127.0.0.1",
            "port":"443",
            "message":"This is a test message"
        }
    }
]
```

Json Example 3

```
[
    {
        "namespace":"my-test",
        "application":"my-awesome-app",
        "message":"This is a test message"
    },
    {
        "namespace":"my-test",
        "application":"my-awesome-app",
        "message":"This is a test message 2"
    },
    {
        "namespace":"my-test",
        "application":"my-awesome-app",
        "message":"This is a test message 3"
    }
]
```

{% hint style="info" %}
*Namespace & Application is generated automatically based on your request. If either doesn't exist, new ones will be generated.*
{% endhint %}

**Result (User-Interface)**

Using Json Example 1, this is how the results look like in your environment

<figure><img src="/files/9VVFssdpAhTSiQiK7CdV" alt=""><figcaption></figcaption></figure>

**Response**

Example response 1

```
200 OK

status_code: "200"
```

Example response 2

```
400 Bad Request

{
    "message": "cookie x-api-key not found"
}

// Authorization header invalid / misconfigured
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apica.io/observe/prometheus/use-apica-api-to-ingest-json-data.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
