curl --request PATCH \
--url https://context7.com/api/v2/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceTypes": {
"disable": [
"websites"
]
}
}
'{
"sourceTypes": {
"public_repos": {
"enabled": true
},
"private_sources": {
"enabled": true
},
"confluence": {
"enabled": true
},
"uploaded_files": {
"enabled": true
},
"websites": {
"enabled": true
},
"llmstxt": {
"enabled": true
},
"notion": {
"enabled": true
},
"google_drive": {
"enabled": true
}
},
"libraryFilters": {
"mode": "quality",
"quality": {
"requireVerified": true,
"minTrustScore": 123,
"maxAgeDays": 123,
"blockedLibraries": [
"<string>"
],
"exceptedLibraries": [
"<string>"
],
"repoFilters": {
"minStars": 123,
"allowedLicenses": [
"<string>"
]
},
"websiteFilters": {
"minBacklinks": 123,
"minReferringDomains": 123,
"minOrganicTraffic": 123
}
},
"select": {
"allowedLibraries": [
"<string>"
]
}
},
"accessibleLibraryCount": 123
}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. With dryRun: true nothing is saved; the response shows the policies the patch would give, accessibleLibraryCount after the change, and currentAccessibleLibraryCount before it.
curl --request PATCH \
--url https://context7.com/api/v2/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceTypes": {
"disable": [
"websites"
]
}
}
'{
"sourceTypes": {
"public_repos": {
"enabled": true
},
"private_sources": {
"enabled": true
},
"confluence": {
"enabled": true
},
"uploaded_files": {
"enabled": true
},
"websites": {
"enabled": true
},
"llmstxt": {
"enabled": true
},
"notion": {
"enabled": true
},
"google_drive": {
"enabled": true
}
},
"libraryFilters": {
"mode": "quality",
"quality": {
"requireVerified": true,
"minTrustScore": 123,
"maxAgeDays": 123,
"blockedLibraries": [
"<string>"
],
"exceptedLibraries": [
"<string>"
],
"repoFilters": {
"minStars": 123,
"allowedLicenses": [
"<string>"
]
},
"websiteFilters": {
"minBacklinks": 123,
"minReferringDomains": 123,
"minOrganicTraffic": 123
}
},
"select": {
"allowedLibraries": [
"<string>"
]
}
},
"accessibleLibraryCount": 123
}Authorizations
Get your API key at context7.com/dashboard. Treat your API key like a password and store it securely. Every key can read the management API (/v2/teamspaces/*), except personal data: member and invitation emails, library requesters, visitor questions, Docs7 reader searches, conversations, feedback and feature requests, and the GitHub account behind a build. To read those or make changes there, the key must be created with Write access ticked; other keys get 403 write_access_required. A teamspace can limit API keys to owners and admins, or turn them off for OAuth only; a key that its teamspace's policy refuses gets 403 api_key_admins_only or api_keys_disabled.
Body
Incremental policy update. All fields are optional — only provided fields are modified. At least one of 'sourceTypes' or 'libraryFilters' must be provided.
Response
Updated policy configuration
- Option 1
- Option 2
Complete teamspace policy configuration
Was this page helpful?