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

# List Webhook Sources

> Returns all webhook sources configured for a knowledge base.
Requires `knowledge:view` permission.




## OpenAPI

````yaml GET /api/knowledge-bases/{id}/webhooks
openapi: 3.1.0
info:
  title: Naturalead Knowledge Bases API
  version: 1.0.0
  description: >
    API for managing knowledge bases, documents, sitemap crawl jobs, and webhook

    sources in the Naturalead platform. All endpoints require API key
    authentication

    and are scoped to the caller's account.
servers:
  - url: '{baseUrl}'
    description: API server
    variables:
      baseUrl:
        default: http://localhost:3001
security:
  - BearerAuth: []
tags:
  - name: Knowledge Bases
    description: Knowledge base CRUD operations
  - name: Documents
    description: Document management within a knowledge base
  - name: Sitemap & Crawl Jobs
    description: Sitemap scanning and web crawl job management
  - name: Webhook Sources
    description: Webhook source management for auto-updating content
paths:
  /api/knowledge-bases/{id}/webhooks:
    get:
      tags:
        - Webhook Sources
      summary: List webhook sources
      description: |
        Returns all webhook sources configured for a knowledge base.
        Requires `knowledge:view` permission.
      operationId: listWebhookSources
      parameters:
        - $ref: '#/components/parameters/KnowledgeBaseId'
      responses:
        '200':
          description: List of webhook sources
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/WebhookSource'
components:
  parameters:
    KnowledgeBaseId:
      name: id
      in: path
      required: true
      description: Knowledge base ID
      schema:
        type: string
  schemas:
    WebhookSource:
      type: object
      properties:
        _id:
          type: string
          description: Unique identifier
        accountId:
          type: string
          description: Owning account ID
        knowledgeBaseId:
          type: string
          description: Parent knowledge base ID
        name:
          type: string
          description: Webhook source name
        enabled:
          type: boolean
          description: Whether the webhook source is active
        steps:
          type: array
          items:
            $ref: '#/components/schemas/Step'
          description: Ordered list of execution steps
        flowInputs:
          type: array
          items:
            $ref: '#/components/schemas/FlowInput'
          description: Input variables for the step flow
        url:
          type: string
          description: URL to fetch content from
        method:
          type: string
          description: HTTP method
        headers:
          type: object
          additionalProperties:
            type: string
          description: HTTP headers
        body:
          type: string
          description: Request body
        auth:
          type: object
          description: Authentication configuration
        intervalMinutes:
          type: integer
          description: Polling interval in minutes
        timeoutMs:
          type: integer
          description: Request timeout in milliseconds
        lastTriggeredAt:
          type: string
          format: date-time
          description: Timestamp of the last trigger
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - _id
        - accountId
        - knowledgeBaseId
        - name
        - enabled
        - createdAt
        - updatedAt
    Step:
      type: object
      description: A single execution step in a webhook source flow
      properties:
        name:
          type: string
          description: Unique step identifier within the flow
        order:
          type: integer
          description: Execution order (0-based)
        url:
          type: string
          description: >-
            HTTP endpoint URL. Supports template variables like
            `{{stepName.varName}}`
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - PATCH
            - DELETE
          default: GET
        headers:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
              value:
                type: string
          description: Request headers (support template variables)
        body:
          type: string
          description: Request body (for POST/PUT/PATCH). Supports template variables
        extractions:
          type: array
          items:
            $ref: '#/components/schemas/FlowStepExtraction'
          description: Variables to extract from the response via JSONPath
        fanOut:
          type: object
          description: Fan-out configuration to iterate over an array in the response
          properties:
            sourcePath:
              type: string
              description: JSONPath to the array to iterate over
            itemVariable:
              type: string
              default: item
              description: Variable name for the current item in the iteration
            rateLimit:
              type: object
              properties:
                delayMs:
                  type: integer
                  description: Delay in ms between each fan-out request
        retry:
          type: object
          properties:
            maxAttempts:
              type: integer
              default: 0
            initialDelayMs:
              type: integer
              default: 1000
            maxDelayMs:
              type: integer
              default: 30000
            backoffMultiplier:
              type: number
              default: 2
        onError:
          type: string
          enum:
            - fail
            - skip
            - retry
          default: fail
          description: Error handling strategy
        timeoutMs:
          type: integer
          description: Per-step timeout in milliseconds (1000-900000)
      required:
        - name
        - order
        - url
    FlowInput:
      type: object
      properties:
        name:
          type: string
          description: Input variable name
        value:
          type: string
          description: Input variable value
      required:
        - name
        - value
    FlowStepExtraction:
      type: object
      description: Defines a variable to extract from a step's HTTP response
      properties:
        variableName:
          type: string
          description: Name of the variable to store the extracted value
        jsonPath:
          type: string
          description: JSONPath expression (must start with `$`)
        useAsContext:
          type: boolean
          default: false
          description: >-
            When true, the extracted value is included as context in subsequent
            steps' content before knowledge base processing. This ensures the
            value is stored in the vector store alongside the fetched content.
      required:
        - variableName
        - jsonPath
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token using an API key (format nl_live_* or nl_test_*)

````