# Data Module

#### Get all app metrics for an entity&#x20;

List all the metrics available for an entity

<mark style="color:blue;">`GET`</mark> `https://api.questprotocol.xyz/api/entities/{entityID}/metrics`

#### Path Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| entityID<mark style="color:red;">\*</mark> | String |             |

#### Query Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| address<mark style="color:red;">\*</mark>   | String |             |
| signature<mark style="color:red;">\*</mark> | String |             |

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

````json
```json
{
    "success": true,
    "data": [
        {
            "id": "testm1",
            "name": "testm1"
        },
        {
            "id": "testm2",
            "name": "testm2"
        },
        {
            "id": "testm3",
            "name": "testm3"
        }
    ]
}
```
````

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Can only be performed by the admin/owner of the Entity.
{% endhint %}

#### Get all app metrics for a user in an entity&#x20;

<mark style="color:blue;">`GET`</mark> `https://api.questprotocol.xyz/api/entities/{entityID}/users/{userAddress}/metrics`

#### Path Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| entityID<mark style="color:red;">\*</mark>    | String |             |
| userAddress<mark style="color:red;">\*</mark> | String |             |

#### Query Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| address<mark style="color:red;">\*</mark>   | String |             |
| signature<mark style="color:red;">\*</mark> | String |             |

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

```json
{
    "success": true,
    "data": [
        {
            "metric": "test",
            "counter": 4
        }
    ]
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Can only be performed by the admin/owner of the Entity.
{% endhint %}

#### Increment a app metric for a user in entity

Increments a app metric for a user in entity, can only be done by Entity Admins/Owners.

<mark style="color:green;">`POST`</mark> `https://api.questprotocol.xyz/api/entities/{entityID}/users/{userAddress}/metrics/{metric}`

#### Path Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| entityID<mark style="color:red;">\*</mark>    | String |             |
| userAddress<mark style="color:red;">\*</mark> | String |             |
| metric<mark style="color:red;">\*</mark>      | String |             |

#### Query Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| address<mark style="color:red;">\*</mark>   | String |             |
| signature<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name                                    | Type   | Description |
| --------------------------------------- | ------ | ----------- |
| count<mark style="color:red;">\*</mark> | String |             |

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

```javascript
{
    success: true
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Can only be performed by the admin/owner of the Entity.
{% endhint %}

#### Increment multiple app metrics for a user in entity

Increment multiple app metrics for a user in entity, can only be done by Entity Admins/Owners.

<mark style="color:green;">`POST`</mark> `https://api.questprotocol.xyz/api/entities/{entityID}/users/{userAddress}/metrics`

#### Path Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| entityID<mark style="color:red;">\*</mark>    | String |             |
| userAddress<mark style="color:red;">\*</mark> | String |             |

#### Query Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| address<mark style="color:red;">\*</mark>   | String |             |
| signature<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name                                      | Type  | Description |
| ----------------------------------------- | ----- | ----------- |
| metrics<mark style="color:red;">\*</mark> | Array |             |
| counts<mark style="color:red;">\*</mark>  | Array |             |

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

```javascript
{
    success: true
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Can be only performed by the admin of the Entity.
{% endhint %}

Updates App metric information for an Entity. Can be only performed by the admin of the Entity.

<mark style="color:green;">`POST`</mark> `https://api.questprotocol.xyz/api/entities/{entityID}/metrics/{metricID}/update`

#### Path Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| entityID<mark style="color:red;">\*</mark> | String |             |
| metricID<mark style="color:red;">\*</mark> | String |             |

#### Query Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| signature<mark style="color:red;">\*</mark> | String |             |
| address                                     | String |             |

#### Request Body

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| name<mark style="color:red;">\*</mark>        | String |             |
| description<mark style="color:red;">\*</mark> | String |             |
| type<mark style="color:red;">\*</mark>        | String |             |

{% hint style="info" %}
Can only be performed by the admin/owner of the Entity.
{% endhint %}


---

# 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.questera.ai/questera-ai-sdks/rest-apis/data-module.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.
