---
title: "Create Sources"
method: POST
path: "/knowledge-base/sources"
tags: ["sources"]
---

# Create Sources

`POST /knowledge-base/sources`

## Request

- Base URL: `https://api.anyreach.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.anyreach.ai/knowledge-base/sources`
- Auth: HTTP bearer

Create a new source.

## Headers

- `x-anyreach-org` string, nullable: Organization ID for user PATs (pat_ prefix tokens)

## Request body

- SourceCreateRequestSchema[]
  - `id` string, nullable
  - `name` string, required
  - `domain` string, nullable
  - `type` 'FILE' | 'URL', required
  - `chunking_strategy` ChunkingStrategy, required
    - `method` 'fixed' | 'structure_based', required
    - `chunk_size` integer, nullable
  - `file_processor` 'pymupdf'
  - `url_crawl_options` CrawlOptions
    - `limit` integer, nullable
    - `max_depth` integer, nullable
    - `max_discovery_depth` integer, nullable
    - `include_paths` string[], nullable
    - `exclude_paths` string[], nullable
    - `add_to_datasets` string[], nullable
    - `crawler_provider` 'firecrawl' | 'crawl4ai'
  - `file_size` integer, nullable

## Response `200`

Successful Response

- SourceCreateResponseSchema[]
  - `id` string, uuid, required
  - `organization_id` string, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `created_by` string, nullable
  - `modified_by` string, nullable
  - `type` 'FILE' | 'URL', required
  - `name` string, required
  - `domain` string, nullable
  - `file_upload_status` 'PENDING' | 'IN_PROGRESS' | 'COMPLETE' | 'FAILED', required
  - `chunking_strategy` ChunkingStrategy, required
    - `method` 'fixed' | 'structure_based', required
    - `chunk_size` integer, nullable
  - `file_processor` 'pymupdf'
  - `file_size` integer, nullable
  - `description` string, nullable
  - `presigned_url` string, nullable
  - `content_type` string, nullable

## Other responses

- `404`: Not found
- `422`: Validation Error

---

[API](https://skmtc.dev/anyreach/apis/anyreach-api.md) - [All operations](https://skmtc.dev/anyreach/apis/anyreach-api/llms.txt) - [OpenAPI document](https://skmtc.dev/anyreach/apis/anyreach-api/revisions/2eddf40c8c93?raw)
