# Reset Webhook Signing Key

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

POST https://manage.g.alchemy.com/api/gasManager/policy/{id}/webhookSigningKey/reset

Replaces the policy's webhook signing key with a new one. Gas Manager signs requests with the new key immediately, and the previous key stops working.

<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. The access token needs Gas Manager read and write access.
</Note>


Reference: https://www.alchemy.com/docs/wallets/api-reference/gas-manager-admin-api/admin-api-endpoints/reset-webhook-signing-key

## Headers

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

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| id | string | Yes | ID of the policy. |

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://manage.g.alchemy.com/api/gasManager/policy/string/webhookSigningKey/reset \
  --header 'Authorization: Bearer <token>'
```

### JavaScript

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

fetch('https://manage.g.alchemy.com/api/gasManager/policy/string/webhookSigningKey/reset', 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/string/webhookSigningKey/reset"

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

response = requests.post(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/string/webhookSigningKey/reset"

	req, _ := http.NewRequest("POST", 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.post("https://manage.g.alchemy.com/api/gasManager/policy/string/webhookSigningKey/reset")
  .header("Authorization", "Bearer <token>")
  .asString();
```

### C#

```csharp
using RestSharp;


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

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

```


## Operation Specification

```yaml
path: /api/gasManager/policy/{id}/webhookSigningKey/reset
method: POST
operation:
  summary: Reset Webhook Signing Key
  description: |
    Replaces the policy's webhook signing key with a new one. Gas Manager signs requests with the new key immediately, and the previous key stops working.

    <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. The access token needs Gas Manager read and write access.
    </Note>
  operationId: reset-webhook-signing-key
  security:
    - BearerAuth: []
  parameters:
    - name: id
      description: ID of the policy.
      in: path
      required: true
      schema:
        type: string
  responses:
    '200':
      description: Webhook signing key reset successfully
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: object
                properties:
                  signingKey:
                    type: string
                    description: Key used to sign the policy's custom rules webhook requests. Keep it secret.
                    example: whsec_dGhpcy1pcy1hbi1leGFtcGxlLWtleS1vbmx5LTAwMDA
                required:
                  - signingKey
```
