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

# Update a webhook subscription

Updates an existing webhook subscription with new configuration.

## OpenAPI

````yaml /openapi.json post /api/webhookSubscriptions.update
openapi: 3.0.3
info:
  title: Notifuse API
  description: API for Notifuse - a transactional email and newsletter management platform
  version: 1.0.0
  contact:
    name: Notifuse Support
    url: https://www.notifuse.com/support
    email: hello@notifuse.com
  license:
    name: BUSL-1.1
    url: https://github.com/Notifuse/notifuse/blob/main/LICENSE
servers:
  - url: https://{notifuseDomain}
    description: Customer-specific Notifuse API server
    variables:
      notifuseDomain:
        description: Your unique Notifuse domain
        default: demo.notifuse.com
security: []
paths:
  /api/webhookSubscriptions.update:
    post:
      summary: Update a webhook subscription
      description: Updates an existing webhook subscription with new configuration.
      operationId: updateWebhookSubscription
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateWebhookSubscriptionRequest"
      responses:
        "200":
          description: Webhook subscription updated successfully
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateWebhookSubscriptionResponse"
        "400":
          description: Bad request - validation failed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                missingWorkspaceId:
                  value:
                    error: workspace_id is required
                missingId:
                  value:
                    error: id is required
                invalidUrl:
                  value:
                    error: url must be a valid HTTPS URL
        "401":
          description: Unauthorized - invalid or missing authentication token
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: Webhook subscription not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
components:
  schemas:
    CustomEventFilters:
      type: object
      nullable: true
      description: Optional filters for custom_event.* event types
      properties:
        goal_types:
          type: array
          nullable: true
          description: Filter by goal type (e.g., purchase, subscription, lead)
          items:
            type: string
          example:
            - purchase
            - subscription
        event_names:
          type: array
          nullable: true
          description: Filter by event name (e.g., orders/fulfilled, payment.succeeded)
          items:
            type: string
          example:
            - orders/fulfilled
            - payment.succeeded
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
      required:
        - error
    UpdateWebhookSubscriptionRequest:
      type: object
      description: A replace for what identifies the subscription — name, url and
        event_types are required and are written as sent — and a patch for
        everything that narrows it. Omitting enabled, custom_event_filters,
        list_ids or segment_ids leaves the stored value alone; a JSON null reads
        the same way. Send an explicitly empty array or object to remove a
        filter.
      required:
        - workspace_id
        - id
        - name
        - url
        - event_types
      properties:
        workspace_id:
          type: string
          description: The ID of the workspace
          example: ws_1234567890
        id:
          type: string
          description: The ID of the subscription to update
          example: whsub_a1b2c3d4e5f6
        name:
          type: string
          description: Updated name
          example: Production Webhook Updated
        url:
          type: string
          format: uri
          description: Updated URL
          example: https://api.example.com/webhooks/notifuse/v2
        event_types:
          type: array
          description: Updated list of event types
          items:
            type: string
          example:
            - contact.created
            - contact.updated
            - contact.deleted
        custom_event_filters:
          allOf:
            - $ref: "#/components/schemas/CustomEventFilters"
          description: Filters for the custom_event.* events. Omit it to leave the stored
            filters unchanged; send an empty object to stop filtering custom
            events.
        list_ids:
          type: array
          nullable: true
          description: Lists the list.* events are narrowed to. Omit it to leave the
            stored filter unchanged — a body that never mentions it cannot widen
            the subscription — and send an empty array to remove the narrowing.
          items:
            type: string
          example:
            - newsletter
            - product_updates
        segment_ids:
          type: array
          nullable: true
          description: Segments the segment.* events are narrowed to. Omit it to leave the
            stored filter unchanged; send an empty array to remove the
            narrowing.
          items:
            type: string
          example:
            - vip_customers
        enabled:
          type: boolean
          description: Whether the subscription is enabled. Omit it to leave the stored
            value unchanged; send it only to switch the subscription on or off.
          example: true
    UpdateWebhookSubscriptionResponse:
      type: object
      properties:
        subscription:
          $ref: "#/components/schemas/WebhookSubscription"
    WebhookSubscription:
      type: object
      description: A webhook subscription that receives HTTP callbacks when events occur
      properties:
        id:
          type: string
          description: Unique identifier for the subscription
          example: whsub_a1b2c3d4e5f6
        name:
          type: string
          description: Human-readable name for the subscription
          example: Production Webhook
        url:
          type: string
          format: uri
          description: The HTTPS URL to receive webhook events
          example: https://api.example.com/webhooks/notifuse
        secret:
          type: string
          description: Secret key for signing webhook payloads (Standard Webhooks spec)
          example: whsec_a1b2c3d4e5f6g7h8i9j0
        settings:
          $ref: "#/components/schemas/WebhookSubscriptionSettings"
        event_types:
          type: array
          description: List of event types this subscription is subscribed to (flattened
            from settings for convenience)
          items:
            type: string
          example:
            - contact.created
            - contact.updated
            - email.sent
        custom_event_filters:
          $ref: "#/components/schemas/CustomEventFilters"
          description: Optional filters for custom_event.* event types (flattened from
            settings for convenience)
        list_ids:
          type: array
          description: Lists the list.* events are narrowed to (flattened from settings
            for convenience). Absent or empty means every list.
          items:
            type: string
          example:
            - newsletter
            - product_updates
        segment_ids:
          type: array
          description: Segments the segment.* events are narrowed to (flattened from
            settings for convenience). Absent or empty means every segment.
          items:
            type: string
          example:
            - vip_customers
        enabled:
          type: boolean
          description: Whether the subscription is currently active
          example: true
        last_delivery_at:
          type: string
          format: date-time
          nullable: true
          description: Timestamp of the last delivery attempt
          example: 2024-01-15T10:30:00Z
        created_at:
          type: string
          format: date-time
          description: When the subscription was created
          example: 2024-01-01T00:00:00Z
        updated_at:
          type: string
          format: date-time
          description: When the subscription was last updated
          example: 2024-01-15T10:30:00Z
    WebhookSubscriptionSettings:
      type: object
      description: Settings for webhook subscription
      properties:
        event_types:
          type: array
          description: List of event types this subscription is subscribed to
          items:
            type: string
          example:
            - contact.created
            - contact.updated
            - email.sent
        custom_event_filters:
          $ref: "#/components/schemas/CustomEventFilters"
        list_ids:
          type: array
          description: Lists the list.* events are narrowed to. Absent or empty means
            every list.
          items:
            type: string
          example:
            - newsletter
            - product_updates
        segment_ids:
          type: array
          description: Segments the segment.* events are narrowed to. Absent or empty
            means every segment.
          items:
            type: string
          example:
            - vip_customers
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API token for authentication
````
