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

# Update a webhook

> Modifies an existing webhook by ID.



## OpenAPI

````yaml /openapi.json patch /webhooks/{id}
openapi: 3.1.0
info:
  description: Helo API
  version: 1.0.0-beta.1
  title: Helo API
servers:
  - url: https://api.helohq.com
security: []
tags:
  - name: Activity
    description: >-
      Track and retrieve message activity, including messages, delivery and
      engagement events.
  - name: Broadcasts
    description: Manage and track broadcast email campaigns.
  - name: Channels
    description: Create and manage communication channels for organizing messages.
  - name: Domains
    description: Register, verify, and manage domains for email sending.
  - name: Sending
    description: Send transactional and broadcast emails.
  - name: Statistics
    description: Access activity statistics.
  - name: Webhooks
    description: Create and manage webhooks for event notifications.
paths:
  /webhooks/{id}:
    patch:
      tags:
        - Webhooks
      summary: Update a webhook
      description: Modifies an existing webhook by ID.
      operationId: Webhooks_update
      parameters:
        - name: id
          in: path
          description: Unique identifier of the webhook.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhookRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: ruby
          source: |-
            Helo.configure do |config|
              config.api_key = ENV.fetch("HELO_API_KEY")
            end

            id = "550e8400-e29b-41d4-a716-446655440000"
            update_webhook_request = Helo::UpdateWebhookRequest.new(
              url: "test-url",
              events: ["accepted", "processed"],
              channel_id: "550e8400-e29b-41d4-a716-446655440000",
              additional_headers: [Helo::WebhookHeader.new(name: "test-name", value: "test-value")],
              enabled: true
            )
            Helo::Webhooks.update(id, update_webhook_request)
        - lang: javascript
          source: |-
            import Helo from "@helo-email/sdk";

            const apiKey = process.env.HELO_API_KEY;
            const helo = new Helo(apiKey);

            const result = await helo.webhooks.update(
              "550e8400-e29b-41d4-a716-446655440000",
              {
                url: "test-url",
                events: [Helo.WebhookEvent.ACCEPTED, Helo.WebhookEvent.PROCESSED],
                channelId: "550e8400-e29b-41d4-a716-446655440000",
                additionalHeaders: [{ name: "test-name", value: "test-value" }],
                enabled: true,
              },
            );
        - lang: go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/helo-email/helo-sdk-go\"\n)\n\nfunc main() {\n\tclient := helo.NewHelo(os.Getenv(\"HELO_API_KEY\"))\n\tctx := context.Background()\n\n\tparams := &helo.UpdateWebhookRequest{\n\t\tURL: \"test-url\",\n\t\tEvents: []helo.WebhookEvent{helo.WebhookEventAccepted, helo.WebhookEventProcessed},\n\t\tChannelID: \"550e8400-e29b-41d4-a716-446655440000\",\n\t\tEnabled: true,\n\t}\n\tresult, err := client.Webhooks.Update(ctx, \"550e8400-e29b-41d4-a716-446655440000\", params)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t_ = result\n}"
        - lang: csharp
          source: >-
            using HeloEmail.Sdk.WebhookEndpoints;


            var webhook = await helo.WebhookEndpoints.Update("webhook-id", new
            UpdateWebhookEndpointRequest

            {
                Enabled = false,
            });
        - lang: python
          source: >-
            import sdk_helo_email as helo


            client = helo.Helo()  # reads HELO_API_KEY from the environment


            webhook = client.webhook_endpoints.update("webhook-id",
            enabled=False)
components:
  schemas:
    UpdateWebhookRequest:
      type: object
      properties:
        url:
          type: string
          description: New delivery URL. Must be HTTPS.
        events:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEvent'
          description: Replaces the full list of event type subscriptions.
        channelId:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            Set to a UUID to scope to a channel, or null to remove channel
            scoping.
        additionalHeaders:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/WebhookHeader'
          description: >-
            Replaces all custom headers. Set to null to remove all custom
            headers.
        enabled:
          type: boolean
          description: Enables or disables the webhook.
      description: Request body for updating a webhook. Only provided fields are changed.
    WebhookResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the webhook.
        channelId:
          type:
            - string
            - 'null'
          format: uuid
          description: Channel this webhook is scoped to, or null for account-wide.
        url:
          type: string
          description: The HTTPS URL events are delivered to.
        payloadSigningKey:
          type: string
          description: >-
            HMAC-SHA256 signing key used to verify webhook authenticity. Sent as
            the X-Helo-Webhook-Signature request header on each delivery.
        enabled:
          type: boolean
          description: Whether the webhook is active and will receive events.
        additionalHeaders:
          type: array
          items:
            $ref: '#/components/schemas/WebhookHeader'
          description: Custom headers sent with each webhook delivery.
        events:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEvent'
          description: Event types that trigger this webhook.
        lastResponse:
          oneOf:
            - $ref: '#/components/schemas/WebhookLastResponse'
            - type: 'null'
          description: >-
            The most recent delivery outcome for this webhook, or null if no
            delivery has been attempted yet.
      description: Webhook configuration properties.
    ErrorResponse:
      description: Standard error response body.
      type: object
      properties:
        type:
          description: A URI reference identifying the problem type.
          type: string
        title:
          description: Short, human-readable summary of the problem.
          type: string
        instance:
          description: URI reference identifying the specific occurrence of the problem.
          type: string
        status:
          description: HTTP status code.
          type: integer
          format: int32
        code:
          description: Application-specific error code.
          type: string
        detail:
          description: Human-readable explanation of this specific occurrence.
          type: string
        requestId:
          description: Unique request ID, useful for support correlation.
          type: string
        errors:
          description: Field-level validation errors, keyed by field name.
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/ValidationError'
    WebhookEvent:
      enum:
        - accepted
        - processed
        - bounced
        - delivered
        - opened
        - clicked
        - complained
        - unsubscribed
        - resubscribed
      description: Email lifecycle event type that can trigger a webhook delivery.
    WebhookHeader:
      type: object
      properties:
        name:
          type: string
          description: Header name, without the X-Customer- prefix.
        value:
          type: string
          description: Header value.
      required:
        - name
        - value
      description: A custom HTTP header to include in webhook deliveries.
    WebhookLastResponse:
      type: object
      properties:
        statusCode:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            HTTP status code returned by the endpoint, or null when no HTTP
            response was received (network error, timeout, or blocked host).
        error:
          type:
            - string
            - 'null'
          description: >-
            Reason a delivery failed without an HTTP response (e.g. a connection
            error or BlockedHost). Null when an HTTP response was received.
        at:
          type: string
          format: date-time
          description: Timestamp of the most recent delivery attempt.
      description: The most recent delivery outcome recorded for a webhook.
    ValidationError:
      description: A single field validation error.
      required:
        - message
      type: object
      properties:
        message:
          description: Description of the validation failure.
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````