# Replace webhook addresses

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

PUT https://dashboard.alchemy.com/api/update-webhook-addresses

Replaces every address of an address activity webhook. The JSON body
takes `webhook_id` and `addresses`, which can have at most 500 addresses.
An empty list removes every address.

Reference: https://www.alchemy.com/docs/data/webhooks/webhooks-api-endpoints/replace-webhook-addresses

## Headers

| Name | Type | Required | Description |
|------|------|----------|-------------|
| X-Alchemy-Token | string | Yes | Your team's auth token. Find it on the Webhooks page of the Alchemy dashboard. |

## Code Examples

### cURL

```bash
curl --request PUT \
  --url https://dashboard.alchemy.com/api/update-webhook-addresses \
  --header 'Content-Type: application/json' \
  --header 'X-Alchemy-Token: string' \
  --data '{
  "webhook_id": "string",
  "addresses": [
    "string"
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', 'X-Alchemy-Token': 'string'},
  body: JSON.stringify({webhook_id: 'string', addresses: ['string']})
};

fetch('https://dashboard.alchemy.com/api/update-webhook-addresses', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://dashboard.alchemy.com/api/update-webhook-addresses"

payload = {
    "webhook_id": "string",
    "addresses": ["string"]
}
headers = {
    "Content-Type": "application/json",
    "X-Alchemy-Token": "string"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

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

func main() {

	url := "https://dashboard.alchemy.com/api/update-webhook-addresses"

	payload := strings.NewReader("{\n  \"webhook_id\": \"string\",\n  \"addresses\": [\n    \"string\"\n  ]\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("X-Alchemy-Token", "string")

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

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

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.put("https://dashboard.alchemy.com/api/update-webhook-addresses")
  .header("Content-Type", "application/json")
  .header("X-Alchemy-Token", "string")
  .body("{\n  \"webhook_id\": \"string\",\n  \"addresses\": [\n    \"string\"\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://dashboard.alchemy.com/api/update-webhook-addresses");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Alchemy-Token", "string");
request.AddJsonBody("{\n  \"webhook_id\": \"string\",\n  \"addresses\": [\n    \"string\"\n  ]\n}", false);
var response = await client.PutAsync(request);

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

```


## Operation Specification

```yaml
path: /api/update-webhook-addresses
method: PUT
operation:
  operationId: ReplaceWebhookAddresses
  responses:
    '200':
      description: Replaced the webhook's addresses
      content:
        application/json:
          schema:
            properties: {}
            type: object
            description: Construct a type with a set of properties K of type T
            additionalProperties: false
          examples:
            Example 1:
              value: {}
    '400':
      description: Invalid input
      content:
        application/json:
          schema:
            description: |-
              The error body. `name` is null for the statuses that have no name, such as
              404 and 429.
            properties:
              message:
                type: string
              name:
                type: string
                nullable: true
            required:
              - message
              - name
            type: object
            additionalProperties: false
          examples:
            Example 1:
              value:
                message: Missing required fields
                name: ValidationError
    '401':
      description: Requires authentication
      content:
        application/json:
          schema:
            description: |-
              The error body. `name` is null for the statuses that have no name, such as
              404 and 429.
            properties:
              message:
                type: string
              name:
                type: string
                nullable: true
            required:
              - message
              - name
            type: object
            additionalProperties: false
          examples:
            Example 1:
              value:
                message: Unauthenticated request.
                name: AuthError
    '404':
      description: Webhook not found
      content:
        application/json:
          schema:
            description: |-
              The error body. `name` is null for the statuses that have no name, such as
              404 and 429.
            properties:
              message:
                type: string
              name:
                type: string
                nullable: true
            required:
              - message
              - name
            type: object
            additionalProperties: false
          examples:
            Example 1:
              value:
                message: Webhook not found
                name: null
    '503':
      description: Webhooks service unavailable
      content:
        application/json:
          schema:
            description: |-
              The error body. `name` is null for the statuses that have no name, such as
              404 and 429.
            properties:
              message:
                type: string
              name:
                type: string
                nullable: true
            required:
              - message
              - name
            type: object
            additionalProperties: false
          examples:
            Example 1:
              value:
                message: Internal server error
                name: ServerError
  description: |-
    Replaces every address of an address activity webhook. The JSON body
    takes `webhook_id` and `addresses`, which can have at most 500 addresses.
    An empty list removes every address.
  summary: Replace webhook addresses
  tags:
    - Webhooks
  security:
    - team_api_key: []
  parameters: []
  requestBody:
    required: true
    content:
      application/json:
        schema:
          type: object
          required:
            - webhook_id
            - addresses
          properties:
            webhook_id:
              type: string
              description: The webhook ID.
            addresses:
              type: array
              items:
                type: string
              maxItems: 500
              description: The new list of addresses. It replaces every address that the webhook watches.
```
