# Edit Approval Rule

<mark style="color:orange;">**`PATCH`**</mark> `https://api.sfox.com/v1`**`/approval-rules/:rule_id`**

Change an existing approval rule in your account.

{% hint style="info" %}
If you have an approval rule for altering SAFE settings, the change submitted may not be immediately processed as it may require approval from other users in your account.
{% endhint %}

### Path Parameters

<table><thead><tr><th width="190">Parameter</th><th width="100">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>rule_id</code></strong> <mark style="color:red;">required</mark></td><td>int</td><td>ID of the approval rule generated by sFOX you wish to edit</td></tr></tbody></table>

### Body Parameters

<table><thead><tr><th width="234">Parameter</th><th width="90"></th><th>Description</th></tr></thead><tbody><tr><td><strong><code>required_approvals</code></strong></td><td>int</td><td>Number of approvals needed for the action to be approved.</td></tr><tr><td><strong><code>threshold</code></strong></td><td>number</td><td>The withdrawal amount (USD) required for the action to require approvals.</td></tr></tbody></table>

### Responses

<details>

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

```json
{
  id: 1,
  rule_type: "WITHDRAW",
  date_added: "2021-03-17T16:19:47.000Z",
  status: "Pending",
  available_approver_count: 2,
  required_approvals: 2,
  threshold: 100,
}
```

</details>

### Example Requests

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

```bash
curl -X PATCH \
  -H 'Content-type: application/json' \
  -H 'Authorization: Bearer <API_TOKEN>' \
  --data '{ "required_approvals":  3 , "threshold":  500 }'  \
  'https://api.sfox.com/v1/approval-rules/1'
```

{% endtab %}

{% tab title="NodeJS" %}

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

axios({
  method: 'patch',
  url: 'https://api.sfox.com/v1/approval-rules/1',
  headers: {
    'Authorization': 'Bearer <API_KEY>'
  },
  data: {
    required_approvals:  3 , 
    threshold:  500
  }
}).then(response => {
  console.log(response)
}).catch(err => {
  console.error(err)
});
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

data = requests.patch(
  "https://api.sfox.com/v1/approval-rules/1",
  headers={
    "Authorization": "Bearer <API_KEY>",
  },
  data={
   "required_approvals": 3,
   "threshold": 500
  }
)
print(data)
```

{% endtab %}
{% endtabs %}
