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

# Create Source

`POST /sources`

## Request body

- SourceCreateRequest
  - `type` 'repository' | 'documentation' | 'research_paper' | 'huggingface_dataset' | 'local_folder' | 'slack' | 'google_drive', required
  - `repository` string, nullable
  - `branch` string, nullable
  - `ref` string, nullable
  - `url` string, nullable
  - `url_patterns` string[], nullable
  - `exclude_patterns` string[], nullable
  - `project_id` string, nullable
  - `max_age` integer, nullable
  - `formats` string[], nullable
  - `only_main_content` boolean, nullable
  - `limit` integer, nullable
  - `max_depth` integer, nullable
  - `crawl_entire_domain` boolean, nullable
  - `wait_for` integer, nullable
  - `include_screenshot` boolean, nullable
  - `check_llms_txt` boolean, nullable
  - `llms_txt_strategy` string, nullable
  - `add_as_global_source` boolean, nullable
  - `is_pdf` boolean, nullable
  - `is_spreadsheet` boolean, nullable
  - `display_name` string, nullable
  - `gcs_path` string, nullable
  - `focus_instructions` string, nullable
  - `extract_branding` boolean, nullable
  - `extract_images` boolean, nullable
  - `config` string, nullable
  - `folder_name` string, nullable
  - `folder_path` string, nullable
  - `files` FileItem[], nullable
    - `path` string, required — Relative file path (e.g., 'src/main.py')
    - `content` string, required — File content as UTF-8 string
  - `database` DatabaseFileItem — A database file for upload.
    - `filename` string, required — Original filename (e.g., 'chat.db')
    - `content` string, required — Base64-encoded database file content
  - `slack_installation_id` string, nullable
  - `google_drive_installation_id` string, nullable
  - `google_drive_file_ids` string[], nullable
  - `google_drive_folder_ids` string[], nullable

## Response `200`

Successful Response

- Source — Unified source representation.
  - `id` string, required — Source identifier
  - `type` 'repository' | 'documentation' | 'research_paper' | 'huggingface_dataset' | 'local_folder' | 'slack' | 'google_drive', required — Source type
  - `identifier` string, nullable — Canonical identifier (repo slug, URL, or folder path)
  - `display_name` string, nullable — Human-readable name
  - `status` string, nullable — Indexing status
  - `created_at` string, nullable — Creation timestamp (ISO)
  - `updated_at` string, nullable — Last update timestamp (ISO)
  - `category_id` string, nullable — Category assignment
  - `is_global` boolean, nullable — Whether the source is global/shared
  - `global_source_id` string, nullable — Global source ID if applicable
  - `global_namespace` string, nullable — Global namespace if applicable
  - `metadata` object — Type-specific metadata
  - `curation` SourceCurationSummary — Compact curation info embedded into source responses.
    - `trust_signals` SourceTrustSignals — Trust and curation signals attached to a source.
      - `trust_level` 'low' | 'medium' | 'high' — User or team trust preference for the source
      - `trust_tier` 'low' | 'medium' | 'high' | 'verified' — Effective trust tier after derived verified/global signals
      - `scope` 'private' | 'organization' | 'global' — Ownership scope of the source
      - `is_global` boolean — Whether the source references a shared global source
      - `is_verified` boolean — Whether the source has a Nia-verified overlay
      - `overlay_available` boolean — Whether a curated overlay is attached
      - `annotation_count` integer — Number of saved annotations for this source
    - `overlay_summary` string, nullable — Short overlay summary if one exists
    - `recommended_queries` string[] — Suggested prompts from the overlay

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/nozomio-labs/apis/nia-ai-api.md) · [All operations](https://skmtc.net/nozomio-labs/apis/nia-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nozomio-labs/nia-ai-api/versions/dbb602a3ef17/schema)
