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

# Create and crawl a managed knowledge website

> Create the existing website group and enqueue its first crawl. Prefer this for multi-page websites with later refresh/selection management. Default depth two, maximum ten; page budget defaults/maxes to five hundred. Optional propertyId from list_properties, otherwise global. Return website.websiteId and job.jobId; use get_knowledge_crawl until terminal status, then get_knowledge_website and get_knowledge_usage. 202 means queued, not indexed/active. After an ambiguous failure discover the website/job before retrying. Required permission: knowledge:write. Connected business only; no tenant override.



## OpenAPI

````yaml /openapi.json post /knowledge/websites
openapi: 3.0.3
info:
  title: Visito M2M API
  version: 1.0.0
  description: >-
    Tenant-scoped server-to-server API for channels, conversations, commerce,
    custom AI tools, and WhatsApp templates. Send operations are asynchronous
    and return queued acknowledgements. Expansion adds conversation controls,
    knowledge, sales opportunities, delivery status, reporting, and signed
    webhooks.
servers:
  - url: https://platform-api.visitoai.com/m2m/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Channels
  - name: Conversations
  - name: Commerce
  - name: Custom tools
  - name: WhatsApp templates
  - name: Properties
  - name: Knowledge
  - name: Sales CRM
  - name: Delivery
  - name: Reporting
  - name: Webhooks
paths:
  /knowledge/websites:
    post:
      summary: Create and crawl a managed knowledge website
      description: >-
        Create the existing website group and enqueue its first crawl. Prefer
        this for multi-page websites with later refresh/selection management.
        Default depth two, maximum ten; page budget defaults/maxes to five
        hundred. Optional propertyId from list_properties, otherwise global.
        Return website.websiteId and job.jobId; use get_knowledge_crawl until
        terminal status, then get_knowledge_website and get_knowledge_usage. 202
        means queued, not indexed/active. After an ambiguous failure discover
        the website/job before retrying. Required permission: knowledge:write.
        Connected business only; no tenant override.
      operationId: create_knowledge_website
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KnowledgeWebsiteCreateInput'
      responses:
        '202':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeWebsiteCreated'
        '400':
          description: Invalid request
        '403':
          description: Missing permission
        '404':
          description: Resource not found
        '409':
          description: Conflict; read state and reconcile
components:
  schemas:
    KnowledgeWebsiteCreateInput:
      type: object
      additionalProperties: false
      properties:
        url:
          type: string
          maxLength: 2048
        crawlDepth:
          type: integer
          minimum: 1
          maximum: 10
        maxPages:
          type: integer
          minimum: 1
          maximum: 500
        propertyId:
          type: string
          maxLength: 128
      required:
        - url
    KnowledgeWebsiteCreated:
      type: object
      additionalProperties: false
      properties:
        website:
          $ref: '#/components/schemas/KnowledgeWebsite'
        job:
          $ref: '#/components/schemas/KnowledgeCrawlJob'
      required:
        - website
        - job
    KnowledgeWebsite:
      type: object
      additionalProperties: false
      properties:
        websiteId:
          type: string
          maxLength: 128
        sourceId:
          type: string
          maxLength: 128
        sourceType:
          type: string
          enum:
            - website
        active:
          type: boolean
        scope:
          type: string
          enum:
            - property
            - global
        title:
          type: string
          maxLength: 160
        url:
          type: string
          maxLength: 2048
        chunkCount:
          type: integer
          minimum: 0
        activeTokens:
          type: integer
          minimum: 0
        selectedTokens:
          type: integer
          minimum: 0
        createdBy:
          type: object
          additionalProperties: false
          properties:
            id:
              type: string
              maxLength: 128
            displayName:
              type: string
              maxLength: 160
            email:
              type: string
              maxLength: 320
        rootUrl:
          type: string
          maxLength: 2048
        normalizedRootUrl:
          type: string
          maxLength: 2048
        crawlDepth:
          type: integer
          minimum: 1
          maximum: 10
        maxPages:
          type: integer
          minimum: 1
          maximum: 500
        propertyId:
          type: string
          maxLength: 128
        propertyName:
          type: string
          maxLength: 160
        status:
          type: string
          enum:
            - idle
            - crawling
            - failed
        defaultEnabled:
          type: boolean
        selectionRules:
          type: array
          items:
            type: object
            additionalProperties: false
            properties:
              kind:
                type: string
                enum:
                  - path
                  - page
              key:
                type: string
                maxLength: 2048
              enabled:
                type: boolean
            required:
              - kind
              - key
              - enabled
        currentGenerationId:
          type: string
          maxLength: 128
        latestJob:
          $ref: '#/components/schemas/KnowledgeCrawlJob'
        totalPages:
          type: integer
          minimum: 0
        enabledPages:
          type: integer
          minimum: 0
        pages:
          type: array
          items:
            type: object
            additionalProperties: false
            properties:
              sourceId:
                type: string
                maxLength: 128
              url:
                type: string
                maxLength: 2048
              canonicalUrl:
                type: string
                maxLength: 2048
              path:
                type: string
                maxLength: 2048
              enabled:
                type: boolean
              chunkCount:
                type: integer
                minimum: 0
              tokens:
                type: integer
                minimum: 0
              displayOrder:
                type: integer
                minimum: 0
              updatedAt:
                type: string
                maxLength: 128
            required:
              - sourceId
              - url
              - canonicalUrl
              - path
              - enabled
              - chunkCount
          maxItems: 500
        createdAt:
          type: string
          maxLength: 128
        updatedAt:
          type: string
          maxLength: 128
        lastCrawledAt:
          type: string
          maxLength: 128
      required:
        - websiteId
        - sourceId
        - sourceType
        - active
        - scope
        - title
        - url
        - chunkCount
        - rootUrl
        - normalizedRootUrl
        - crawlDepth
        - maxPages
        - status
        - defaultEnabled
        - selectionRules
        - totalPages
        - enabledPages
    KnowledgeCrawlJob:
      type: object
      properties:
        jobId:
          type: string
        status:
          type: string
          enum:
            - queued
            - running
            - completed
            - failed
        progress:
          type: object
          properties:
            phase:
              type: string
              enum:
                - queued
                - crawling
                - embedding
                - finalizing
            pagesDiscovered:
              type: integer
            pagesProcessed:
              type: integer
            chunksEmbedded:
              type: integer
        chunks:
          type: integer
        url:
          type: string
        crawlDepth:
          type: integer
        maxPages:
          type: integer
        sourceId:
          type: string
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
        websiteId:
          type: string
          maxLength: 128
        websiteGenerationId:
          type: string
          maxLength: 128
        createdAt:
          type: string
          maxLength: 128
        startedAt:
          type: string
          maxLength: 128
        completedAt:
          type: string
          maxLength: 128
        updatedAt:
          type: string
          maxLength: 128
        snapshotPages:
          type: integer
          minimum: 0
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Visito M2M API key
      description: Server-side tenant-scoped credential created from Build > API Keys.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.