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

# Create a recurring crawl seed

> Registers a start URL + per-domain crawler options. The first
crawl is scheduled immediately unless the knowledge base is
paused (`crawl_settings.paused` - creating a seed never resumes
the crawler). Discovered pages arrive as documents
(`origin: web_source`, `web_source_id` set), deduped against
manual documents by `source_key`. The engine-global crawl
settings (`webpages_limit`, `periodicity`, `paused`, plus
decorative `depth`) are rejected here with 400 - set them via
the KB PATCH `crawl_settings`. The URL is the idempotency key:
re-POSTing an already-registered URL returns the existing seed
with `200` rather than creating a duplicate. Requires `editor`+.




## OpenAPI

````yaml /api-reference/storage/swagger.yml post /v1/knowledge_bases/{knowledgeBaseId}/web_sources
openapi: 3.0.3
info:
  version: 1.0.0
  title: Knowledges API
  description: >
    Public REST API for the Prisme.ai Knowledges (storage) workspace: knowledge
    bases, documents (uploaded files, web pages, remote files, connector
    documents), recurring web-crawl sources, semantic search, access control,
    per-knowledge-base API keys, and skills.


    Resource identifiers use the physical prefixes emitted by the implementation
    (`vs_` knowledge base, `vsf_` document, `seed_` web source, `kb-` API-key
    slug).


    This spec documents the public REST surface only. Internal helpers (private
    automations prefixed with `_`) and admin/GDPR lifecycle operations are not
    part of the public contract.
  contact:
    name: Prisme.ai
    url: https://prisme.ai
servers:
  - url: https://{host}/v2/workspaces/slug:storage/webhooks
    description: Prisme.ai workspace webhooks
    variables:
      host:
        default: api.studio.prisme.ai
        description: API host (override for self-hosted or sandbox)
security:
  - BearerAuth: []
  - WorkspaceApiKeyAuth: []
tags:
  - name: Knowledge Bases
    description: >-
      Create, list, read, update, and delete knowledge bases (vector-backed
      document stores).
  - name: Documents
    description: >-
      Ingest and manage documents (uploaded files, web pages, remote files,
      connector documents) and their indexing.
  - name: Web Sources
    description: >-
      Recurring web crawl seeds that discover and index pages into a knowledge
      base.
  - name: Search
    description: Semantic search over a knowledge base.
  - name: Access
    description: Per-knowledge-base access bindings (user, group, org, agent principals).
  - name: API Keys
    description: Per-knowledge-base API keys for connector authentication.
  - name: Stats
    description: Aggregate dashboard statistics.
  - name: Skills
    description: Prompt/instruction registry entries.
paths:
  /v1/knowledge_bases/{knowledgeBaseId}/web_sources:
    parameters:
      - name: knowledgeBaseId
        in: path
        required: true
        schema:
          type: string
          pattern: ^vs_[A-Za-z0-9-]+$
          maxLength: 128
        description: >-
          Knowledge base id. Legacy physical prefix `vs_` (the `kb_` rename is
          deferred).
    post:
      tags:
        - Web Sources
      summary: Create a recurring crawl seed
      description: |
        Registers a start URL + per-domain crawler options. The first
        crawl is scheduled immediately unless the knowledge base is
        paused (`crawl_settings.paused` - creating a seed never resumes
        the crawler). Discovered pages arrive as documents
        (`origin: web_source`, `web_source_id` set), deduped against
        manual documents by `source_key`. The engine-global crawl
        settings (`webpages_limit`, `periodicity`, `paused`, plus
        decorative `depth`) are rejected here with 400 - set them via
        the KB PATCH `crawl_settings`. The URL is the idempotency key:
        re-POSTing an already-registered URL returns the existing seed
        with `200` rather than creating a duplicate. Requires `editor`+.
      operationId: createWebSource
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
              additionalProperties: false
              properties:
                url:
                  type: string
                  format: uri
                crawler_options:
                  type: object
                  additionalProperties: true
      responses:
        '200':
          description: Existing seed returned (the URL was already registered).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebSource'
        '201':
          description: Seed created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebSource'
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '404':
          $ref: '#/components/responses/Error404'
        '429':
          $ref: '#/components/responses/Error429'
        '502':
          $ref: '#/components/responses/Error502'
      security:
        - BearerAuth: []
