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

# Update a webhook integration

> **Required scope:** `integration:write`.



## OpenAPI

````yaml /api-reference/openapi.yaml patch /api/v1/forms/{form_token}/integrations/webhooks/{id}
openapi: 3.0.1
info:
  title: FormHug API V1
  version: v1
  description: |
    FormHug public REST API. All request/response keys are snake_case.

    Successful response:

    ```json
    {
      "data": { ... }
    }
    ```

    Paginated response:

    ```json
    {
      "data": [ ... ],
      "pagination": {
        "total": 123,
        "next_cursor": "NQ=="
      }
    }
    ```

    Error response:

    ```json
    {
      "error": "Human-readable message",
      "error_details": [
        { "attribute": "field_name", "message": "specific error" }
      ]
    }
    ```

    `error_details` only appears for model validation failures.
servers:
  - url: https://formhug.ai
security: []
tags:
  - name: Forms
    description: Form CRUD
  - name: Attachments
    description: >-
      2-step upload for form-element images (theme, rich-text, or field-element
      images). Prepare returns an `upload_id`; consume it in a theme update,
      attachment_commitments, or the form `fields` payload depending on purpose.
  - name: Entries
    description: Entries collected by a form owned by the current user
  - name: Folders
    description: Folder CRUD
  - name: Participated Forms
    description: Forms the current user has submitted to (does not own)
  - name: Published Form Entries
    description: Submit entries to a published form
  - name: Published Forms
    description: Read a published form's public structure for filling
  - name: Entry Attachments
    description: >-
      2-step upload for `attachment` field submissions. Prepare returns an
      `upload_id`; submit it under the attachment field in `field_values` when
      creating the entry.
  - name: Me
    description: Current authenticated user
  - name: Webhooks
    description: Webhook integrations attached to a form
  - name: Form Themes
    description: Read and update a form's visual theme
  - name: Form Settings
    description: >-
      Per-form settings — submission flow, availability, access control,
      presentation
  - name: Field Rules
    description: >-
      Read and replace a form's conditional field-display and post-submission
      redirect rules.
  - name: OAuth
    description: OAuth 2.0 PKCE token issuance and revocation
paths:
  /api/v1/forms/{form_token}/integrations/webhooks/{id}:
    parameters:
      - name: form_token
        in: path
        required: true
        schema:
          type: string
      - name: id
        in: path
        description: Webhook ID
        required: true
        schema:
          type: string
    patch:
      tags:
        - Webhooks
      summary: Update a webhook integration
      description: '**Required scope:** `integration:write`.'
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookUpdateRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - id
                      - url
                      - trigger_events
                      - enabled
                      - created_at
                      - updated_at
                    properties:
                      id:
                        type: string
                        description: Webhook ID
                        example: 65a1f0c5d8e9b2a3f4c5d6e7
                      url:
                        type: string
                        format: uri
                        example: https://hooks.example.com/incoming
                      trigger_events:
                        type: array
                        description: List of subscribed event types
                        items:
                          type: string
                          enum:
                            - entry_created
                            - entry_updated
                            - entry_paid
                          example: entry_created
                      enabled:
                        type: boolean
                        example: true
                      created_at:
                        type: string
                        format: date-time
                      updated_at:
                        type: string
                        format: date-time
        '404':
          description: Webhook not found
          content:
            application/json:
              examples:
                not_found:
                  value:
                    error: Webhook not found
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: Validation failed (e.g. malformed url)
          content:
            application/json:
              examples:
                url_invalid:
                  value:
                    error: Url is invalid
                    error_details:
                      - attribute: url
                        message: is invalid
              schema:
                $ref: '#/components/schemas/ValidationErrorEnvelope'
      security:
        - PersonalAccessToken:
            - integration:write
components:
  schemas:
    WebhookUpdateRequest:
      type: object
      properties:
        url:
          type: string
          format: uri
        trigger_events:
          type: array
          items:
            type: string
            enum:
              - entry_created
              - entry_updated
              - entry_paid
        enabled:
          type: boolean
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
    ValidationErrorEnvelope:
      type: object
      required:
        - error
        - error_details
      description: >-
        Returned on model validation failures. error_details lists per-field
        errors.
      properties:
        error:
          type: string
          example: Name can't be blank
        error_details:
          type: array
          items:
            type: object
            required:
              - attribute
              - message
            properties:
              attribute:
                type: string
                example: name
              message:
                type: string
                example: can't be blank
  securitySchemes:
    PersonalAccessToken:
      type: http
      scheme: bearer
      bearerFormat: PAT
      description: >
        Personal Access Token prefixed with `fh_`. Sent as `Authorization:
        Bearer fh_xxx`.

        The scope required by each endpoint is listed in that endpoint's
        description.

````