# place.stream.server.updateWebhook

> Update an existing webhook configuration.

- Kind: procedure
- Authority: server.stream.place
- Lexicon: 1
- Published by [stream.place](https://lexicon.garden/identity/did:plc:rbvrr34edl5ddpuwcubjiost), not the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:rbvrr34edl5ddpuwcubjiost/place.stream.server.updateWebhook)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:rbvrr34edl5ddpuwcubjiost/place.stream.server.updateWebhook/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:rbvrr34edl5ddpuwcubjiost/place.stream.server.updateWebhook/analytics)

## Procedure (`place.stream.server.updateWebhook`)

Type: procedure · POST

### Input (application/json)

- `active` (boolean): Whether this webhook should be active.
- `description` (string): A description of what this webhook is used for.
  - Constraints: maxLength: 500
- `events` (array): The types of events this webhook should receive.
  - `items` (string)
    - Constraints: enum: chat | livestream | follow | mention | stream.received
- `id` (string, required): The ID of the webhook to update.
- `muteWords` (array): Words to filter out from chat messages. Messages containing any of these words will not be forwarded.
  - `items` (string)
    - Constraints: maxLength: 100
- `name` (string): A user-friendly name for this webhook.
  - Constraints: maxLength: 100
- `prefix` (string): Text to prepend to webhook messages.
  - Constraints: maxLength: 100
- `rewrite` (array): Text replacement rules for webhook messages.
  - `items` (ref)
    - Reference: `place.stream.server.defs#rewriteRule`
- `suffix` (string): Text to append to webhook messages.
  - Constraints: maxLength: 100
- `url` (string · uri): The webhook URL where events will be sent.

### Output (application/json)

- `webhook` (ref, required)
  - Reference: `place.stream.server.defs#webhook`

### Errors

- `WebhookNotFound`: The specified webhook was not found.
- `Unauthorized`: The authenticated user does not have access to this webhook.
- `InvalidUrl`: The provided webhook URL is invalid or unreachable.
- `DuplicateWebhook`: A webhook with this URL already exists for this user.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Update an existing webhook configuration.",
      "errors": [
        {
          "description": "The specified webhook was not found.",
          "name": "WebhookNotFound"
        },
        {
          "description": "The authenticated user does not have access to this webhook.",
          "name": "Unauthorized"
        },
        {
          "description": "The provided webhook URL is invalid or unreachable.",
          "name": "InvalidUrl"
        },
        {
          "description": "A webhook with this URL already exists for this user.",
          "name": "DuplicateWebhook"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "active": {
              "description": "Whether this webhook should be active.",
              "type": "boolean"
            },
            "description": {
              "description": "A description of what this webhook is used for.",
              "maxLength": 500,
              "type": "string"
            },
            "events": {
              "description": "The types of events this webhook should receive.",
              "items": {
                "enum": [
                  "chat",
                  "livestream",
                  "follow",
                  "mention",
                  "stream.received"
                ],
                "type": "string"
              },
              "type": "array"
            },
            "id": {
              "description": "The ID of the webhook to update.",
              "type": "string"
            },
            "muteWords": {
              "description": "Words to filter out from chat messages. Messages containing any of these words will not be forwarded.",
              "items": {
                "maxLength": 100,
                "type": "string"
              },
              "type": "array"
            },
            "name": {
              "description": "A user-friendly name for this webhook.",
              "maxLength": 100,
              "type": "string"
            },
            "prefix": {
              "description": "Text to prepend to webhook messages.",
              "maxLength": 100,
              "type": "string"
            },
            "rewrite": {
              "description": "Text replacement rules for webhook messages.",
              "items": {
                "ref": "place.stream.server.defs#rewriteRule",
                "type": "ref"
              },
              "type": "array"
            },
            "suffix": {
              "description": "Text to append to webhook messages.",
              "maxLength": 100,
              "type": "string"
            },
            "url": {
              "description": "The webhook URL where events will be sent.",
              "format": "uri",
              "type": "string"
            }
          },
          "required": [
            "id"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "webhook": {
              "ref": "place.stream.server.defs#webhook",
              "type": "ref"
            }
          },
          "required": [
            "webhook"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "place.stream.server.updateWebhook",
  "lexicon": 1
}
```
