---
title: "Update a collection"
method: PATCH
path: "/webdbs/collections/{collection_id}"
tags: ["webdbs"]
---

# Update a collection

`PATCH /webdbs/collections/{collection_id}`

Changes collection settings. New extraction rules apply on future syncs.

## Path parameters

- `collection_id` string, required — Collection ID.

## Request body

- WebdbsUpdateCollectionRequest — Fields to update on a WebDB collection.
  - `name` string — Collection name.
  - `description` string — Optional collection description.
  - `schema` WebdbsSchema — JSON Schema for the fields extracted into each row. Zod users can pass the output of z.toJSONSchema().
  - `eligibility` object — Rules for deciding which pages become rows.
    - `prefilter` object — Fast URL and text checks.
      - `url_match` string[] — URL patterns a page must match. Supports exact URLs, `*`, `**`, and `:name` path values.
      - `must_contain_any` string[] — Text where at least one value must appear.
      - `must_not_contain` string[] — Text values that must not appear.
    - `semantic` object — AI check for whether a page should become a row.
      - `condition` string, required — Plain-language rule a page must satisfy.
      - `min_score` number — Minimum matching score from 0 to 1. Defaults to 0.7.
  - `targets` WebdbsTarget[] — Complete replacement list of collection targets.
    - union — Source that provides pages for a collection.
      - WebdbsUrlTarget — Fetches exactly one page.
        - `type` 'url', required — Fetch one URL.
        - `seeds` string[], required — URL to fetch.
        - `id` string — Stable target ID. Omit it when adding a target.
        - `sync` object — Schedule for this target.
          - `every` string, required — Sync interval such as `6h`, or a five-field cron expression.
          - `mode` 'incremental' | 'full' — Use `incremental` for changed pages or `full` for every page.
        - `eligibility` object — Extra eligibility rules for this target.
          - `prefilter` object — Fast URL and text checks.
            - `url_match` string[] — URL patterns a page must match. Supports exact URLs, `*`, `**`, and `:name` path values.
            - `must_contain_any` string[] — Text where at least one value must appear.
            - `must_not_contain` string[] — Text values that must not appear.
          - `semantic` object — AI check for whether a page should become a row.
            - `condition` string, required — Plain-language rule a page must satisfy.
            - `min_score` number — Minimum matching score from 0 to 1. Defaults to 0.7.
        - `crawl_options` object — Optional page loading settings.
      - WebdbsUrlListTarget — Fetches a fixed set of pages.
        - `type` 'url_list', required — Fetch a fixed list of URLs.
        - `seeds` string[], required — URLs to fetch. Maximum 10000.
        - `id` string — Stable target ID. Omit it when adding a target.
        - `sync` object — Schedule for this target.
          - `every` string, required — Sync interval such as `6h`, or a five-field cron expression.
          - `mode` 'incremental' | 'full' — Use `incremental` for changed pages or `full` for every page.
        - `eligibility` object — Extra eligibility rules for this target.
          - `prefilter` object — Fast URL and text checks.
            - `url_match` string[] — URL patterns a page must match. Supports exact URLs, `*`, `**`, and `:name` path values.
            - `must_contain_any` string[] — Text where at least one value must appear.
            - `must_not_contain` string[] — Text values that must not appear.
          - `semantic` object — AI check for whether a page should become a row.
            - `condition` string, required — Plain-language rule a page must satisfy.
            - `min_score` number — Minimum matching score from 0 to 1. Defaults to 0.7.
        - `crawl_options` object — Optional page loading settings.
      - WebdbsSitemapTarget — Expands sitemap URLs into pages.
        - `type` 'sitemap', required — Discover URLs from sitemaps.
        - `seeds` string[], required — Sitemap URLs to read. Maximum 10.
        - `ingest` object — Rules for choosing pages to save as rows.
          - `match` string[], required — URL patterns for pages that become rows. Supports exact URLs, `*`, `**`, and `:name` path values.
        - `id` string — Stable target ID. Omit it when adding a target.
        - `sync` object — Schedule for this target.
          - `every` string, required — Sync interval such as `6h`, or a five-field cron expression.
          - `mode` 'incremental' | 'full' — Use `incremental` for changed pages or `full` for every page.
        - `eligibility` object — Extra eligibility rules for this target.
          - `prefilter` object — Fast URL and text checks.
            - `url_match` string[] — URL patterns a page must match. Supports exact URLs, `*`, `**`, and `:name` path values.
            - `must_contain_any` string[] — Text where at least one value must appear.
            - `must_not_contain` string[] — Text values that must not appear.
          - `semantic` object — AI check for whether a page should become a row.
            - `condition` string, required — Plain-language rule a page must satisfy.
            - `min_score` number — Minimum matching score from 0 to 1. Defaults to 0.7.
        - `crawl_options` object — Optional page loading settings.
        - `max_pages` integer — Maximum pages processed for this target per sync.
      - WebdbsCrawlTarget — Crawls a site and saves matching pages as rows.
        - `type` 'crawl', required — Crawl links from starting URLs.
        - `seeds` string[], required — URLs where the crawl starts. Maximum 100.
        - `follow` object — Rules for which links the crawl follows.
          - `match` string[], required — URL patterns for links to follow. Supports exact URLs, `*`, `**`, and `:name` path values.
          - `max_depth` integer — Maximum link depth from each starting URL.
        - `ingest` object, required — Rules for choosing pages to save as rows.
          - `match` string[], required — URL patterns for pages that become rows. Supports exact URLs, `*`, `**`, and `:name` path values.
        - `id` string — Stable target ID. Omit it when adding a target.
        - `sync` object — Schedule for this target.
          - `every` string, required — Sync interval such as `6h`, or a five-field cron expression.
          - `mode` 'incremental' | 'full' — Use `incremental` for changed pages or `full` for every page.
        - `eligibility` object — Extra eligibility rules for this target.
          - `prefilter` object — Fast URL and text checks.
            - `url_match` string[] — URL patterns a page must match. Supports exact URLs, `*`, `**`, and `:name` path values.
            - `must_contain_any` string[] — Text where at least one value must appear.
            - `must_not_contain` string[] — Text values that must not appear.
          - `semantic` object — AI check for whether a page should become a row.
            - `condition` string, required — Plain-language rule a page must satisfy.
            - `min_score` number — Minimum matching score from 0 to 1. Defaults to 0.7.
        - `crawl_options` object — Optional page loading settings.
        - `max_pages` integer — Maximum pages processed for this target per sync.
  - `sync` object — Collection sync schedule.
    - `every` string, required — Sync interval such as `6h`, or a five-field cron expression.
    - `mode` 'incremental' | 'full' — Use `incremental` for changed pages or `full` for every page.
  - `change_tracking` object — Row change history settings.
    - `enabled` boolean, required — Whether to record row changes.
    - `granularity` 'field' — Records changes for each field.
    - `retention` string — How long to keep row changes, such as `90d`.
  - `budgets` object — Optional collection spending limits.
    - `credits` integer — Maximum credits this collection can use.
  - `on_disappear` 'soft_delete' | 'hard_delete' | 'keep' — Action for rows whose source page disappears or becomes ineligible.
  - `stale_after` integer — Missed syncs before a row becomes stale.
  - `status` 'active' | 'paused' — Pause or resume syncing.
  - `tags` string[] — Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.

