# Deactivate User

<table data-header-hidden><thead><tr><th width="90.20703125" 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/enterprise/account/:user_id</td></tr></tbody></table>

Deactivates a user account. &#x20;

***

Deactivating the account will remove any connection between you and the user's account.&#x20;

* You will no longer be able to [generate User Auth Tokens](https://docs.sfox.com/connect/rest-api/end-users/create-user-auth-token) for this user.
* The user will no longer appear when [retrieving End Users](https://docs.sfox.com/connect/rest-api/end-users/get-end-user).

{% hint style="info" %}
Requests to deactivate a user will fail unless the user's account balances are zero. Please be sure to have the user withdraw balances from their account prior to attempting deactivation.
{% endhint %}

## Request

### Path Parameters

<table><thead><tr><th width="210">Name</th><th width="101">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>user_id</code> <mark style="color:red;"><strong>required</strong></mark></td><td>string</td><td>User ID of the user's account to be disabled</td></tr></tbody></table>

### Example Requests

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

```sh
curl -X DELETE \
-H "Authorization: Bearer ${ENTERPRISE_API_KEY}"  \
'https://api.sfox.com/v1/enterprise/account/${USER_ID}'
```

{% endtab %}

{% tab title="NodeJS" %}

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

const config = {
  method: 'delete',
  url: 'https://api.sfox.com/v1/enterprise/account/${USER_ID}',
  headers: {
    'Authorization': `Bearer ${process.env.ENTERPRISE_API_KEY}`
  }
}

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

{% endtab %}

{% tab title="Python" %}

```python
import requests
import os

data = requests.delete(
  "https://api.sfox.com/v1/enterprise/account/${USER_ID}",
  headers={
    "Authorization": f"Bearer {os.environ['${ENTERPRISE_API_KEY}']}"
  }
)
print(data.status_code)
print(data.json())
```

{% endtab %}
{% endtabs %}

## Response

### Responses

<details>

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

```
No body returned
```

</details>

<details>

<summary><mark style="color:red;">422 Unprocessable Content</mark></summary>

```json
{
    "error": "Can not disable account with non-zero balances. Please remove all balances and try again."
}
```

</details>

<details>

<summary><mark style="color:red;">404 Not Found</mark></summary>

```json
{
"error": "The account does not exist to be disabled."
}
```

</details>