components:
  schemas:
    WebSource:
      type: object
      description: |
        Recurring web crawl seed. A seed is a generator of documents,
        not a document: pages it discovers materialize as
        `knowledge_base.document` rows (`source_type: web_page`,
        `origin: web_source`, `web_source_id` set) deduped in the same
        `source_key` space as manual documents. A seed carries only its
        URL and per-domain `crawler_options` - the engine-global crawl
        settings (`webpages_limit`, `periodicity`, `paused`) live on the
        knowledge base's `crawl_settings` object (one crawler per KB).
      required:
        - id
        - object
        - knowledge_base_id
        - url
        - created_at
      properties:
        id:
          type: string
          pattern: ^seed_[A-Za-z0-9-]+$
          maxLength: 128
        object:
          type: string
          enum:
            - knowledge_base.web_source
        knowledge_base_id:
          type: string
          pattern: ^vs_[A-Za-z0-9-]+$
        url:
          type: string
          format: uri
          description: Seed URL the crawler starts from.
        crawler_options:
          type: object
          additionalProperties: true
          description: |
            Provider-specific crawl configuration passed through to the
            crawler (e.g. include/exclude URL patterns, auth headers,
            render mode). Validated by the crawler, not by this API.
            Projects PER DOMAIN on the store-level crawler: sources on
            the same hostname share these options.
          nullable: true
        last_crawl_at:
          type: integer
          description: |
            Reserved. Currently always `null` - there is no per-seed
            crawl-run ledger yet.
          nullable: true
        next_crawl_at:
          type: integer
          description: |
            Reserved. Currently always `null` (no per-seed scheduled-run
            computation yet).
          nullable: true
        metrics:
          type: object
          description: |
            Per-seed page counts, DB-derived from documents attributed
            to this seed via `parent_web_source_ids` (multi-attribution,
            §F-5). Independent of crawler reachability - these are
            always available even when the crawler is unreachable.
          properties:
            pages_total:
              type: integer
              minimum: 0
            pages_indexed:
              type: integer
              minimum: 0
            pages_failed:
              type: integer
              minimum: 0
            pages_pending:
              type: integer
              minimum: 0
            pages_skipped:
              type: integer
              minimum: 0
              description: Reserved. Currently always `0` (no per-seed "skipped" status).
            last_run_status:
              type: string
              enum:
                - running
                - completed
                - failed
                - partial
                - null
              description: Reserved. Currently always `null` (no per-seed run ledger).
              nullable: true
            last_run_started_at:
              type: integer
              description: Reserved. Currently always `null`.
              nullable: true
            last_run_completed_at:
              type: integer
              description: Reserved. Currently always `null`.
              nullable: true
        created_at:
          type: integer
        updated_at:
          type: integer
    Error:
      type: object
      description: |
        Single error envelope shared by every non-2xx response. `code`
        is the stable machine-readable identifier; `message` is the
        human-readable text; `details` is optional structured context.
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: VALIDATION_ERROR
            message:
              type: string
            details:
              type: object
              additionalProperties: true
      required:
        - error
  responses:
    Error400:
      description: Caller validation failure.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing_source:
              summary: No identifiable source
              value:
                error:
                  code: MISSING_SOURCE
                  message: Provide native_file_id, source_url, or fetch_url.
            conflicting_type:
              summary: source_type conflicts with native_file_id
              value:
                error:
                  code: VALIDATION_ERROR
                  message: >-
                    source_type must be uploaded_file when native_file_id is
                    provided
                  details:
                    field: source_type
    Error401:
      description: Authentication missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthenticated:
              value:
                error:
                  code: UNAUTHENTICATED
                  message: Authentication required.
    Error403:
      description: Authentication present, authorization denied.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            forbidden:
              value:
                error:
                  code: FORBIDDEN
                  message: Caller is not allowed to access this resource.
            hook_rejected:
              summary: An external content hook blocked ingestion (sync)
              value:
                error:
                  code: HOOK_REJECTED
                  message: Content was rejected by a compliance hook.
                  details:
                    rejected_by: hook_pii_filter
                    rejection_reason: detected_unmasked_pii
    Error404:
      description: Resource does not exist or is not visible to the caller.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            not_found:
              value:
                error:
                  code: NOT_FOUND
                  message: knowledge_base.document not found.
                  details:
                    resource: knowledge_base.document
                    id: vsf_unknown
    Error429:
      description: Rate limited.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds the caller should wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error502:
      description: >-
        Upstream provider failure (vector DB, LLM gateway, crawler, native files
        API).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            provider_failure:
              value:
                error:
                  code: PROVIDER_UNAVAILABLE
                  message: Upstream provider returned an error.
                  details:
                    provider: elasticsearch
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        User session JWT or instance API key (`iak_*`). Send as `Authorization:
        Bearer <token>`.
    WorkspaceApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key
      description: Workspace- or knowledge-base-scoped API key.

````