# 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: 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:

```
GET https://docs.logsnag.com/api-reference/insight.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
