---
title: "Update Source Route"
method: PUT
path: "/api/knowledge_bases/{knowledge_base_id}/sources/{source_id}"
tags: ["source"]
---

# Update Source Route

`PUT /api/knowledge_bases/{knowledge_base_id}/sources/{source_id}`

Update a source by ID.

## Path parameters

- `knowledge_base_id` string, uuid, required
- `source_id` string, uuid, required

## Query parameters

- `sync` boolean

## Request body

- SourceUpdateInput
  - `name` string, required
  - `description` string, required
  - `source_params` union, required
    - WebV0Params — Parameters for web v0 sources.
      - `name` 'web_v0'
      - `urls` string[], required — List of URLs to crawl.
      - `include_regex` string, nullable — Regex pattern to include URLs that match the pattern.
      - `exclude_regex` string, nullable — Regex pattern to exclude URLs that match the pattern.
      - `max_depth` integer — Maximum depth of pages to crawl relative to the root URL.
      - `ignore_sitemap` boolean — Whether to ignore the website sitemap when crawling.
      - `limit` integer — Maximum number of pages to crawl per URL.
      - `allow_backward_links` boolean — Whether to allow the crawler to navigate backwards from the given URL.
      - `allow_external_links` boolean — Whether to allow the crawler to follow links to external websites.
      - `scrape_options` WebV0ScrapeOptions — Web v0 scrape options.
        - `headers` object — HTTP headers to send with each request. Can be used to send cookies, user-agent, etc.
        - `only_main_content` boolean — Whether to only scrape the main content of the page (excluding headers, navs, footers, etc.).
        - `wait_for` integer — Amount of time (in milliseconds) to wait for each page to load before scraping content.
    - NotionV0Params — Parameters for Notion sources.
      - `name` 'notion_v0'
      - `integration_id` string, uuid, required
      - `limit` integer, nullable
      - `max_age_days` integer
    - S3PublicV0Params — Parameters for S3 public sources.
      - `name` 's3_public_v0'
      - `bucket_name` string, required
      - `prefix` string, required
      - `limit` integer, required
    - S3PrivateV0Params — Parameters for S3 private sources.
      - `name` 's3_private_v0'
      - `integration_id` string, uuid, required
      - `bucket_name` string, required
      - `prefix` string, required
      - `limit` integer, required
  - `source_schedule` SourceSchedule, required — Source schedule model.
    - `cron` string, required
    - `utc_offset` integer, required

## Response `200`

Successful Response

- Source — Source model.
  - `name` string, required
  - `knowledge_base_id` string, uuid, required
  - `description` string, required
  - `source_params` union, required
    - WebV0Params — Parameters for web v0 sources.
      - `name` 'web_v0'
      - `urls` string[], required — List of URLs to crawl.
      - `include_regex` string, nullable — Regex pattern to include URLs that match the pattern.
      - `exclude_regex` string, nullable — Regex pattern to exclude URLs that match the pattern.
      - `max_depth` integer — Maximum depth of pages to crawl relative to the root URL.
      - `ignore_sitemap` boolean — Whether to ignore the website sitemap when crawling.
      - `limit` integer — Maximum number of pages to crawl per URL.
      - `allow_backward_links` boolean — Whether to allow the crawler to navigate backwards from the given URL.
      - `allow_external_links` boolean — Whether to allow the crawler to follow links to external websites.
      - `scrape_options` WebV0ScrapeOptions — Web v0 scrape options.
        - `headers` object — HTTP headers to send with each request. Can be used to send cookies, user-agent, etc.
        - `only_main_content` boolean — Whether to only scrape the main content of the page (excluding headers, navs, footers, etc.).
        - `wait_for` integer — Amount of time (in milliseconds) to wait for each page to load before scraping content.
    - NotionV0Params — Parameters for Notion sources.
      - `name` 'notion_v0'
      - `integration_id` string, uuid, required
      - `limit` integer, nullable
      - `max_age_days` integer
    - S3PublicV0Params — Parameters for S3 public sources.
      - `name` 's3_public_v0'
      - `bucket_name` string, required
      - `prefix` string, required
      - `limit` integer, required
    - S3PrivateV0Params — Parameters for S3 private sources.
      - `name` 's3_private_v0'
      - `integration_id` string, uuid, required
      - `bucket_name` string, required
      - `prefix` string, required
      - `limit` integer, required
  - `source_schedule` SourceSchedule, required — Source schedule model.
    - `cron` string, required
    - `utc_offset` integer, required
  - `id` string, uuid, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `deleted_at` string, date-time, nullable, required
  - `status` 'pending' | 'syncing' | 'synced' | 'failed', required — Source status enum.
  - `progress` SourceProgress — Source progress model.
    - `load` StepProgress — Step progress model.
      - `processed_documents` integer, nullable
      - `result_documents` integer, nullable
      - `processed_nodes` integer, nullable
      - `result_nodes` integer, nullable
    - `curate` object, nullable
    - `transform` object, nullable
    - `complete` StepProgress — Step progress model.
      - `processed_documents` integer, nullable
      - `result_documents` integer, nullable
      - `processed_nodes` integer, nullable
      - `result_nodes` integer, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2025-08-05** `9e6009a931b6` — 2 info
  - added the new optional request property `source_params/oneOf[subschema #2: NotionV0Params]/max_age_days`
  - added the optional property `source_params/oneOf[subschema #2: NotionV0Params]/max_age_days` to the response with the `200` status
- **2024-12-18** `3ae3cc19d925` — 1 breaking
  - the `source_params/oneOf[subschema #1: WebV0Params]/urls` request property's minItems was increased to `1`
- **2024-12-13** `a5e85dccbbe3` — 1 info
  - added the optional property `progress` to the response with the `200` status
- **2024-12-05** `df1d1cc9e050` — 4 breaking, 10 info
  - removed the enum value `notion_v0` of the request property `source_params/oneOf[subschema #2: NotionV0Params]/name`
  - removed the enum value `s3_private_v0` of the request property `source_params/oneOf[subschema #4: S3PrivateV0Params]/name`
  - removed the enum value `s3_public_v0` of the request property `source_params/oneOf[subschema #3: S3PublicV0Params]/name`
  - removed the enum value `web_v0` of the request property `source_params/oneOf[subschema #1: WebV0Params]/name`
  - …10 more
- …earlier changes not shown

[Full history](https://skmtc.dev/cleanlab/apis/agility/changes/api/knowledge_bases/:knowledge_base_id/sources/:source_id/put.md)

---

[API](https://skmtc.dev/cleanlab/apis/agility.md) · [All operations](https://skmtc.dev/cleanlab/apis/agility/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cleanlab/agility/revisions/9e6009a931b6/schema)
