> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.mailercloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a Webhook

> API for modifying webhook information. This allows you to update the webhook's name, URL, and events.



## OpenAPI

````yaml /openapi-v1.json put /webhooks/{id}
openapi: 3.1.0
info:
  title: Mailercloud Marketing API
  version: 1.0.0
  description: >-
    Campaigns, contacts, lists, segments, automations, and webhooks for the
    Mailercloud Marketing Platform.
servers:
  - url: https://cloudapi.mailercloud.com/v1
security:
  - apiKey: []
tags:
  - name: Campaigns
  - name: Contacts
  - name: Lists
  - name: Tags
  - name: Segments
  - name: Custom Properties
  - name: Senders
  - name: Templates
  - name: Automations
  - name: Webhooks
  - name: Webforms
  - name: Inbox Tracker
  - name: Account
paths:
  /webhooks/{id}:
    put:
      tags:
        - Webhooks
      summary: Update a Webhook
      description: >-
        API for modifying webhook information. This allows you to update the
        webhook's name, URL, and events.
      operationId: update-a-webhook
      parameters:
        - name: id
          in: path
          required: true
          description: Webhook Id
          schema:
            type: string
        - name: Content-Type
          in: header
          required: true
          description: Request body type
          schema:
            type: string
            default: application/json
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              x-examples:
                Example 1:
                  name: Test Webhook
                  url: https://example.com
                  events:
                    - campaign_sent
                    - campaign_opened
              required:
                - name
                - url
                - events
              properties:
                name:
                  type: string
                  pattern: ^[a-zA-Z0-9._ \-]+$/i
                  minLength: 3
                  maxLength: 100
                  description: Updated name of your Webhook.
                url:
                  type: string
                  description: |-
                    Updated URL for your webhook.
                        
                    Supported URL Protocols - HTTP, HTTPS
                events:
                  type: array
                  description: >-
                    List the specific events that you would want to trigger
                    webhook.


                    Supported events :

                        "campaign_sent",
                        "campaign_opened",
                        "campaign_clicked",
                        "unsubscribe",
                        "campaign_error",
                        "spam",
                        "hard_bounce"
                  minItems: 0
                  maxItems: 7
                  items:
                    type: string
            examples:
              Example-1:
                value:
                  name: Test Webhook
                  url: https://example.com
                  events:
                    - campaign_sent
                    - campaign_opened
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                x-examples:
                  Example 1:
                    message: Updated the webhook successfully
              examples:
                Example-1:
                  value:
                    message: Updated the webhook successfully
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      field:
                        type: string
                      message:
                        type: string
                x-examples:
                  Example 1:
                    error:
                      field: url
                      message: url is not valid
              examples:
                Example-1:
                  value:
                    error:
                      field: url
                      message: url is not valid
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                        message:
                          type: string
                x-examples:
                  Example 1:
                    errors:
                      - field: ''
                        message: Authorization failed
              examples:
                Example-1:
                  value:
                    errors:
                      - field: ''
                        message: Authorization failed
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Your Mailercloud API key (plain text, no Bearer prefix). Create keys in
        Settings → API.

````