> For the complete documentation index, see [llms.txt](https://docs.venn.build/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.venn.build/venn-network/getting-started/safe-guard/transaction-validation-api.md).

# Transaction Validation API

The Venn Guard Transaction Validation API enables automatic transaction validation through Venn’s decentralized security network. It accepts standard user transactions and returns a JSON that is ready for upload to any Safe UI.

## API

{% hint style="success" %}
**v1.0.4 \[STABLE]**
{% endhint %}

### Request

<table data-header-hidden><thead><tr><th width="162.15625"></th><th></th></tr></thead><tbody><tr><td>URL</td><td><pre><code>https://safe-operator1-signer.venn.build/batch/sign
</code></pre></td></tr><tr><td>METHOD</td><td><pre><code>POST
</code></pre></td></tr></tbody></table>

**Body**

```typescript
{
    chainId: number,
    safeAddress: string,
    transactions: [
      {
        to: string
        value: string
        data: string
      }
    ]
}
```

### Response

If all of the transactions passed validation, the API will respond with a new Safe Transaction Batch that can be uploaded into any Safe UI.

If one or more of the transactions fail validation, the API will respond with an error.

{% hint style="info" %}
In both cases, the `STATUS` of the response is `200 OK`
{% endhint %}

#### Success

```typescript
{
    requestId: string,
    data: {
        version: string,
        chainId: string,
        createdAt: number,
        meta: {
            name: string,
            description: string,
            txBuilderVersion: string,
            createdFromSafeAddress: string,
            createdFromOwnerAddress: string,
            checksum: string
        },

        transactions: [
            // Venn Signature Transaction
            {
                to: string,
                value: string,
                data: string
            },


            // Original User Transactions
            {
                to: string,
                value: string,
                data: string
            }
        ]
    },
    status: string
}
```

#### Error

```typescript
{
    requestId: string,
    isError: boolean,
    message: string,
    status: string
}
```

## Code Example

```typescript
import axios from "axios";

// Your Safe Address
const SAFE_ADDRESS = "0x..." 

// 1st transaction in the batch
const userTransaction1 = {
    to: "0x...",
    value: "0",
    data: "0x...",
    safeAddress: SAFE_ADDRESS,
};

// 2nd transaction in the batch
const userTransaction2 = {
    to: "0x...",
    value: "0",
    data: "0x...",
    safeAddress: SAFE_ADDRESS,
};

// Validating and signing the transactions with Venn
const response = await axios.post(
    "https://operator1-signer.venn.build/batch/sign",
    {
       transactions [userTransaction1, userTransaction2],
       safeAddress: SAFE_ADDRESS
    }
);

console.log(response.data):
// Transaction Batch JSON
// {
//    ...
//    transactions: [
//       <Venn's Approving Signature Tx>,
//       <User Tx 1>,
//       <User Tx 2>,
//    ]
// }


```
