---
title: "Save Collection Config"
method: POST
path: "/api/kb/collections/{collection}/config"
tags: ["kb"]
---

# Save Collection Config

`POST /api/kb/collections/{collection}/config`

Save ingestion configuration for a specific collection.

## Path parameters

- `collection` string, required

## Request body

- IngestionConfig — Configuration values for the document ingestion pipeline.
  - `deepdoc_processing_mode` string, nullable — DeepDoc processing mode (e.g., 'pipeline', 'default').
  - `deepdoc_parallel_threads` integer, nullable — DeepDoc parallel threads (DEEPDOC_PARALLEL_THREADS).
  - `deepdoc_reserve_cpu` integer, nullable — DeepDoc reserved CPU cores (DEEPDOC_RESERVE_CPU).
  - `deepdoc_limiter_capacity` integer, nullable — DeepDoc CapacityLimiter capacity (DEEPDOC_LIMITER_CAPACITY).
  - `deepdoc_pipeline_monitor` boolean, nullable — Enable DeepDoc pipeline monitor (DEEPDOC_PIPELINE_MONITOR).
  - `deepdoc_pipeline_s1_workers` integer, nullable — DeepDoc S1 worker count (DEEPDOC_PIPELINE_S1_WORKERS).
  - `deepdoc_gpu_sessions` integer, nullable — DeepDoc GPU sessions count/preference (DEEPDOC_GPU_SESSIONS).
  - `embedding_base_url` string, nullable — Override DashScope base URL for embedding requests.
  - `embedding_api_key` string, nullable — Override DashScope API key for embedding requests.
  - `embedding_timeout_sec` number, nullable — Override embedding request timeout (seconds).
  - `rerank_model_id` string, nullable — Bound rerank model ID for this collection (user-scoped).
  - `parse_method` 'default' | 'pypdf' | 'pdfplumber' | 'unstructured' | 'pymupdf' | 'deepdoc' — Available parsing methods
  - `chunk_strategy` 'recursive' | 'fixed_size' | 'markdown' — Available chunk strategies
  - `chunk_method` string, nullable — Custom chunk method identifier. If provided, takes precedence over chunk_strategy
  - `chunk_size` integer, nullable — Chunk size passed to chunk_document; must be a positive integer. If None, semantic splitting is used without size limits.
  - `chunk_overlap` integer — Chunk overlap passed to chunk_document; must be non-negative
  - `headers_to_split_on` array[], nullable — Markdown headers split rules for markdown strategy
    - unknown[]
      - unknown
  - `separators` string[], nullable — Custom separators for recursive/markdown strategies
  - `use_token_count` boolean — If True, chunk_size and chunk_overlap are in tokens (tiktoken); only applies to RECURSIVE strategy
  - `tiktoken_encoding` string — tiktoken encoding name when use_token_count=True (e.g. cl100k_base for GPT-4/3.5). Should align with config.DEFAULT_TIKTOKEN_ENCODING.
  - `enable_protected_content` boolean — If True, do not split inside code blocks, formulas, tables (P1).
  - `protected_patterns` string[], nullable — Optional regex patterns for protected regions; None uses config default.
  - `table_context_size` integer — Chars from prev/next chunk to attach to table chunks; 0 = off (P2).
  - `image_context_size` integer — Chars from prev/next chunk to attach to image chunks; 0 = off (P2).
  - `embedding_model_id` string, nullable — Embedding model identifier registered in AgentOS model hub. If omitted, the pipeline attempts to auto-detect a single available embedding model.
  - `collection_locked` boolean — Whether to lock collection configuration. When True, enforces strict config validation.
  - `allow_mixed_parse_methods` boolean — Whether to allow mixed parse methods within the collection. When False, enforces type-based parse method consistency.
  - `skip_config_validation` boolean — Skip collection configuration validation. Use with caution.
  - `embedding_batch_size` integer — Batch size for embedding provider requests; must be positive
  - `embedding_concurrent` integer — Maximum concurrent requests for embedding computation when using async mode (for models that don't support batch processing, e.g., text-embedding-v4). Must be positive. Adjust based on machine configuration and API rate limits.
  - `embedding_use_async` boolean — Whether to use async concurrent processing for embeddings. Set to True for models that don't support batch processing (e.g., text-embedding-v4). When True, embeddings are processed concurrently using asyncio instead of batch API calls.
  - `max_retries` integer — Maximum number of retries for embedding provider failures; must be non-negative
  - `retry_delay` number — Delay in seconds between embedding retries; must be non-negative

## Response `200`

Successful Response

- CollectionOperationResult — Response payload for collection-level management operations.
  - `status` string, required — Operation status: success|partial_success|error
  - `collection` string, required — Collection identifier affected by the operation
  - `message` string, required — Human-readable summary of the collection operation
  - `warnings` string[] — Non-fatal issues encountered while processing the collection
  - `affected_documents` CollectionOperationDetail[] — Subset of documents impacted by the collection operation
    - `doc_id` string, required — Document identifier affected by the operation
    - `status` 'pending' | 'running' | 'chunked' | 'partially_embedded' | 'success' | 'failed' | 'cancelled', required — States representing document ingestion lifecycle.
    - `message` string, nullable — Optional message describing individual document handling
  - `deleted_counts` object — Aggregated deletion counts per table when applicable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/xorbitsai/apis/xagent.md) · [All operations](https://skmtc.net/xorbitsai/apis/xagent/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xorbitsai/xagent/revisions/33e4ba4936ad/schema)
