> For the complete documentation index, see [llms.txt](https://docs.ironblocks.com/platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ironblocks.com/platform/threat-detection/api-and-web-hook/inspections.md). Agents can also search and read this documentation through its [MCP server](https://docs.ironblocks.com/platform/~gitbook/mcp).

# Inspections

## Get all protocol inspections.

<mark style="color:blue;">`GET`</mark> `https://api.ironblocks.com/{protocolName}/{chainId}?/{contractAddress}?/inspections`

#### Path Parameters

| Name                                           | Type    | Description                 |
| ---------------------------------------------- | ------- | --------------------------- |
| protocolName<mark style="color:red;">\*</mark> | string  | A protocol name.            |
| chainId                                        | integer | Filter by blockchain id.    |
| contractAddress                                | string  | Filter by contract address. |

#### Query Parameters

| Name       | Type      | Description                                                                                             |
| ---------- | --------- | ------------------------------------------------------------------------------------------------------- |
| id         | \[string] | Filter by ids.                                                                                          |
| hash       | string    | Filter by transaction hash.                                                                             |
| origin     | string    | Filter by transaction origin.                                                                           |
| status     | enum      | <p>Filter by inspection status:</p><p><code>ok</code>,<code>suspecious</code>,<code>critical</code></p> |
| detected   | \[string] | Filter by detected detectors.                                                                           |
| startDate  | date-time | Filter by greater than date.                                                                            |
| endDate    | date-time | Filter by less than date.                                                                               |
| pageNumber | integer   | Specify page number for pagination.                                                                     |
| pageSize   | integer   | Specify page size for pagination.                                                                       |
| sort       | enum      | <p>Sort results in ascending or descending order:</p><p><code>asc</code>,<code>dsc</code></p>           |

{% tabs %}
{% tab title="200: OK Paginated list of inspections." %}

```json
{
  "page": [
    {
      "_id": "63c3d06262ed501baasa",
      "chainId": 122,
      "txHash": "0x11112133123",
      "txTimestamp": "2023-01-15T10:07:30.000Z",
      "txOrigin": "0x1231232111",
      "assets": [
        {
          "address": "0xasdadsaa",
          "descriptor": "Contract1"
        },
        {
          "address": "0xaaaasdad",
          "descriptor": "Contract2"
        }
      ],
      "protocol": "protocol1",
      "invokedMethodName": "someName",
      "assessment": "ok",
      "actions": [],
      "detections": {
        "drasticBalanceChange": {
          "status": "notDetected",
          "message": ""
        },
        "reentrancy": {
          "status": "notDetected",
          "message": ""
        }
      },
      "createdAt": "2023-01-15T10:07:30.459Z",
      "updatedAt": "2023-01-15T10:07:30.459Z"
    }
  ],
  "pageNumber": 1,
  "total": 980
}
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized protocol." %}

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

{% endtab %}

{% tab title="403: Forbidden Bad api-key." %}

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

{% endtab %}

{% tab title="500: Internal Server Error Unexpected error." %}

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

{% endtab %}
{% endtabs %}

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

```bash
curl -X 'GET' \
  'https://api.ironblocks.com/your-protocol-name/inspections?sort=dsc' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer ${YOUR-API-KEY}'
```

{% endtab %}
{% endtabs %}

## Statistics

## Get protocol inspection stats.

<mark style="color:blue;">`GET`</mark> `https://api.ironblocks.com/{protocolName}/{chainId}?/{contractAddress}?/inspections/stats`

#### Path Parameters

| Name                                           | Type    | Description                         |
| ---------------------------------------------- | ------- | ----------------------------------- |
| protocolName<mark style="color:red;">\*</mark> | string  | The name of the inspected protocol. |
| chainId                                        | integer | Filter by blockchain id.            |
| contractAddress                                | integer | Filter by contract address.         |

#### Query Parameters

| Name       | Type      | Description                                                                                             |
| ---------- | --------- | ------------------------------------------------------------------------------------------------------- |
| id         | \[string] | Filter by ids.                                                                                          |
| hash       | string    | Filter by transaction hash.                                                                             |
| origin     | String    | Filter by transaction origin.                                                                           |
| status     | enum      | <p>Filter by inspection status:</p><p><code>ok</code>,<code>suspecious</code>,<code>critical</code></p> |
| detected   | \[string] | Filter by detected detectors.                                                                           |
| startDate  | date-time | Filter by greater than date.                                                                            |
| endDate    | date-time | Filter by less than date.                                                                               |
| pageNumber | integer   | Specify page number for pagination.                                                                     |
| pageSize   | integer   | Specify page size for pagination.                                                                       |
| sort       | enum      | <p>Sort results in ascending or descending order:</p><p><code>asc</code>,<code>dsc</code></p>           |

{% tabs %}
{% tab title="200: OK Statistics about relevant inspections." %}

```json
{
  "page": 204,
  "critical": 5,
  "suspicious": 10,
  "total": 219
}
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized protocol." %}

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

{% endtab %}

{% tab title="403: Forbidden Bad api-key." %}

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

{% endtab %}

{% tab title="500: Internal Server Error Unexpected error." %}

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

{% endtab %}
{% endtabs %}

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

```bash
curl -X 'GET' \
  'https://api.ironblocks.com/your-protocol-name/inspections/stats?sort=dsc' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer ${YOUR-API-KEY}'
```

{% endtab %}
{% endtabs %}
