> ## 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.

# Scan Sitemap

> Fetches and parses a sitemap URL to discover available pages. Returns
the list of URLs found without starting a crawl.
Requires `knowledge:upload` permission.




## OpenAPI

````yaml POST /api/knowledge-bases/{id}/sitemap-scan
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}/sitemap-scan:
    post:
      tags:
        - Sitemap & Crawl Jobs
      summary: Scan sitemap
      description: |
        Fetches and parses a sitemap URL to discover available pages. Returns
        the list of URLs found without starting a crawl.
        Requires `knowledge:upload` permission.
      operationId: sitemapScan
      parameters:
        - $ref: '#/components/parameters/KnowledgeBaseId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sitemapUrl:
                  type: string
                  description: URL of the sitemap to scan
              required:
                - sitemapUrl
      responses:
        '200':
          description: Sitemap scan results
          content:
            application/json:
              schema:
                type: object
                properties:
                  urls:
                    type: array
                    items:
                      type: string
                    description: Discovered URLs
                  total:
                    type: integer
                    description: Total number of URLs found
                required:
                  - urls
                  - total
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    KnowledgeBaseId:
      name: id
      in: path
      required: true
      description: Knowledge base ID
      schema:
        type: string
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
            required:
              - error
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
            required:
              - error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token using an API key (format nl_live_* or nl_test_*)

````