---
title: "Update teamspace policies"
method: PATCH
path: "/v2/policies"
tags: ["Policies"]
---

# Update teamspace policies

`PATCH /v2/policies`

Incrementally update policy configuration for the teamspace associated with the API key. Only the fields you include in the request body are modified — omitted fields remain unchanged. For source types, use `enable`/`disable` arrays (both allowed if no overlap). For library lists, use `add`/`remove` objects or `clear: true` to remove all. Requires owner or admin role. All field names use camelCase.

## Request body

- PatchPoliciesRequest — Incremental policy update. All fields are optional — only provided fields are modified. At least one of 'sourceTypes' or 'libraryFilters' must be provided.
  - `sourceTypes` object — Enable or disable specific source types. Both can be provided in one request, but the same type cannot appear in both arrays.
    - `enable` string[] — Source types to enable
    - `disable` string[] — Source types to disable
  - `libraryFilters` object — Update library access filters.
    - `mode` 'quality' | 'select' | 'null', nullable — Filter mode (null to clear)
    - `quality` object — Update quality-mode settings.
      - `requireVerified` boolean — Restrict to verified libraries only
      - `minTrustScore` integer, nullable — Minimum trust score, 0-10 (null to clear)
      - `maxAgeDays` integer, nullable — Maximum age in days (null to clear)
      - `blockedLibraries` ListOperation — Incremental add/remove operation on a list of library identifiers or domains. Use 'clear' to remove all entries at once.
        - `add` string[] — Identifiers to add — library paths (e.g. '/org/repo', '/org') or domains (e.g. 'stripe.com')
        - `remove` string[] — Identifiers to remove — library paths (e.g. '/org/repo', '/org') or domains (e.g. 'stripe.com')
        - `clear` boolean — Set to true to remove all entries. Cannot be used together with 'add' or 'remove'.
      - `exceptedLibraries` ListOperation — Incremental add/remove operation on a list of library identifiers or domains. Use 'clear' to remove all entries at once.
        - `add` string[] — Identifiers to add — library paths (e.g. '/org/repo', '/org') or domains (e.g. 'stripe.com')
        - `remove` string[] — Identifiers to remove — library paths (e.g. '/org/repo', '/org') or domains (e.g. 'stripe.com')
        - `clear` boolean — Set to true to remove all entries. Cannot be used together with 'add' or 'remove'.
      - `repoFilters` object — Update repo-specific quality filters.
        - `minStars` integer, nullable — Minimum stars threshold (null to clear)
        - `allowedLicenses` LicenseListOperation — Incremental add/remove operation on a list of SPDX license identifiers. Use 'clear' to remove all entries at once.
          - `add` string[] — SPDX license identifiers to add (e.g. 'MIT', 'Apache-2.0', 'BSD-3-Clause')
          - `remove` string[] — SPDX license identifiers to remove
          - `clear` boolean — Set to true to remove all entries. Cannot be used together with 'add' or 'remove'.
      - `websiteFilters` object — Update website-specific quality filters.
        - `minBacklinks` integer, nullable — Minimum backlinks threshold (null to clear)
        - `minReferringDomains` integer, nullable — Minimum referring domains threshold (null to clear)
        - `minOrganicTraffic` integer, nullable — Minimum organic traffic threshold (null to clear)
    - `select` object — Update select-mode settings.
      - `allowedLibraries` ListOperation — Incremental add/remove operation on a list of library identifiers or domains. Use 'clear' to remove all entries at once.
        - `add` string[] — Identifiers to add — library paths (e.g. '/org/repo', '/org') or domains (e.g. 'stripe.com')
        - `remove` string[] — Identifiers to remove — library paths (e.g. '/org/repo', '/org') or domains (e.g. 'stripe.com')
        - `clear` boolean — Set to true to remove all entries. Cannot be used together with 'add' or 'remove'.

## Response `200`

Updated policy configuration

- PolicyResponse — Complete teamspace policy configuration
  - `sourceTypes` object, required — Access settings for each documentation source type
    - `public_repos` SourceTypeStatus, required — Whether a source type is enabled or disabled
      - `enabled` boolean, required — Whether this source type is enabled
    - `private_sources` SourceTypeStatus, required — Whether a source type is enabled or disabled
      - `enabled` boolean, required — Whether this source type is enabled
    - `confluence` SourceTypeStatus, required — Whether a source type is enabled or disabled
      - `enabled` boolean, required — Whether this source type is enabled
    - `uploaded_files` SourceTypeStatus, required — Whether a source type is enabled or disabled
      - `enabled` boolean, required — Whether this source type is enabled
    - `websites` SourceTypeStatus, required — Whether a source type is enabled or disabled
      - `enabled` boolean, required — Whether this source type is enabled
    - `llmstxt` SourceTypeStatus, required — Whether a source type is enabled or disabled
      - `enabled` boolean, required — Whether this source type is enabled
  - `libraryFilters` object, required — Library access filters. Mode determines which sub-object is active.
    - `mode` 'quality' | 'select' | 'null', nullable, required — Filter mode: 'quality' for threshold-based filtering, 'select' for manual library selection
    - `quality` object, required — Quality-mode settings (active when mode is 'quality')
      - `requireVerified` boolean, required — Restrict to verified libraries only
      - `minTrustScore` integer, nullable, required — Minimum trust score, 0-10
      - `maxAgeDays` integer, nullable, required — Maximum days since last update
      - `blockedLibraries` string[], required — Libraries excluded from results
      - `exceptedLibraries` string[], required — Libraries that bypass all quality filters, blocked list, and source type restrictions
      - `repoFilters` object, required — Repo-specific quality filters
        - `minStars` integer, nullable, required — Minimum GitHub stars required
        - `allowedLicenses` string[], required — SPDX license identifiers (e.g. 'MIT', 'Apache-2.0') that are allowed. Empty array means no license restriction. Applies to public repos only; non-repo source types pass through.
      - `websiteFilters` object, required — Website-specific quality filters
        - `minBacklinks` integer, nullable, required — Minimum number of backlinks required
        - `minReferringDomains` integer, nullable, required — Minimum number of referring domains required
        - `minOrganicTraffic` integer, nullable, required — Minimum monthly organic traffic required
    - `select` object, required — Select-mode settings (active when mode is 'select')
      - `allowedLibraries` string[], required — Libraries explicitly allowed
  - `accessibleLibraryCount` integer, required — Number of public libraries currently accessible under these filters

## Other responses

- `400` — Bad Request - Invalid input parameters
- `401` — Unauthorized - Invalid or missing API key
- `403` — Forbidden - Insufficient permissions or plan restrictions
- `404` — Not Found - Resource doesn't exist
- `500` — Internal Server Error

---

[API](https://skmtc.dev/context7/apis/context7-public-api.md) · [All operations](https://skmtc.dev/context7/apis/context7-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/context7/context7-public-api/revisions/5e85fc74bff0/schema)
