> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notional.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Approve Agent

## Endpoint

```text theme={null}
POST /exchange
```

## Request Body

| Parameter                   | Type   | Description                                               |
| --------------------------- | ------ | --------------------------------------------------------- |
| `action`\*                  | object | See below                                                 |
| `action.type`\*             | string | Must be `"approveAgent"`                                  |
| `action.hyperliquidChain`\* | string | `"Mainnet"` or `"Testnet"`                                |
| `action.signatureChainId`\* | string | EIP-712 chain ID in hex, for example `"0xa4b1"`           |
| `action.agentAddress`\*     | string | API wallet (agent) address, or the zero address to revoke |
| `action.agentName`          | string | Optional label, max 50 chars                              |
| `action.nonce`\*            | number | Must match outer `nonce`                                  |
| `nonce`\*                   | number | Replay-protection nonce                                   |
| `signature`\*               | object | EIP-712 signature                                         |
| `signature.r`\*             | string | 32-byte hex string                                        |
| `signature.s`\*             | string | 32-byte hex string                                        |
| `signature.v`\*             | number | Recovery id                                               |

## Response

```json theme={null}
{
  "success": true
}
```

## Example Request

```bash theme={null}
curl -X POST https://api.notional.xyz/exchange \
  -H "Content-Type: application/json" \
  -d '{
    "action": {
      "type": "approveAgent",
      "hyperliquidChain": "Mainnet",
      "signatureChainId": "0xa4b1",
      "agentAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
      "agentName": "Momentum Bot",
      "nonce": 1701234567890
    },
    "nonce": 1701234567890,
    "signature": {
      "r": "0x1234...",
      "s": "0x5678...",
      "v": 27
    }
  }'
```

## Notes

<Note>
  * Use `0x0000000000000000000000000000000000000000` to revoke an existing agent by name. - Renaming
    an existing approved agent is not supported in-place. Revoke it first, then approve again with the
    new name. - `action.nonce` must equal the outer `nonce`.
</Note>
