> For the complete documentation index, see [llms.txt](https://docs.logsnag.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.logsnag.com/api-reference/insight.md).

# Insight

Insights are real-time widgets that you can add to each of your projects. They are use-case agnostic and can be used to display any information that you want in real-time.

![](/files/ywlfKBklAbMaIhbJHGnF)

## Publish an insight to LogSnag.

<mark style="color:green;">`POST`</mark> `https://api.logsnag.com/v1/insight`

Insights are real-time events such as KPI, performance, and other metrics that are not captured as a regular event. You can publish them periodically or as soon as they occur and the latest value will be stored in LogSnag.

#### Headers

| Name          | Type   | Description      |
| ------------- | ------ | ---------------- |
| Content-Type  | String | application/json |
| Authorization | String | Bearer \<TOKEN>  |

#### Request Body

| Name                                      | Type           | Description                      |
| ----------------------------------------- | -------------- | -------------------------------- |
| project<mark style="color:red;">\*</mark> | String         | Project name                     |
| title<mark style="color:red;">\*</mark>   | String         | Insight title                    |
| value<mark style="color:red;">\*</mark>   | String, Number | Insight value                    |
| icon                                      | Emoji          | Single emoji as the insight icon |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Important:** Fields ending with an `*` are required in your request!
{% endhint %}

For each insight, the title should remain the same across all updates. However, you may change the value or the icon depending on the status of the insight. For example, if you decide to display the status of a service, you can change the icon to 🟢 if the service is up and 🔴 if it is down.


---

# 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.logsnag.com/api-reference/insight.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.
