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

# Update a webhook

> Update a webhook's URL, status, secret, or subscribed events.

    Any field omitted from the request is left unchanged. Passing 'events' replaces the full set
    of subscribed event types.



## OpenAPI

````yaml /api-reference/api-docs.yaml patch /v0/webhooks/{webhookId}/update
openapi: 3.1.0
info:
  title: Fungies API v0
  version: 0.3.7
servers:
  - url: https://api.fungies.io
security: []
tags:
  - name: discounts
    description: Discounts related endpoints
  - name: keys
    description: Offer product keys related endpoints
  - name: orders
    description: Orders related endpoints
  - name: payments
    description: Payments related endpoints
  - name: offers
    description: Offers related endpoints
  - name: products
    description: Products related endpoints
  - name: subscriptions
    description: Subscriptions related endpoints
  - name: tax
    description: Tax calculation related endpoints
  - name: users
    description: Users related endpoints
  - name: variants
    description: Product variants related endpoints
  - name: plans
    description: Product plans related endpoints
  - name: elements
    description: Elements related endpoints
  - name: webhooks
    description: Webhooks related endpoints
paths:
  /v0/webhooks/{webhookId}/update:
    patch:
      tags:
        - webhooks
      summary: Update a webhook
      description: |-
        Update a webhook's URL, status, secret, or subscribed events.

            Any field omitted from the request is left unchanged. Passing 'events' replaces the full set
            of subscribed event types.
      operationId: PatchV0WebhooksWebhookIdUpdate
      parameters:
        - name: webhookId
          in: path
          required: true
          description: Unique identifier (UUID) of the webhook.
          schema:
            $ref: >-
              #/components/schemas/PatchV0WebhooksWebhookIdUpdateParameterWebhookId
      requestBody:
        description: PATCH /v0/webhooks/:webhookId/update Request body
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchV0WebhooksWebhookIdUpdateRequestBody'
      responses:
        '200':
          description: PATCH /v0/webhooks/:webhookId/update Positive response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PatchV0WebhooksWebhookIdUpdatePositiveResponse
        '400':
          description: PATCH /v0/webhooks/:webhookId/update Negative response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PatchV0WebhooksWebhookIdUpdateNegativeResponse
              examples:
                example1:
                  value:
                    status: error
                    error:
                      message: Sample error message
      security:
        - APIKEY_1: []
          APIKEY_2: []
components:
  schemas:
    PatchV0WebhooksWebhookIdUpdateParameterWebhookId:
      type: string
      format: uuid
      description: Unique identifier (UUID) of the webhook.
    PatchV0WebhooksWebhookIdUpdateRequestBody:
      type: object
      properties:
        url:
          type: string
          format: url
          description: >-
            HTTP(S) endpoint that receives event deliveries. Must use http:// or
            https:// and must not resolve to a loopback, private, or link-local
            address.
        status:
          type: string
          enum:
            - active
            - inactive
          description: |-
            Whether the webhook receives deliveries:
                - active: Receives deliveries for its subscribed events
                - inactive: Configured but not currently receiving deliveries
        secret:
          type: string
          minLength: 16
          description: >-
            Caller-supplied signing secret used to verify the 'x-fngs-signature'
            header on each delivery. Any string of at least 16 characters — no
            required prefix or format.
        events:
          type: array
          items:
            type: string
            enum:
              - payment_success
              - payment_refunded
              - payment_failed
              - subscription_created
              - subscription_interval
              - subscription_updated
              - subscription_cancelled
          description: >-
            Event types this webhook is subscribed to. Omit to subscribe to no
            events.
      required: []
    PatchV0WebhooksWebhookIdUpdatePositiveResponse:
      type: object
      properties:
        status:
          type: string
          const: success
        data:
          type: object
          properties:
            webhook:
              type: object
              properties:
                object:
                  type: string
                  enum:
                    - webhook
                  default: webhook
                id:
                  type: string
                  format: uuid
                url:
                  type: string
                status:
                  type: string
                  enum:
                    - active
                    - inactive
                secret:
                  type: string
                events:
                  type: array
                  items:
                    type: string
                    enum:
                      - payment_success
                      - payment_refunded
                      - payment_failed
                      - subscription_created
                      - subscription_interval
                      - subscription_updated
                      - subscription_cancelled
                createdAt:
                  type:
                    - integer
                    - 'null'
                  format: int64
                  minimum: 0
                  maximum: 9007199254740991
                deletedAt:
                  type:
                    - integer
                    - 'null'
                  format: int64
                  minimum: 0
                  maximum: 9007199254740991
                  default: null
              required:
                - id
                - url
                - status
                - secret
                - events
                - createdAt
          required:
            - webhook
      required:
        - status
        - data
    PatchV0WebhooksWebhookIdUpdateNegativeResponse:
      type: object
      properties:
        status:
          type: string
          const: error
        error:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - status
        - error
  securitySchemes:
    APIKEY_1:
      type: apiKey
      in: header
      name: x-fngs-public-key
    APIKEY_2:
      type: apiKey
      in: header
      name: x-fngs-secret-key

````