# Unstake

<mark style="color:blue;">**`POST`**</mark> `https://api.sfox.com/v1`**`/staking/unstake`**

Submit a request to unstake an an active stake.

{% hint style="info" %}
Only active stakes (`status` = `STAKING`) may be unstaked. Only certain currencies may be unstaked on demand.
{% endhint %}

### Body Parameters

<table><thead><tr><th width="232">Parameter</th><th width="95">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>id</code></strong> <mark style="color:red;">required</mark></td><td>int</td><td>The sFOX-generated ID of the active stake you wish to unstake.</td></tr><tr><td><strong><code>currency</code></strong> <mark style="color:red;">required</mark></td><td>string</td><td>The currency of the active stake you wish to unstake.</td></tr></tbody></table>

### Responses

<details>

<summary><mark style="color:green;">204</mark>: Unstake Request Accepted</summary>

```json
//Success response does not include a response body
```

</details>

### Example Request

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

```bash
curl -X POST \
  -H 'Content-type: application/json' \
  -H 'Authorization: Bearer <API_TOKEN>' \
  --data '{ "currency": "avax",
            "id": 500 }'  \
  'https://api.sfox.com/v1/staking/unstake'
```

{% endtab %}

{% tab title="NodeJS" %}

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

axios({
  method: 'post',
  url: 'https://api.sfox.com/v1/staking/unstake',
  headers: {
    'Authorization': 'Bearer <API_KEY>'
  },
  data: {
   currency: 'avax',
   id: 500
  }
}).then(response => {
  console.log(response)
}).catch(err => {
  console.error(err)
});
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

data = requests.post(
  "https://api.sfox.com/v1/staking/unstake",
  headers={
    "Authorization": "Bearer <API_KEY>",
  },
  data={
    "currency": "avax",
    "id": 500
  }
)
print(data)
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sfox.com/rest-api/staking/unstake.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