## Response `200`

Updated collection

- object — A table of structured data kept up to date from web pages.
  - `id` string, required — Collection ID.
  - `name` string, required — Collection name.
  - `description` string, nullable — Optional collection description.
  - `schema` WebdbsSchema, required — JSON Schema for the fields extracted into each row. Zod users can pass the output of z.toJSONSchema().
  - `eligibility` WebdbsEligibility, required — Rules that decide whether a page becomes a row.
    - `prefilter` object — Fast URL and text checks.
      - `url_match` string[] — URL patterns a page must match. Supports exact URLs, `*`, `**`, and `:name` path values.
      - `must_contain_any` string[] — Text where at least one value must appear.
      - `must_not_contain` string[] — Text values that must not appear.
    - `semantic` object — AI check for whether a page should become a row.
      - `condition` string, required — Plain-language rule a page must satisfy.
      - `min_score` number — Minimum matching score from 0 to 1. Defaults to 0.7.
  - `targets` WebdbsTarget[], required — Sources that provide pages for this collection.
    - union — Source that provides pages for a collection.
      - WebdbsUrlTarget — Fetches exactly one page.
        - `type` 'url', required — Fetch one URL.
        - `seeds` string[], required — URL to fetch.
        - `id` string — Stable target ID. Omit it when adding a target.
        - `sync` object — Schedule for this target.
          - `every` string, required — Sync interval such as `6h`, or a five-field cron expression.
          - `mode` 'incremental' | 'full' — Use `incremental` for changed pages or `full` for every page.
        - `eligibility` object — Extra eligibility rules for this target.
          - `prefilter` object — Fast URL and text checks.
            - `url_match` string[] — URL patterns a page must match. Supports exact URLs, `*`, `**`, and `:name` path values.
            - `must_contain_any` string[] — Text where at least one value must appear.
            - `must_not_contain` string[] — Text values that must not appear.
          - `semantic` object — AI check for whether a page should become a row.
            - `condition` string, required — Plain-language rule a page must satisfy.
            - `min_score` number — Minimum matching score from 0 to 1. Defaults to 0.7.
        - `crawl_options` object — Optional page loading settings.
      - WebdbsUrlListTarget — Fetches a fixed set of pages.
        - `type` 'url_list', required — Fetch a fixed list of URLs.
        - `seeds` string[], required — URLs to fetch. Maximum 10000.
        - `id` string — Stable target ID. Omit it when adding a target.
        - `sync` object — Schedule for this target.
          - `every` string, required — Sync interval such as `6h`, or a five-field cron expression.
          - `mode` 'incremental' | 'full' — Use `incremental` for changed pages or `full` for every page.
        - `eligibility` object — Extra eligibility rules for this target.
          - `prefilter` object — Fast URL and text checks.
            - `url_match` string[] — URL patterns a page must match. Supports exact URLs, `*`, `**`, and `:name` path values.
            - `must_contain_any` string[] — Text where at least one value must appear.
            - `must_not_contain` string[] — Text values that must not appear.
          - `semantic` object — AI check for whether a page should become a row.
            - `condition` string, required — Plain-language rule a page must satisfy.
            - `min_score` number — Minimum matching score from 0 to 1. Defaults to 0.7.
        - `crawl_options` object — Optional page loading settings.
      - WebdbsSitemapTarget — Expands sitemap URLs into pages.
        - `type` 'sitemap', required — Discover URLs from sitemaps.
        - `seeds` string[], required — Sitemap URLs to read. Maximum 10.
        - `ingest` object — Rules for choosing pages to save as rows.
          - `match` string[], required — URL patterns for pages that become rows. Supports exact URLs, `*`, `**`, and `:name` path values.
        - `id` string — Stable target ID. Omit it when adding a target.
        - `sync` object — Schedule for this target.
          - `every` string, required — Sync interval such as `6h`, or a five-field cron expression.
          - `mode` 'incremental' | 'full' — Use `incremental` for changed pages or `full` for every page.
        - `eligibility` object — Extra eligibility rules for this target.
          - `prefilter` object — Fast URL and text checks.
            - `url_match` string[] — URL patterns a page must match. Supports exact URLs, `*`, `**`, and `:name` path values.
            - `must_contain_any` string[] — Text where at least one value must appear.
            - `must_not_contain` string[] — Text values that must not appear.
          - `semantic` object — AI check for whether a page should become a row.
            - `condition` string, required — Plain-language rule a page must satisfy.
            - `min_score` number — Minimum matching score from 0 to 1. Defaults to 0.7.
        - `crawl_options` object — Optional page loading settings.
        - `max_pages` integer — Maximum pages processed for this target per sync.
      - WebdbsCrawlTarget — Crawls a site and saves matching pages as rows.
        - `type` 'crawl', required — Crawl links from starting URLs.
        - `seeds` string[], required — URLs where the crawl starts. Maximum 100.
        - `follow` object — Rules for which links the crawl follows.
          - `match` string[], required — URL patterns for links to follow. Supports exact URLs, `*`, `**`, and `:name` path values.
          - `max_depth` integer — Maximum link depth from each starting URL.
        - `ingest` object, required — Rules for choosing pages to save as rows.
          - `match` string[], required — URL patterns for pages that become rows. Supports exact URLs, `*`, `**`, and `:name` path values.
        - `id` string — Stable target ID. Omit it when adding a target.
        - `sync` object — Schedule for this target.
          - `every` string, required — Sync interval such as `6h`, or a five-field cron expression.
          - `mode` 'incremental' | 'full' — Use `incremental` for changed pages or `full` for every page.
        - `eligibility` object — Extra eligibility rules for this target.
          - `prefilter` object — Fast URL and text checks.
            - `url_match` string[] — URL patterns a page must match. Supports exact URLs, `*`, `**`, and `:name` path values.
            - `must_contain_any` string[] — Text where at least one value must appear.
            - `must_not_contain` string[] — Text values that must not appear.
          - `semantic` object — AI check for whether a page should become a row.
            - `condition` string, required — Plain-language rule a page must satisfy.
            - `min_score` number — Minimum matching score from 0 to 1. Defaults to 0.7.
        - `crawl_options` object — Optional page loading settings.
        - `max_pages` integer — Maximum pages processed for this target per sync.
  - `sync` object, required — Collection sync schedule.
    - `every` string, required — Sync interval such as `6h`, or a five-field cron expression.
    - `mode` 'incremental' | 'full' — Use `incremental` for changed pages or `full` for every page.
  - `change_tracking` object, required — Row change history settings.
    - `enabled` boolean, required — Whether to record row changes.
    - `granularity` 'field' — Records changes for each field.
    - `retention` string — How long to keep row changes, such as `90d`.
  - `budgets` WebdbsBudgets, required — Optional spending limits for a collection.
    - `credits` integer — Maximum credits this collection can use.
  - `on_disappear` 'soft_delete' | 'hard_delete' | 'keep', required — Action when a source page disappears or becomes ineligible.
  - `stale_after` integer, required — Missed syncs before a row becomes stale.
  - `status` 'active' | 'paused' | 'failed', required — Current collection status.
  - `next_sync_at` string, date-time, nullable, required — Next scheduled sync time.
  - `last_run_at` string, date-time, nullable, required — Time the latest run started.
  - `last_error` WebdbsRunError, required — Error reported by a collection run.
    - `code` string, required — Machine-readable error code.
    - `message` string, required — Human-readable error message.
  - `row_count` integer, required — Current number of rows.
  - `credits_consumed_total` integer, required — Total credits used by this collection.
  - `sync_count` integer, required — Number of completed syncs.
  - `created_at` string, date-time, required — Time the collection was created.
  - `updated_at` string, date-time, required — Time the collection was last updated.
  - `key_metadata` KeyMetadata — Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.
    - `credits_consumed` integer, required — The number of credits consumed by this request.
    - `credits_remaining` integer, required — The number of credits remaining for your organization after this request.

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Not found

---

[API](https://skmtc.net/context/apis/context-dev.md) · [All operations](https://skmtc.net/context/apis/context-dev/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/context/context-dev/versions/3c6a01ba967f/schema)
