# Delete Policy

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

DELETE https://manage.g.alchemy.com/api/gasManager/policy/{id}

Deletes a policy by id.

<Note title="Header Access Token">
  To call this endpoint, you must use your [access token](/docs/how-to-create-access-keys) in the [authorization header](/docs/how-to-use-api-keys-in-http-headers) of the API request. 
</Note>


Reference: https://www.alchemy.com/docs/wallets/api-reference/gas-manager-admin-api/admin-api-endpoints/delete-policy

## Headers

| Name | Type | Required | Description |
|------|------|----------|-------------|
| Authorization | string | Yes | Bearer authentication token |

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| id | string | Yes | ID of the policy to be deleted |

## Code Examples

### cURL

```bash
curl --request DELETE \
  --url https://manage.g.alchemy.com/api/gasManager/policy/6d834x9k1yh4dx6z \
  --header 'Authorization: Bearer <token>'
```

### JavaScript

```javascript
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch('https://manage.g.alchemy.com/api/gasManager/policy/6d834x9k1yh4dx6z', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://manage.g.alchemy.com/api/gasManager/policy/6d834x9k1yh4dx6z"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://manage.g.alchemy.com/api/gasManager/policy/6d834x9k1yh4dx6z"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.delete("https://manage.g.alchemy.com/api/gasManager/policy/6d834x9k1yh4dx6z")
  .header("Authorization", "Bearer <token>")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://manage.g.alchemy.com/api/gasManager/policy/6d834x9k1yh4dx6z");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
var response = await client.DeleteAsync(request);

Console.WriteLine("{0}", response.Content);

```


## Operation Specification

```yaml
path: /api/gasManager/policy/{id}
method: DELETE
operation:
  summary: Delete Policy
  description: |
    Deletes a policy by id.

    <Note title="Header Access Token">
      To call this endpoint, you must use your [access token](/docs/how-to-create-access-keys) in the [authorization header](/docs/how-to-use-api-keys-in-http-headers) of the API request. 
    </Note>
  operationId: delete-policy
  security:
    - BearerAuth: []
  parameters:
    - name: id
      description: ID of the policy to be deleted
      in: path
      required: true
      schema:
        type: string
        default: 6d834x9k1yh4dx6z
  responses:
    '200':
      description: '`200` - Policy deleted successfully'
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
              error:
                type: object
                properties:
                  msg:
                    type: string
```
