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

# Create managed sitemap

> Creates one sitemap document that imports the pages its sitemap lists as URL documents and re-syncs them on `refreshRate`, adding newly listed pages and removing dropped ones. The response is the sitemap document with status `PENDING`; fetch it by ID to read its status and, on `ERROR`, `data.sync.failure.message`.



## OpenAPI

````yaml /specs-prettified/realtime/openapi.stable.json post /v1/stable/document/managed-sitemap
openapi: 3.0.0
info:
  title: Realtime
  description: Realtime gateway API service
  version: 1.0.0
  contact: {}
servers:
  - url: https://realtime-api.voiceflow.com
security: []
tags: []
paths:
  /v1/stable/document/managed-sitemap:
    post:
      tags:
        - Document
      summary: Create managed sitemap
      description: Creates one sitemap document that imports the pages its sitemap
        lists as URL documents and re-syncs them on `refreshRate`, adding newly
        listed pages and removing dropped ones. The response is the sitemap
        document with status `PENDING`; fetch it by ID to read its status and,
        on `ERROR`, `data.sync.failure.message`.
      operationId: StableDocumentController_createManagedSitemap
      parameters:
        - name: projectID
          required: true
          in: query
          schema:
            type: string
            description: The ID of the project to operate on.
        - name: environmentAlias
          required: true
          in: query
          schema:
            type: string
            description: The alias of the environment to operate on (e.g. `main`).
        - name: markdownConversion
          required: false
          in: query
          schema:
            description: When enabled, HTML is automatically converted to markdown to
              generate better chunks.
            anyOf:
              - type: boolean
              - type: string
                enum:
                  - "true"
                  - "false"
                x-enumNames:
                  - "TRUE"
                  - "FALSE"
        - name: llmBasedChunks
          required: false
          in: query
          schema:
            description: When enabled, an LLM groups the content into logical sections by
              topic instead of splitting it on a fixed size. Best for complex
              documents covering varied topics.
            anyOf:
              - type: boolean
              - type: string
                enum:
                  - "true"
                  - "false"
                x-enumNames:
                  - "TRUE"
                  - "FALSE"
        - name: llmGeneratedQ
          required: false
          in: query
          schema:
            description: When enabled, an LLM will be used to generate a question based on
              the document context and specific chunk, then prepend it to the
              chunk. This enhances retrieval by aligning chunks with potential
              user queries.
            anyOf:
              - type: boolean
              - type: string
                enum:
                  - "true"
                  - "false"
                x-enumNames:
                  - "TRUE"
                  - "FALSE"
        - name: llmContentSummarization
          required: false
          in: query
          schema:
            description: When enabled, an LLM summarizes and rewrites the content, removing
              unnecessary information and focusing on important parts to
              optimize for retrieval. Limited to 15 rows per table upload.
            anyOf:
              - type: boolean
              - type: string
                enum:
                  - "true"
                  - "false"
                x-enumNames:
                  - "TRUE"
                  - "FALSE"
        - name: llmPrependContext
          required: false
          in: query
          schema:
            description: "When enabled, an LLM generates a context summary based on the
              document and chunk context, and prepends it to each chunk. This
              improves retrieval by providing additional context to each chunk.
              Note: If both llmGeneratedQ and llmPrependContext are set to true,
              llmGeneratedQ takes precedence, and the context summarization will
              not be applied."
            anyOf:
              - type: boolean
              - type: string
                enum:
                  - "true"
                  - "false"
                x-enumNames:
                  - "TRUE"
                  - "FALSE"
        - name: singleChunk
          required: false
          in: query
          schema:
            description: When enabled, the whole document is stored as a single chunk, so
              retrieval returns it in full. Documents above the embedding model
              input limit (about 30,000 characters) are split into chunks as
              usual. Takes precedence over llmBasedChunks.
            anyOf:
              - type: boolean
              - type: string
                enum:
                  - "true"
                  - "false"
                x-enumNames:
                  - "TRUE"
                  - "FALSE"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StableDocumentCreateManagedSitemapRequest"
      responses:
        "202":
          description: Returns the sitemap document with status `PENDING`; its pages are
            imported after the response, so fetch the document by ID to read its
            final status.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StableDocumentResponse"
          x-vf-doc:
            description: Returns the sitemap document with status `PENDING`; its pages are
              imported after the response, so fetch the document by ID to read
              its final status.
      security:
        - token: []
