# Get Webhook Signing Key

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

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

Returns the key used to sign the policy's custom rules webhook requests. The key is created the first time you call this endpoint, and Gas Manager starts signing webhook requests for the policy from then on.

Each signed request includes an `X-Alchemy-Signature` header. See [verify webhook requests](/docs/wallets/transactions/sponsor-gas/conditional-sponsorship-rules#verify-webhook-requests).

<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/get-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 GET \
  --url https://manage.g.alchemy.com/api/gasManager/policy/string/webhookSigningKey \
  --header 'Authorization: Bearer <token>'
```

### JavaScript

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

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

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

response = requests.get(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"

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

### C#

```csharp
using RestSharp;


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

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

```


## Operation Specification

```yaml
path: /api/gasManager/policy/{id}/webhookSigningKey
method: GET
operation:
  summary: Get Webhook Signing Key
  description: |
    Returns the key used to sign the policy's custom rules webhook requests. The key is created the first time you call this endpoint, and Gas Manager starts signing webhook requests for the policy from then on.

    Each signed request includes an `X-Alchemy-Signature` header. See [verify webhook requests](/docs/wallets/transactions/sponsor-gas/conditional-sponsorship-rules#verify-webhook-requests).

    <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: get-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 fetched 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
```
