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

# Transactions

Access transactions metrics.

Transactions metrics are always related to an App. This means that all endpoints have the same root so it could be helpful to wrap your api call under the same base URI:

&#x20;`https://app.inspector.dev`**`/api/apps/:id`**

## Transactions List

<mark style="color:green;">`POST`</mark> `/api/apps/:id/transactions`

Get the list of transactions in the given interval.

#### Path Parameters

| Name                                 | Type    | Description      |
| ------------------------------------ | ------- | ---------------- |
| id<mark style="color:red;">\*</mark> | Integer | App's identifier |

#### Headers

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

#### Request Body

| Name                                           | Type   | Description                             |
| ---------------------------------------------- | ------ | --------------------------------------- |
| filter.start<mark style="color:red;">\*</mark> | String | ISO-8601 date format                    |
| filter.end                                     | String | ISO-8601 date format                    |
| filter.hosts                                   | Array  | Filter the transactions list by servers |
| filter.query\_string                           | String | Filter by transaction's name            |

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

```
[
    {
        name: "request",
        transactions: [
            {
                type: "request",
                duration: 42.8,
                group_hash: "4fbb4fa36bad346bbe8a26827a244e70",
                hash: "37d6f2a1bd370759ff46cc63266603b81b60da4774bfa9a72af7bf26ba3d4fb1",
                host: {hostname: "307510.cloudwaysapps.com", ip: "127.0.0.1"},
                memory_peak: 16.98,
                name: "GET /api",
                project_id: 389,
                result: "success",
                timestamp: "2024-10-04 16:52:02",
                doc_count: 60,
                performance: [
                    {label: "2021-02-03 16:00", value: 38, doc_count: 61},
                    {label: "2021-02-03 17:00", value: 5, doc_count: 63},
                    {label: "2021-02-03 18:00", value: 65, doc_count: 123},
                    {label: "2021-02-03 19:00", value: 34, doc_count: 11},
                    {label: "2021-02-03 20:00", value: 43, doc_count: 110},
                    {label: "2021-02-03 21:00", value: 2, doc_count: 123},
                    ...
                ]
            },
            
            {...},
        ],
    },
    
    {
        name: "command",
        transactions: [...],
    },
    
    {...}
]
```

{% endtab %}
{% endtabs %}

## Transaction occurrences

<mark style="color:green;">`POST`</mark> `/api/apps/:id/transactions/:group_hash/occurrences`

Get the last occurrences of a specific transaction.

#### Path Parameters

| Name                                          | Type    | Description                        |
| --------------------------------------------- | ------- | ---------------------------------- |
| id<mark style="color:red;">\*</mark>          | Integer | Project's Identifier               |
| group\_hash<mark style="color:red;">\*</mark> | String  | The transaction group's identifier |

#### Query Parameters

| Name                                           | Type    | Description                                                                                              |
| ---------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------- |
| filter.start<mark style="color:red;">\*</mark> | Date    | ISO-8601 date format                                                                                     |
| filter.end                                     | Date    | ISO-8601 date format                                                                                     |
| filter.from                                    | Integer | The results are paginated 25 elements at a time. Use **from** to advance the starting point of the list. |

#### Headers

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

{% tabs %}
{% tab title="200: OK An array of items." %}

```javascript
[
    {
        duration: 164.22,
        group_hash: "7d8647ff14a84a458b0f6xxxxxxxxxxxx",
        memory_peak: 19.09,
        name: "GET /api/users",
        result: "success",
        timestamp: "2022-04-19 14:10:04",
        type: "process"
    },
    {
        ...
    },
]
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
You can get the **group\_hash** value of a specific transaction in the address bar of your browser navigating the detail page of the transaction of your interest.
{% endhint %}

![](https://2873457055-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ51SrLj6qvIRejC1XD%2Fuploads%2FozUqYxyA3Zj7sGcrfNPT%2Fgroup_hash-url-parameter.png?alt=media\&token=74e02fa2-797a-41f5-8d3f-4d4be0a16598)


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.inspector.dev/rest-api/transactions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