components:
  schemas:
    StableDocumentCreateManagedSitemapRequest:
      type: object
      properties:
        sitemapURL:
          type: string
          format: uri
          description: The HTTPS URL of the sitemap to read. A bare site URL works too —
            when it does not end in `.xml`, `/sitemap.xml`, `/sitemap_index.xml`
            and `/sitemap/sitemap.xml` are probed in turn.
        patterns:
          description: "Which of the pages the sitemap lists it keeps. Matching is
            case-insensitive and unanchored: a pattern with no `*` matches any
            URL containing it as a substring (`/blog/`), while `*` matches any
            run of characters (`*/tag/*`, `*.pdf`)."
          allOf:
            - $ref: "#/components/schemas/StableDocumentSitemapPatterns"
        refreshRate:
          default: never
          description: How often the sitemap is re-read to add the pages it newly lists
            and remove the ones it no longer does. Its pages are re-crawled on
            the same schedule.
          type: string
          enum:
            - daily
            - weekly
            - monthly
            - never
          x-enumNames:
            - DAILY
            - WEEKLY
            - MONTHLY
            - NEVER
        metadata:
          default: []
          description: Metadata tags attached to the sitemap and to every page it imports,
            used to filter knowledge base retrieval at runtime.
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                description: The name of the metadata field.
              values:
                type: array
                items:
                  type: string
                description: The values assigned to this metadata field.
            required:
              - key
              - values
        folderID:
          description: The ID of the Knowledge Base folder to file the sitemap and the
            pages it imports under. Omit to create them at the top level.
          type: string
          minLength: 1
      required:
        - sitemapURL
      additionalProperties: false
    StableDocumentSitemapPatterns:
      type: object
      properties:
        include:
          default: []
          description: Patterns a page must match at least one of to be kept. Empty keeps
            every page the sitemap lists.
          maxItems: 100
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 200
        exclude:
          default: []
          description: Patterns that drop a page when any one of them matches, even one an
            `include` pattern kept.
          maxItems: 100
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 200
      additionalProperties: false
    StableDocumentResponse:
      type: object
      properties:
        document:
          $ref: "#/components/schemas/StableDocument"
      required:
        - document
    StableDocument:
      type: object
      properties:
        id:
          type: string
        data:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/KBDocumentData"
        status:
          $ref: "#/components/schemas/KBDocumentStatus"
        smartChunking:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/SmartChunking"
        folderID:
          nullable: true
          description: The ID of the Knowledge Base folder the document is filed under, or
            null when it sits at the top level.
          type: string
          minLength: 1
      required:
        - id
        - data
        - status
        - smartChunking
        - folderID
    KBDocumentData:
      oneOf:
        - $ref: "#/components/schemas/KBDocumentUrlData"
        - $ref: "#/components/schemas/KBDocumentDocxData"
        - $ref: "#/components/schemas/KBDocumentPDFData"
        - $ref: "#/components/schemas/KBDocumentTextData"
        - $ref: "#/components/schemas/KBDocumentMarkdownData"
        - $ref: "#/components/schemas/KBDocumentCSVData"
        - $ref: "#/components/schemas/KBDocumentXLSXData"
        - $ref: "#/components/schemas/KBDocumentTableData"
        - $ref: "#/components/schemas/KBDocumentSitemapData"
    KBDocumentUrlData:
      type: object
      properties:
        type:
          type: string
          enum:
            - url
          x-enumNames:
            - URL
        name:
          type: string
        url:
          type: string
        title:
          type: string
        refreshRate:
          allOf:
            - $ref: "#/components/schemas/KnowledgeBaseDocumentRefreshRate"
        lastSuccessUpdate:
          type: string
        accessTokenID:
          type: number
        integrationExternalID:
          type: string
        source:
          allOf:
            - $ref: "#/components/schemas/KnowledgeBaseDocumentIntegrationType"
        sitemapDocumentID:
          nullable: true
          type: string
      required:
        - type
        - name
        - url
    KnowledgeBaseDocumentRefreshRate:
      type: string
      enum:
        - daily
        - weekly
        - monthly
        - never
      x-enumNames:
        - DAILY
        - WEEKLY
        - MONTHLY
        - NEVER
    KnowledgeBaseDocumentIntegrationType:
      type: string
      enum:
        - zendesk
        - shopify
      x-enumNames:
        - ZENDESK
        - SHOPIFY
    KBDocumentDocxData:
      type: object
      properties:
        type:
          type: string
          enum:
            - docx
          x-enumNames:
            - DOCX
        name:
          type: string
        url:
          nullable: true
          type: string
      required:
        - type
        - name
    KBDocumentPDFData:
      type: object
      properties:
        type:
          type: string
          enum:
            - pdf
          x-enumNames:
            - PDF
        name:
          type: string
        url:
          nullable: true
          type: string
      required:
        - type
        - name
    KBDocumentTextData:
      type: object
      properties:
        type:
          type: string
          enum:
            - text
          x-enumNames:
            - TEXT
        name:
          type: string
        canEdit:
          type: boolean
        url:
          nullable: true
          type: string
      required:
        - type
        - name
    KBDocumentMarkdownData:
      type: object
      properties:
        type:
          type: string
          enum:
            - md
          x-enumNames:
            - MD
        name:
          type: string
        url:
          nullable: true
          type: string
      required:
        - type
        - name
    KBDocumentCSVData:
      type: object
      properties:
        type:
          type: string
          enum:
            - csv
          x-enumNames:
            - CSV
        name:
          type: string
        rowsCount:
          type: number
        url:
          nullable: true
          type: string
      required:
        - type
        - name
    KBDocumentXLSXData:
      type: object
      properties:
        type:
          type: string
          enum:
            - xlsx
          x-enumNames:
            - XLSX
        name:
          type: string
        rowsCount:
          type: number
        url:
          nullable: true
          type: string
      required:
        - type
        - name
    KBDocumentTableData:
      type: object
      properties:
        type:
          type: string
          enum:
            - table
          x-enumNames:
            - TABLE
        name:
          type: string
        rowsCount:
          type: number
        url:
          nullable: true
          type: string
      required:
        - type
        - name
        - rowsCount
    KBDocumentSitemapData:
      type: object
      properties:
        type:
          type: string
          enum:
            - sitemap
          x-enumNames:
            - SITEMAP
        name:
          type: string
        url:
          type: string
        refreshRate:
          allOf:
            - $ref: "#/components/schemas/KnowledgeBaseDocumentRefreshRate"
        lastSuccessUpdate:
          type: string
        patterns:
          allOf:
            - $ref: "#/components/schemas/KBDocumentSitemapPatterns"
        sync:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/KBDocumentSitemapSync"
      required:
        - type
        - name
        - url
    KBDocumentSitemapPatterns:
      type: object
      properties:
        include:
          type: array
          items:
            type: string
        exclude:
          type: array
          items:
            type: string
      required:
        - include
        - exclude
    KBDocumentSitemapSync:
      type: object
      properties:
        syncedAt:
          type: string
        startedAt:
          nullable: true
          type: string
          format: date-time
          pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        addedCount:
          type: number
        removedCount:
          type: number
        failure:
          nullable: true
          type: object
          properties:
            message:
              type: string
            at:
              type: string
            code:
              allOf:
                - $ref: "#/components/schemas/KBDocumentSitemapSyncFailureCode"
          required:
            - message
            - at
      required:
        - syncedAt
        - addedCount
        - removedCount
    KBDocumentSitemapSyncFailureCode:
      type: string
      enum:
        - documentLimit
      x-enumNames:
        - DOCUMENT_LIMIT
    KBDocumentStatus:
      type: object
      properties:
        type:
          $ref: "#/components/schemas/KnowledgeBaseDocumentStatus"
        data: {}
      required:
        - type
    KnowledgeBaseDocumentStatus:
      type: string
      enum:
        - ERROR
        - PENDING
        - SUCCESS
        - INITIALIZED
      x-enumNames:
        - ERROR
        - PENDING
        - SUCCESS
        - INITIALIZED
    SmartChunking:
      type: object
      properties:
        markdownConversion:
          description: When enabled, HTML is automatically converted to markdown to
            generate better chunks.
          anyOf:
            - type: boolean
            - type: string
              enum:
                - "true"
                - "false"
              x-enumNames:
                - "TRUE"
                - "FALSE"
        llmBasedChunks:
          anyOf:
            - type: boolean
            - type: string
              enum:
                - "true"
                - "false"
              x-enumNames:
                - "TRUE"
                - "FALSE"
        llmGeneratedQ:
          description: When enabled, an LLM will be used to generate a question based on
            the document context and specific chunk, then prepend it to the
            chunk. This enhances retrieval by aligning chunks with potential
            user queries.
          anyOf:
            - type: boolean
            - type: string
              enum:
                - "true"
                - "false"
              x-enumNames:
                - "TRUE"
                - "FALSE"
        llmContentSummarization:
          description: When enabled, an LLM summarizes and rewrites the content, removing
            unnecessary information and focusing on important parts to optimize
            for retrieval. Limited to 15 rows per table upload.
          anyOf:
            - type: boolean
            - type: string
              enum:
                - "true"
                - "false"
              x-enumNames:
                - "TRUE"
                - "FALSE"
        llmPrependContext:
          description: "When enabled, an LLM generates a context summary based on the
            document and chunk context, and prepends it to each chunk. This
            improves retrieval by providing additional context to each chunk.
            Note: If both llmGeneratedQ and llmPrependContext are set to true,
            llmGeneratedQ takes precedence, and the context summarization will
            not be applied."
          anyOf:
            - type: boolean
            - type: string
              enum:
                - "true"
                - "false"
              x-enumNames:
                - "TRUE"
                - "FALSE"
        singleChunk:
          description: When enabled, the whole document is stored as a single chunk, so
            retrieval returns it in full. Documents above the embedding model
            input limit (about 30,000 characters) are split into chunks as
            usual. Takes precedence over llmBasedChunks.
          anyOf:
            - type: boolean
            - type: string
              enum:
                - "true"
                - "false"
              x-enumNames:
                - "TRUE"
                - "FALSE"
  securitySchemes:
    token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Voiceflow bearer token
````
