Skip to main content
Context7 MCP

Update teamspace 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.
1 min read
patch/v2/policies
Request example
Response
patch/v2/policies

Authorization

Authorizationstringheaderrequired#
Get your API key at context7.com/dashboard. Treat your API key like a password and store it securely.

Body

application/json
sourceTypesobject#
Enable or disable specific source types. Both can be provided in one request, but the same type cannot appear in both arrays.
Show child attributes
enableenum<string>[]#
Source types to enable
disableenum<string>[]#
Source types to disable
libraryFiltersobject#
Update library access filters.
Show child attributes
modeenum<string>#
Filter mode (null to clear)
Options:qualityselectnull
qualityobject#
Update quality-mode settings.
Show child attributes
requireVerifiedboolean#
Restrict to verified libraries only
minTrustScoreinteger#
Minimum trust score, 0-10 (null to clear)

Range: 0–10

maxAgeDaysinteger#
Maximum age in days (null to clear)

Range: >= 1

blockedLibrariesobject#
Incremental add/remove operation on a list of library identifiers or domains. Use 'clear' to remove all entries at once.
Show child attributes
addstring[]#
Identifiers to add — library paths (e.g. '/org/repo', '/org') or domains (e.g. 'stripe.com')
removestring[]#
Identifiers to remove — library paths (e.g. '/org/repo', '/org') or domains (e.g. 'stripe.com')
clearboolean#
Set to true to remove all entries. Cannot be used together with 'add' or 'remove'.
exceptedLibrariesobject#
Incremental add/remove operation on a list of library identifiers or domains. Use 'clear' to remove all entries at once.
Show child attributes
addstring[]#
Identifiers to add — library paths (e.g. '/org/repo', '/org') or domains (e.g. 'stripe.com')
removestring[]#
Identifiers to remove — library paths (e.g. '/org/repo', '/org') or domains (e.g. 'stripe.com')
clearboolean#
Set to true to remove all entries. Cannot be used together with 'add' or 'remove'.
repoFiltersobject#
Update repo-specific quality filters.
Show child attributes
minStarsinteger#
Minimum stars threshold (null to clear)

Range: >= 0

allowedLicensesobject#
Incremental add/remove operation on a list of SPDX license identifiers. Use 'clear' to remove all entries at once.
Show child attributes
addstring[]#
SPDX license identifiers to add (e.g. 'MIT', 'Apache-2.0', 'BSD-3-Clause')
removestring[]#
SPDX license identifiers to remove
clearboolean#
Set to true to remove all entries. Cannot be used together with 'add' or 'remove'.
websiteFiltersobject#
Update website-specific quality filters.
Show child attributes
minReferringDomainsinteger#
Minimum referring domains threshold (null to clear)

Range: >= 0

minOrganicTrafficinteger#
Minimum organic traffic threshold (null to clear)

Range: >= 0

selectobject#
Update select-mode settings.
Show child attributes
allowedLibrariesobject#
Incremental add/remove operation on a list of library identifiers or domains. Use 'clear' to remove all entries at once.
Show child attributes
addstring[]#
Identifiers to add — library paths (e.g. '/org/repo', '/org') or domains (e.g. 'stripe.com')
removestring[]#
Identifiers to remove — library paths (e.g. '/org/repo', '/org') or domains (e.g. 'stripe.com')
clearboolean#
Set to true to remove all entries. Cannot be used together with 'add' or 'remove'.

Responses

application/json
Updated policy configuration
sourceTypesobjectrequired#
Access settings for each documentation source type
Show child attributes
public_reposobjectrequired#
Whether a source type is enabled or disabled
Show child attributes
enabledbooleanrequired#
Whether this source type is enabled
private_sourcesobjectrequired#
Whether a source type is enabled or disabled
Show child attributes
enabledbooleanrequired#
Whether this source type is enabled
confluenceobjectrequired#
Whether a source type is enabled or disabled
Show child attributes
enabledbooleanrequired#
Whether this source type is enabled
uploaded_filesobjectrequired#
Whether a source type is enabled or disabled
Show child attributes
enabledbooleanrequired#
Whether this source type is enabled
websitesobjectrequired#
Whether a source type is enabled or disabled
Show child attributes
enabledbooleanrequired#
Whether this source type is enabled
llmstxtobjectrequired#
Whether a source type is enabled or disabled
Show child attributes
enabledbooleanrequired#
Whether this source type is enabled
libraryFiltersobjectrequired#
Library access filters. Mode determines which sub-object is active.
Show child attributes
modeenum<string>required#
Filter mode: 'quality' for threshold-based filtering, 'select' for manual library selection
Options:qualityselectnull
qualityobjectrequired#
Quality-mode settings (active when mode is 'quality')
Show child attributes
requireVerifiedbooleanrequired#
Restrict to verified libraries only
minTrustScoreintegerrequired#
Minimum trust score, 0-10
maxAgeDaysintegerrequired#
Maximum days since last update
blockedLibrariesstring[]required#
Libraries excluded from results
exceptedLibrariesstring[]required#
Libraries that bypass all quality filters, blocked list, and source type restrictions
repoFiltersobjectrequired#
Repo-specific quality filters
Show child attributes
minStarsintegerrequired#
Minimum GitHub stars required
allowedLicensesstring[]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.
websiteFiltersobjectrequired#
Website-specific quality filters
Show child attributes
minReferringDomainsintegerrequired#
Minimum number of referring domains required
minOrganicTrafficintegerrequired#
Minimum monthly organic traffic required
selectobjectrequired#
Select-mode settings (active when mode is 'select')
Show child attributes
allowedLibrariesstring[]required#
Libraries explicitly allowed
accessibleLibraryCountintegerrequired#
Number of public libraries currently accessible under these filters