> For the complete documentation index, see [llms.txt](https://cryptotalk.gitbook.io/aave-protocol-rest-apis/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cryptotalk.gitbook.io/aave-protocol-rest-apis/aave-v2/collateral-setting.md).

# Collateral Setting

## /aave/setUserUseReserveAsCollateral

<mark style="color:green;">`POST`</mark> `https://cryptotalk-public-gateway-byeii62k.de.gateway.dev/aave/setUserUseReserveAsCollateral`

**1)** Request body must be **`JSON`**\
\
**2)** Request structure sample\
`{`\
&#x20; `"params" : {` \
&#x20;          `"addr" : "0xabcd...efe",` \
&#x20;          `"from_tkn" : "DAI",` \
&#x20;          `"gas" : "80",` \
&#x20;          `"useAsCollateral" : false` \
&#x20;          `}`\
`}`\
\
**3)** ***from\_tkn*** is case sensitive\
\
**4)** Sample response contain ***rawTx*** object that needs to be signed and broadcast to main net. \
\
**5)** ***useAsCollateral;*** send false if you don't want to use asset as collateral. Otherwise send true

#### Query Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| key  | string | API Key     |

#### Request Body

| Name   | Type   | Description                                                                                                                                                                              |
| ------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| params | object | <p><code>{</code><br> <code>addr : "0xabcd....efe",</code><br> <code>from\_tkn: "ETH",</code><br> <code>gas: "80",</code><br> <code>useAsCollateral : false</code><br><code>}</code></p> |

{% tabs %}
{% tab title="200 Success response example" %}

```
{
  "operation": "TOGGLECOLLATERAL",
  "token": "KNC",
  "to_addr": "0xA5576138F067EB83C6Ad4080F3164b757DEB2737",
  "rawTx": {
    "from": "0xa5576138f067eb83c6ad4080f3164b757deb2737",
    "value": "0x0",
    "to": "0x7d2768de32b0b80b7a3454c06bdac94a69ddc7a9",
    "data": "0x5a3b74b9000000000000000000000000dd974d5c2e2928dea5f71b9825b8b646686bd2000000000000000000000000000000000000000000000000000000000000000000",
    "nonce": "0x743",
    "gasLimit": "0x7a120",
    "gasPrice": "0x104c533c00"
  },
  "isError": false,
  "resendRequest": false,
  "text": ""
}
```

{% endtab %}
{% endtabs %}
