> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notifuse.com/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
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
      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'
      security:
        - BearerAuth: []
components:
  schemas:
    UpdateWebhookSubscriptionRequest:
      type: object
      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:
          $ref: '#/components/schemas/CustomEventFilters'
        enabled:
          type: boolean
          description: Whether the subscription is enabled
          example: true
    UpdateWebhookSubscriptionResponse:
      type: object
      properties:
        subscription:
          $ref: '#/components/schemas/WebhookSubscription'
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
      required:
        - error
    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
    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)
        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'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API token for authentication

````