# Delete Bank Account

<table data-header-hidden><thead><tr><th width="89.5546875" align="center"></th><th></th></tr></thead><tbody><tr><td align="center"><mark style="color:red;"><strong>DELETE</strong></mark> </td><td>https://api.sfox.com/v1/user/bank</td></tr></tbody></table>

Disconnect a bank account linked to an end user's account.

***

{% hint style="info" %}
If you would like to remove a bank account, or would like to link a different bank account to an sFOX account, you would call this endpoint with the User Authentication Token for authorization.&#x20;

This will disconnect the bank account completely. After completing this action, you must link another bank account to deposit or withdraw fiat.
{% endhint %}

## Request

{% hint style="info" %}
**Authentication:** This endpoint requires a [User Auth Token](https://docs.sfox.com/connect/rest-api/end-users/create-user-auth-token) for authentication. Requests using your Connect API Key will be rejected.
{% endhint %}

### Example Requests

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

```sh
curl -X DELETE \
-H "Authorization: Bearer ${USER_AUTH_TOKEN}"  \
'https://api.sfox.com/v1/user/bank'
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const axios = require('axios');

const config = {
  method: 'delete',
  url: 'https://api.sfox.com/v1/user/bank',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer <USER_AUTH_TOKEN>'
  }
}

axios(config)
  .then((response) => {
    console.log(response.status)
    console.log(response.data)
  })
  .catch(err => {
    console.error(err.response.status)
    console.error(err.response.data)
  });
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import os

data = requests.delete(
  "https://api.sfox.com/v1/user/bank",
  headers={
    "Authorization": f"Bearer {os.environ['USER_AUTH_TOKEN']}"
  }
)
print(data.status_code)
print(data.json())
```

{% endtab %}
{% endtabs %}

## Response

### Responses

<details>

<summary><mark style="color:green;">200</mark>: OK</summary>

This status is returned when the bank is successfully disconnected.  There is no body on the response.

</details>

<details>

<summary><mark style="color:red;">400</mark>: Bad Request</summary>

If no bank has been linked to the sFOX account

```json
{
    "error": "User does not have an valid bank account"
}
```

</details>
