> For the complete documentation index, see [llms.txt](https://harpie.gitbook.io/welcome-to-the-harpie-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://harpie.gitbook.io/welcome-to-the-harpie-docs/~/changes/T8YMsU3xPtqI6mFgVEdC/harpie-for-developers/background-check-api/validate-transaction.md).

# Validate Transaction

## validateTransaction

<mark style="color:green;">`POST`</mark> `https://api.harpie.io/v2/validateTransaction`

Get insights on the safety of a transaction. Addresses with no relevant data default to a recommended action of "ALLOW."

#### Request Body

| Name                                     | Type   | Description                                                                                                                                                                 |
| ---------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| apiKey<mark style="color:red;">\*</mark> | String | Your API key. You can find this in your dashboard.                                                                                                                          |
| from<mark style="color:red;">\*</mark>   | String | <p>The address that the transaction is originating from. <br>This is the <code>.from</code> parameter of an Ethereum transaction.</p>                                       |
| to<mark style="color:red;">\*</mark>     | String | <p>The address that the transaction is being sent to.</p><p>This is the <code>.to</code> parameter of an Ethereum transaction.</p>                                          |
| data<mark style="color:red;">\*</mark>   | String | <p>The data being passed along with the transaction.</p><p>This is the <code>.data</code> parameter of an Ethereum transaction. If no data exists, use "0x" by default.</p> |
| value<mark style="color:red;">\*</mark>  | Number | <p>The value being sent along with the transaction.</p><p>This is the <code>.value</code> parameter of an Ethereum transaction</p>                                          |

{% tabs %}
{% tab title="200: OK A summary on transaction security" %}

```typescript
{
    summary: string,
    isDangerousOperation: boolean, // Returns `true` if the operation is a transfer or approval
    recommendedAction: "ALLOW" | "BLOCK",
    addressDetails: {
        name: string,
        isMaliciousAddress: boolean,
        isAssociatedWithProtocol: boolean,
        tags: {
            THEFT: boolean,
            CYBERCRIME: boolean,
            SANCTIONED: boolean,
            BOT: boolean,
            WASH_TRADER: boolean,
            MIXER: boolean,
            NO_DATA: boolean,
        }
    }
}
```

{% endtab %}
{% endtabs %}

**Example query:**

```typescript
fetch("https://api.harpie.io/v2/validateTransaction", {
    method: "POST",
    headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        apiKey: "{YOUR API KEY HERE}",
        to: "0xEea6cEDf9c8a4bD197Ced6F11B254138B388a5f5",
        value: 0,
        from: "0x84F3Cfa1Ecbf333A3e91C0DAF7415ea0F1bcB701",
        data: "0xa9059cbb00000000000000000000000055456cbd1f11298b80a53c896f4b1dc9bc16c731000000000000000000000000000000000000000000000000000de0b6b3a7640000"
    })
})

```

#### Example response:

{% code overflow="wrap" %}

```json
{
  "summary": "This transaction calls a token approval, which sends assets to a known malicious address. We recommend BLOCKING this transaction.",
  "isDangerousOperation": true,
  "recommendedAction": "BLOCK",
  "addressDetails": {
    "name": "Malicious Address",
    "isMaliciousAddress": true,
    "isAssociatedWithProtocol": false,
    "tags": {
      "THEFT": true,
      "CYBERCRIME": false,
      "NO_DATA": false,
      "SANCTIONED": false,
      "MIXER": false,
      "BOT": false,
      "WASH_TRADER": false
    }
  }
}
```

{% endcode %}
