# Insight Mutate

## Mutate an insight to LogSnag.

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

This endpoint allows you to change (mutate) existing numerical insights.

#### 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>   | Mutation | See example below                |
| icon                                      | Emoji    | Single emoji as the insight icon |

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

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

{% endtab %}
{% endtabs %}

### Mutation Object

#### Increment ($inc)

The increment mutation changes a numerical value by increasing or decreasing it. It can be applied to an existing insight or 0 if no insight exists. The mutation can be performed using either positive or negative numbers.

```json
{
    "project": "makershq",
    "title": "Online Users",
    "value": {
        "$inc": 1
    },
    "icon": "🔴"
}
```

&#x20;


---

# 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-mutate.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.
