{ "openapi": "3.0.0", "info": { "title": "Context7 Public API", "description": "The Context7 Public API provides programmatic access to library documentation and search functionality. Get up-to-date documentation and code examples for any library.", "version": "2.0.0", "contact": { "name": "Context7 Support", "url": "https://context7.com", "email": "support@context7.com" } }, "servers": [ { "url": "https://context7.com/api", "description": "Production server" } ], "paths": { "/v2/libs/search": { "get": { "summary": "Search for libraries", "description": "Search for libraries by name with intelligent LLM-powered ranking based on your query context.", "operationId": "searchLibraries", "tags": [ "Search" ], "parameters": [ { "$ref": "#/components/parameters/LibraryNameParam" }, { "$ref": "#/components/parameters/QueryParam" }, { "$ref": "#/components/parameters/FastParam" } ], "responses": { "200": { "description": "Search results ranked by relevance", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SearchResponse" }, "example": { "results": [ { "id": "/facebook/react", "title": "React", "description": "A JavaScript library for building user interfaces", "branch": "main", "lastUpdateDate": "2025-01-15T10:30:00.000Z", "state": "finalized", "totalTokens": 500000, "totalSnippets": 2500, "stars": 220000, "trustScore": 10, "benchmarkScore": 95.5, "versions": [ "v18.2.0", "v17.0.2" ] } ], "searchFilterApplied": false } } } }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "402": { "$ref": "#/components/responses/SpendingLimitError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "429": { "$ref": "#/components/responses/RateLimitError" }, "500": { "$ref": "#/components/responses/InternalServerError" }, "503": { "$ref": "#/components/responses/ServiceUnavailableError" } }, "security": [ {}, { "bearerAuth": [] } ] } }, "/v2/libs/metrics": { "get": { "summary": "Get library usage metrics", "description": "Retrieve full usage metrics for a library: cumulative and daily request counters broken down by surface (web page, text docs, MCP, CLI), MCP client daily unique-user breakdown, and lifetime topic and country distributions. The API key must belong to a member of the teamspace that owns the library — claim ownership from the library's admin page on context7.com.", "operationId": "getLibraryMetrics", "tags": [ "Metrics" ], "parameters": [ { "$ref": "#/components/parameters/LibraryIdParam" }, { "$ref": "#/components/parameters/DaysParam" } ], "responses": { "200": { "description": "Library usage metrics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LibraryMetricsResponse" }, "example": { "total": { "page": 12450, "txt": 3820, "mcp": 95210, "cli": 1240 }, "daily": [ { "date": "2025-01-14", "page": 8, "txt": 3, "mcp": 42, "cli": 1, "total": 54 }, { "date": "2025-01-15", "page": 11, "txt": 5, "mcp": 67, "cli": 0, "total": 83 } ], "mcpClients": { "dailyData": [ { "date": "2025-01-14", "uniqueUsersByClient": { "cursor": 12, "claude-code": 7 }, "totalUniqueUsers": 18 }, { "date": "2025-01-15", "uniqueUsersByClient": { "cursor": 15, "claude-code": 9, "windsurf": 2 }, "totalUniqueUsers": 25 } ] }, "topics": [ { "topic": "routing", "count": 420 }, { "topic": "middleware", "count": 312 }, { "topic": "app-router", "count": 187 } ], "countries": [ { "country": "US", "count": 3120 }, { "country": "DE", "count": 842 }, { "country": "IN", "count": 610 } ] } } } }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/ForbiddenError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } }, "security": [ { "bearerAuth": [] } ] } }, "/v2/context": { "get": { "summary": "Get documentation context", "description": "Retrieve intelligent, LLM-reranked documentation context for natural language queries. Returns the most relevant code snippets and documentation for your specific question.", "operationId": "getContext", "tags": [ "Context" ], "parameters": [ { "$ref": "#/components/parameters/LibraryIdParam" }, { "$ref": "#/components/parameters/QueryParam" }, { "$ref": "#/components/parameters/TypeParam" }, { "$ref": "#/components/parameters/FastParam" } ], "responses": { "200": { "description": "Documentation context", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ContextResponse" }, "example": { "codeSnippets": [ { "codeTitle": "Middleware Authentication Example", "codeDescription": "Shows how to implement authentication checks in Next.js middleware", "codeLanguage": "typescript", "codeTokens": 150, "codeId": "https://github.com/vercel/next.js/blob/canary/docs/middleware.mdx#_snippet_0", "pageTitle": "Middleware", "codeList": [ { "language": "typescript", "code": "import { NextResponse } from 'next/server'\nimport type { NextRequest } from 'next/server'\n\nexport function middleware(request: NextRequest) {\n const token = request.cookies.get('token')\n if (!token) {\n return NextResponse.redirect(new URL('/login', request.url))\n }\n return NextResponse.next()\n}" } ] } ], "infoSnippets": [ { "pageId": "https://github.com/vercel/next.js/blob/canary/docs/middleware.mdx", "breadcrumb": "Routing > Middleware", "content": "Middleware allows you to run code before a request is completed...", "contentTokens": 200 } ] } }, "text/plain": { "schema": { "type": "string" }, "example": "### Middleware Authentication Example\n\nSource: https://github.com/vercel/next.js/blob/canary/docs/middleware.mdx\n\nShows how to implement authentication checks in Next.js middleware\n\n```typescript\nimport { NextResponse } from 'next/server'\n...\n```" } } }, "202": { "$ref": "#/components/responses/AcceptedError" }, "301": { "$ref": "#/components/responses/RedirectError" }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/ForbiddenError" }, "402": { "$ref": "#/components/responses/SpendingLimitError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "422": { "$ref": "#/components/responses/UnprocessableEntityError" }, "429": { "$ref": "#/components/responses/RateLimitError" }, "500": { "$ref": "#/components/responses/InternalServerError" } }, "security": [ {}, { "bearerAuth": [] } ] } }, "/v1/refresh": { "post": { "summary": "Refresh a library", "description": "Trigger a refresh of an existing library to fetch the latest documentation. Library owners have dedicated refresh limits.", "operationId": "refreshLibrary", "tags": [ "Refresh" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "libraryName" ], "properties": { "libraryName": { "type": "string", "description": "Library identifier — the URL path of the library on context7.com. Use `/owner/repo` for GitHub repositories (e.g., `/vercel/next.js`), or `//` for other sources (e.g., `/websites/uploadcare_com`, `/llmstxt/`). See [Library ID format](/api-guide#library-id-format)." }, "branch": { "type": "string", "description": "Optional branch name to refresh" }, "gitToken": { "type": "string", "description": "Optional Git access token for refreshing private repositories. If not provided, the stored OAuth token will be used." } } }, "examples": { "github": { "summary": "GitHub repository", "value": { "libraryName": "/vercel/next.js" } }, "website": { "summary": "Website source", "value": { "libraryName": "/websites/uploadcare_com" } }, "llmstxt": { "summary": "llms.txt source", "value": { "libraryName": "/llmstxt/example" } } } } } }, "responses": { "200": { "description": "Refresh started successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] }, "example": { "message": "Refresh started successfully" } } } }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/ForbiddenError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "429": { "$ref": "#/components/responses/RateLimitError" }, "500": { "$ref": "#/components/responses/InternalServerError" } }, "security": [ { "bearerAuth": [] } ] } }, "/v2/policies": { "get": { "summary": "Get teamspace policies", "description": "Retrieve the current policy configuration for the teamspace associated with the API key. Includes source type access settings and public repository filters.", "operationId": "getPolicies", "tags": [ "Policies" ], "responses": { "200": { "description": "Current policy configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PolicyResponse" }, "example": { "sourceTypes": { "public_repos": { "enabled": true }, "private_sources": { "enabled": true }, "confluence": { "enabled": false }, "uploaded_files": { "enabled": true }, "websites": { "enabled": true }, "llmstxt": { "enabled": true } }, "libraryFilters": { "mode": "quality", "quality": { "requireVerified": false, "minTrustScore": null, "maxAgeDays": 365, "blockedLibraries": [ "/org/repo", "example.com" ], "exceptedLibraries": [ "/vercel/next.js" ], "repoFilters": { "minStars": 100 } }, "select": { "allowedLibraries": [] } }, "accessibleLibraryCount": 4521 } } } }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/ForbiddenError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } }, "security": [ { "bearerAuth": [] } ] }, "patch": { "summary": "Update teamspace policies", "description": "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.", "operationId": "updatePolicies", "tags": [ "Policies" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PatchPoliciesRequest" }, "examples": { "disableSourceType": { "summary": "Disable a source type", "value": { "sourceTypes": { "disable": [ "websites" ] } } }, "setQualityFilters": { "summary": "Set quality filter thresholds", "value": { "libraryFilters": { "quality": { "requireVerified": true, "minTrustScore": 4, "repoFilters": { "minStars": 1000 } } } } }, "setWebsiteFilters": { "summary": "Set website quality filters", "value": { "libraryFilters": { "quality": { "websiteFilters": { "minBacklinks": 100, "minReferringDomains": 10, "minOrganicTraffic": 1000 } } } } }, "blockLibrary": { "summary": "Add a library to the blocked list", "value": { "libraryFilters": { "quality": { "blockedLibraries": { "add": [ "/org/repo" ] } } } } }, "blockDomain": { "summary": "Block all libraries from a domain", "value": { "libraryFilters": { "quality": { "blockedLibraries": { "add": [ "example.com" ] } } } } }, "exceptLibrary": { "summary": "Add a library exception (bypasses all filters)", "value": { "libraryFilters": { "quality": { "exceptedLibraries": { "add": [ "/vercel/next.js" ] } } } } }, "allowDomain": { "summary": "Allow libraries from a specific domain (select mode)", "value": { "libraryFilters": { "select": { "allowedLibraries": { "add": [ "stripe.com", "/vercel/next.js" ] } } } } }, "clearAllowedLibraries": { "summary": "Clear all allowed libraries", "value": { "libraryFilters": { "select": { "allowedLibraries": { "clear": true } } } } }, "combined": { "summary": "Multiple changes in one request", "value": { "sourceTypes": { "enable": [ "websites" ], "disable": [ "confluence" ] }, "libraryFilters": { "mode": "quality", "quality": { "minTrustScore": 4, "maxAgeDays": 365, "blockedLibraries": { "add": [ "/org/repo" ], "remove": [ "/org/old-repo" ] }, "repoFilters": { "minStars": 100 }, "websiteFilters": { "minBacklinks": 100 } } } } } } } } }, "responses": { "200": { "description": "Updated policy configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PolicyResponse" } } } }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/ForbiddenError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "500": { "$ref": "#/components/responses/InternalServerError" } }, "security": [ { "bearerAuth": [] } ] } }, "/v2/add/repo/github": { "post": { "summary": "Add a GitHub repository", "description": "Submit a GitHub repository for documentation processing. Supports private repos via a gitToken or by connecting your GitHub account at https://context7.com/add-library.", "operationId": "addGitHubRepo", "tags": [ "Add Library" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddRepoRequest" }, "example": { "docsRepoUrl": "https://github.com/vercel/next.js" } } } }, "responses": { "200": { "$ref": "#/components/responses/AddLibrarySuccess" }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/ForbiddenError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "409": { "$ref": "#/components/responses/DuplicateError" }, "429": { "$ref": "#/components/responses/RateLimitError" }, "500": { "$ref": "#/components/responses/InternalServerError" }, "504": { "$ref": "#/components/responses/GatewayTimeoutError" } }, "security": [ { "bearerAuth": [] } ] } }, "/v2/add/repo/gitlab": { "post": { "summary": "Add a GitLab repository", "description": "Submit a GitLab repository for documentation processing. Supports private repos via a gitToken or by connecting your GitLab account at https://context7.com/add-library.", "operationId": "addGitLabRepo", "tags": [ "Add Library" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddRepoRequest" }, "example": { "docsRepoUrl": "https://gitlab.com/owner/repo" } } } }, "responses": { "200": { "$ref": "#/components/responses/AddLibrarySuccess" }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/ForbiddenError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "409": { "$ref": "#/components/responses/DuplicateError" }, "429": { "$ref": "#/components/responses/RateLimitError" }, "500": { "$ref": "#/components/responses/InternalServerError" }, "504": { "$ref": "#/components/responses/GatewayTimeoutError" } }, "security": [ { "bearerAuth": [] } ] } }, "/v2/add/repo/bitbucket": { "post": { "summary": "Add a Bitbucket repository", "description": "Submit a Bitbucket repository for documentation processing. Supports private repos via a gitToken or by connecting your Bitbucket account at https://context7.com/add-library.", "operationId": "addBitbucketRepo", "tags": [ "Add Library" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddRepoRequest" }, "example": { "docsRepoUrl": "https://bitbucket.org/owner/repo" } } } }, "responses": { "200": { "$ref": "#/components/responses/AddLibrarySuccess" }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/ForbiddenError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "409": { "$ref": "#/components/responses/DuplicateError" }, "429": { "$ref": "#/components/responses/RateLimitError" }, "500": { "$ref": "#/components/responses/InternalServerError" }, "504": { "$ref": "#/components/responses/GatewayTimeoutError" } }, "security": [ { "bearerAuth": [] } ] } }, "/v2/add/repo/git": { "post": { "summary": "Add from other Git providers", "description": "Submit a repository from any Git provider not covered by the dedicated GitHub, GitLab, or Bitbucket endpoints. Supports Gitea, Forgejo, Codeberg, self-hosted GitLab, and other Git servers. For private repos, provide a personal access token via the gitToken field.", "operationId": "addGitRepo", "tags": [ "Add Library" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "docsRepoUrl" ], "properties": { "docsRepoUrl": { "type": "string", "format": "uri", "description": "The Git repository URL" }, "gitToken": { "type": "string", "description": "Personal access token for private repositories" }, "private": { "type": "boolean", "description": "Whether the repository is private" }, "skipVersionFiltering": { "type": "boolean", "description": "Skip filtering out version-specific documentation pages" } } }, "example": { "docsRepoUrl": "https://codeberg.org/owner/repo" } } } }, "responses": { "200": { "$ref": "#/components/responses/AddLibrarySuccess" }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/ForbiddenError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "409": { "$ref": "#/components/responses/DuplicateError" }, "429": { "$ref": "#/components/responses/RateLimitError" }, "500": { "$ref": "#/components/responses/InternalServerError" }, "504": { "$ref": "#/components/responses/GatewayTimeoutError" } }, "security": [ { "bearerAuth": [] } ] } }, "/v2/add/openapi": { "post": { "summary": "Add an OpenAPI specification by URL", "description": "Submit an OpenAPI specification URL for documentation processing.", "operationId": "addOpenApi", "tags": [ "Add Library" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "openApiUrl" ], "properties": { "openApiUrl": { "type": "string", "format": "uri", "description": "URL pointing to an OpenAPI specification (JSON or YAML)" } } }, "example": { "openApiUrl": "https://api.example.com/openapi.json" } } } }, "responses": { "200": { "$ref": "#/components/responses/AddLibrarySuccess" }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "429": { "$ref": "#/components/responses/RateLimitError" }, "500": { "$ref": "#/components/responses/InternalServerError" }, "504": { "$ref": "#/components/responses/GatewayTimeoutError" } }, "security": [ { "bearerAuth": [] } ] } }, "/v2/add/openapi-upload": { "post": { "summary": "Upload an OpenAPI specification file", "description": "Upload an OpenAPI specification file (JSON or YAML) for documentation processing. Requires a team project. File size limit is 10MB.", "operationId": "addOpenApiUpload", "tags": [ "Add Library" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "required": [ "openapiFile" ], "properties": { "openapiFile": { "type": "string", "format": "binary", "description": "The OpenAPI specification file (.json, .yaml, or .yml)" }, "libraryTitle": { "type": "string", "description": "Custom title for the library" }, "description": { "type": "string", "description": "Description of the library" }, "force": { "type": "string", "enum": [ "true" ], "description": "Set to 'true' to force reprocessing" } } } } } }, "responses": { "200": { "$ref": "#/components/responses/AddLibrarySuccess" }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/ForbiddenError" }, "404": { "$ref": "#/components/responses/NotFoundError" }, "409": { "$ref": "#/components/responses/DuplicateError" }, "429": { "$ref": "#/components/responses/RateLimitError" }, "500": { "$ref": "#/components/responses/InternalServerError" }, "504": { "$ref": "#/components/responses/GatewayTimeoutError" } }, "security": [ { "bearerAuth": [] } ] } }, "/v2/add/llmstxt": { "post": { "summary": "Add an llms.txt file", "description": "Submit an llms.txt file URL for documentation processing.", "operationId": "addLlmsTxt", "tags": [ "Add Library" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "llmstxtUrl" ], "properties": { "llmstxtUrl": { "type": "string", "format": "uri", "description": "URL pointing to an llms.txt, llms-full.txt, or llms-small.txt file" } } }, "example": { "llmstxtUrl": "https://docs.example.com/llms.txt" } } } }, "responses": { "200": { "$ref": "#/components/responses/AddLibrarySuccess" }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "429": { "$ref": "#/components/responses/RateLimitError" }, "500": { "$ref": "#/components/responses/InternalServerError" }, "504": { "$ref": "#/components/responses/GatewayTimeoutError" } }, "security": [ { "bearerAuth": [] } ] } }, "/v2/add/website": { "post": { "summary": "Add a website", "description": "Submit a website URL for documentation processing.", "operationId": "addWebsite", "tags": [ "Add Library" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "websiteUrl" ], "properties": { "websiteUrl": { "type": "string", "format": "uri", "description": "The website URL to process" }, "websiteBaseUrl": { "type": "string", "format": "uri", "description": "Base URL to limit crawling scope. Only pages starting with this URL will be indexed." } } }, "example": { "websiteUrl": "https://docs.example.com" } } } }, "responses": { "200": { "$ref": "#/components/responses/AddLibrarySuccess" }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "422": { "$ref": "#/components/responses/UnprocessableEntityError" }, "429": { "$ref": "#/components/responses/RateLimitError" }, "500": { "$ref": "#/components/responses/InternalServerError" }, "504": { "$ref": "#/components/responses/GatewayTimeoutError" } }, "security": [ { "bearerAuth": [] } ] } }, "/v2/add/confluence": { "post": { "summary": "Add a Confluence space", "description": "Submit a Confluence space for documentation processing. Requires a connected Confluence account and a team project. You can optionally specify specific page IDs to index only a subset of the space.", "operationId": "addConfluence", "tags": [ "Add Library" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "cloudId", "siteUrl", "spaceKey", "spaceName", "title", "description" ], "properties": { "cloudId": { "type": "string", "description": "The Confluence cloud instance ID" }, "siteUrl": { "type": "string", "description": "The Confluence site URL" }, "spaceKey": { "type": "string", "description": "The Confluence space key" }, "spaceName": { "type": "string", "description": "The Confluence space name" }, "pageIds": { "type": "array", "items": { "type": "string" }, "description": "Optional list of specific page IDs to index. If omitted, the entire space is indexed." }, "title": { "type": "string", "description": "Title for the library" }, "description": { "type": "string", "description": "Description of the library" }, "projectId": { "type": "string", "description": "The team project ID to associate this Confluence space with" } } }, "example": { "cloudId": "a]1b2c3d4-5e6f-7g8h-9i0j", "siteUrl": "https://your-site.atlassian.net", "spaceKey": "DOCS", "spaceName": "Documentation", "title": "My Docs", "description": "Internal documentation", "projectId": "project-uuid" } } } }, "responses": { "200": { "$ref": "#/components/responses/AddLibrarySuccess" }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/ForbiddenError" }, "409": { "$ref": "#/components/responses/DuplicateError" }, "429": { "$ref": "#/components/responses/RateLimitError" }, "500": { "$ref": "#/components/responses/InternalServerError" }, "504": { "$ref": "#/components/responses/GatewayTimeoutError" } }, "security": [ { "bearerAuth": [] } ] } }, "/v2/add/notion": { "post": { "summary": "Add Notion pages", "description": "Submit selected Notion pages for documentation processing. Requires a connected Notion account and a team project.", "operationId": "addNotion", "tags": [ "Add Library" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "workspaceId", "workspaceName", "pageIds", "title", "description" ], "properties": { "workspaceId": { "type": "string", "description": "The Notion workspace ID" }, "workspaceName": { "type": "string", "description": "The Notion workspace name" }, "pageIds": { "type": "array", "items": { "type": "string" }, "description": "List of Notion page IDs to index." }, "title": { "type": "string", "description": "Title for the library" }, "description": { "type": "string", "description": "Description of the library" }, "projectId": { "type": "string", "description": "The team project ID to associate these Notion pages with" } } }, "example": { "workspaceId": "workspace-uuid", "workspaceName": "Acme Workspace", "pageIds": [ "page-1", "page-2" ], "title": "Product Docs", "description": "Internal Notion knowledge base", "projectId": "project-uuid" } } } }, "responses": { "200": { "$ref": "#/components/responses/AddLibrarySuccess" }, "400": { "$ref": "#/components/responses/BadRequestError" }, "401": { "$ref": "#/components/responses/UnauthorizedError" }, "403": { "$ref": "#/components/responses/ForbiddenError" }, "409": { "$ref": "#/components/responses/DuplicateError" }, "429": { "$ref": "#/components/responses/RateLimitError" }, "500": { "$ref": "#/components/responses/InternalServerError" }, "504": { "$ref": "#/components/responses/GatewayTimeoutError" } }, "security": [ { "bearerAuth": [] } ] } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "description": "Get your API key at [context7.com/dashboard](https://context7.com/dashboard). Treat your API key like a password and store it securely." } }, "parameters": { "LibraryNameParam": { "name": "libraryName", "in": "query", "description": "Library name to search for (e.g., 'react', 'nextjs', 'express')", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 500 }, "example": "react" }, "QueryParam": { "name": "query", "in": "query", "description": "User's original question or task - used for intelligent relevance ranking", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 500 }, "example": "How to manage state with hooks" }, "LibraryIdParam": { "name": "libraryId", "in": "query", "description": "Context7-compatible library ID — the URL path of the library on context7.com. Use `/owner/repo` for GitHub repositories, or `//` for other sources (websites, llms.txt, GitLab/Bitbucket, etc.). Optionally suffix with `/` or `@` to pin a specific version. See [Library ID format](/api-guide#library-id-format).", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 500, "pattern": "^/[^/]+/[^/]+([/@][^/]+)?$" }, "examples": { "github": { "summary": "GitHub repository", "value": "/vercel/next.js" }, "website": { "summary": "Website source", "value": "/websites/uploadcare_com" }, "llmstxt": { "summary": "llms.txt source", "value": "/llmstxt/example" }, "withVersion": { "summary": "With specific version (slash)", "value": "/vercel/next.js/v14.3.0" }, "withVersionAt": { "summary": "With specific version (@ syntax)", "value": "/vercel/next.js@v14.3.0" } } }, "TypeParam": { "name": "type", "in": "query", "description": "Response format type", "required": false, "schema": { "type": "string", "enum": [ "json", "txt" ], "default": "txt" }, "example": "json" }, "FastParam": { "name": "fast", "in": "query", "description": "When `true`, skip LLM reranking and return top vector-search results directly. Trades relevance quality for lower latency.", "required": false, "schema": { "type": "string", "enum": [ "true", "false" ], "default": "false" }, "example": "true" }, "DaysParam": { "name": "days", "in": "query", "description": "Number of days of daily history to return (1-365). Defaults to 30.", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 365, "default": 30 }, "example": 30 } }, "schemas": { "Library": { "type": "object", "description": "Library metadata", "properties": { "id": { "type": "string", "description": "Library ID — the URL path of the library on context7.com. `/owner/repo` for GitHub repositories, or `//` for other sources (e.g., `/vercel/next.js`, `/websites/uploadcare_com`). See [Library ID format](/api-guide#library-id-format).", "example": "/vercel/next.js" }, "title": { "type": "string", "description": "Display name of the library", "example": "Next.js" }, "description": { "type": "string", "description": "Short description", "example": "The React Framework" }, "branch": { "type": "string", "description": "Git branch being tracked", "example": "canary" }, "lastUpdateDate": { "type": "string", "format": "date-time", "description": "ISO 8601 timestamp of last update", "example": "2025-01-15T10:30:00.000Z" }, "state": { "type": "string", "enum": [ "finalized", "initial", "processing", "error", "delete" ], "description": "Processing state of the library", "example": "finalized" }, "totalTokens": { "type": "integer", "description": "Total tokens in documentation", "example": 607822 }, "totalSnippets": { "type": "integer", "description": "Number of code snippets", "example": 3629 }, "stars": { "type": "integer", "description": "GitHub stars count", "example": 131745 }, "trustScore": { "type": "integer", "description": "Source reputation score (0-10)", "minimum": 0, "maximum": 10, "example": 10 }, "benchmarkScore": { "type": "number", "description": "Quality indicator score (0-100)", "minimum": 0, "maximum": 100, "example": 95.5 }, "versions": { "type": "array", "description": "Available version tags", "items": { "type": "string" }, "example": [ "v15.1.8", "v14.3.0" ] } } }, "SearchResponse": { "type": "object", "description": "Search results response", "properties": { "results": { "type": "array", "description": "Array of matching libraries ranked by relevance", "items": { "$ref": "#/components/schemas/Library" } }, "searchFilterApplied": { "type": "boolean", "description": "Indicates whether the search results were filtered by the teamspace's public library access settings. When true, some libraries may be excluded from results based on the teamspace's configuration (e.g., only verified libraries, selected libraries, or private repos only)." } }, "required": [ "results", "searchFilterApplied" ] }, "CodeSnippet": { "type": "object", "description": "A code snippet from library documentation", "properties": { "codeTitle": { "type": "string", "description": "Title of the code snippet" }, "codeDescription": { "type": "string", "description": "Description of what the code does" }, "codeLanguage": { "type": "string", "description": "Primary programming language" }, "codeTokens": { "type": "integer", "description": "Token count for the snippet" }, "codeId": { "type": "string", "description": "URL to source location" }, "pageTitle": { "type": "string", "description": "Title of the documentation page" }, "codeList": { "type": "array", "description": "Code examples in different languages", "items": { "$ref": "#/components/schemas/CodeExample" } }, "isDynamic": { "type": "boolean", "description": "Whether this snippet was recovered from the dynamic source-code index instead of the primary docs index" }, "sourceFile": { "type": "string", "description": "Repo-relative source file path for dynamic snippets" } }, "required": [ "codeTitle", "codeDescription", "codeLanguage", "codeTokens", "codeId", "pageTitle", "codeList" ] }, "CodeExample": { "type": "object", "description": "A single code example", "properties": { "language": { "type": "string", "description": "Programming language" }, "code": { "type": "string", "description": "The actual code content" } }, "required": [ "language", "code" ] }, "InfoSnippet": { "type": "object", "description": "A documentation snippet", "properties": { "pageId": { "type": "string", "description": "URL to source page" }, "breadcrumb": { "type": "string", "description": "Navigation breadcrumb path" }, "content": { "type": "string", "description": "The documentation content" }, "contentTokens": { "type": "integer", "description": "Token count for the content" } }, "required": [ "content", "contentTokens" ] }, "ContextResponse": { "type": "object", "description": "Documentation context response", "properties": { "codeSnippets": { "type": "array", "description": "Relevant code snippets", "items": { "$ref": "#/components/schemas/CodeSnippet" } }, "infoSnippets": { "type": "array", "description": "Relevant documentation snippets", "items": { "$ref": "#/components/schemas/InfoSnippet" } }, "rules": { "type": "object", "description": "Optional library-specific rules and guidelines", "properties": { "global": { "type": "array", "description": "Global team rules", "items": { "type": "string" } }, "libraryOwn": { "type": "array", "description": "Rules defined by the library owner", "items": { "type": "string" } }, "libraryTeam": { "type": "array", "description": "Library-specific rules from the team", "items": { "type": "string" } } } } }, "required": [ "codeSnippets", "infoSnippets" ] }, "Error": { "type": "object", "description": "Standard error response", "properties": { "error": { "type": "string", "description": "Error code identifier" }, "message": { "type": "string", "description": "Human-readable error message" } }, "required": [ "error", "message" ] }, "ProjectStats": { "type": "object", "description": "Cumulative request counts for a library, broken down by request surface", "properties": { "page": { "type": "integer", "description": "Requests served to the context7.com web UI" }, "txt": { "type": "integer", "description": "Plain-text documentation requests" }, "mcp": { "type": "integer", "description": "Requests served via the Context7 MCP server" }, "cli": { "type": "integer", "description": "Requests served to the Context7 CLI" } }, "required": [ "page", "txt", "mcp", "cli" ] }, "DailyStatsPoint": { "type": "object", "description": "Per-day request counts for a library (counts *on* this date, not cumulative)", "properties": { "date": { "type": "string", "format": "date", "description": "UTC date in `YYYY-MM-DD` format", "example": "2025-01-15" }, "page": { "type": "integer", "description": "Requests served to the context7.com web UI on this date" }, "txt": { "type": "integer", "description": "Plain-text documentation requests on this date" }, "mcp": { "type": "integer", "description": "Requests served via the Context7 MCP server on this date" }, "cli": { "type": "integer", "description": "Requests served to the Context7 CLI on this date" }, "total": { "type": "integer", "description": "Sum of all request surfaces on this date (`page + txt + mcp + cli`)" } }, "required": [ "date", "page", "txt", "mcp", "cli", "total" ] }, "LibraryMetricsResponse": { "type": "object", "description": "Library usage metrics response", "properties": { "total": { "$ref": "#/components/schemas/ProjectStats" }, "daily": { "type": "array", "description": "Per-day request counts (deltas, not cumulative), ordered from oldest to newest. Days with zero activity are omitted. Up to `days` points — fewer if the library has less history or had idle days in the window.", "items": { "$ref": "#/components/schemas/DailyStatsPoint" } }, "mcpClients": { "$ref": "#/components/schemas/McpClientMetrics" }, "topics": { "type": "array", "description": "Lifetime topic distribution, ordered by count descending", "items": { "$ref": "#/components/schemas/TopicCount" } }, "countries": { "type": "array", "description": "Lifetime country distribution (ISO-2 codes), ordered by count descending", "items": { "$ref": "#/components/schemas/CountryCount" } } }, "required": [ "total", "daily", "mcpClients", "topics", "countries" ] }, "McpClientMetrics": { "type": "object", "description": "MCP client usage breakdown by day", "properties": { "dailyData": { "type": "array", "description": "Per-day MCP client unique-user breakdown, ordered from oldest to newest", "items": { "$ref": "#/components/schemas/McpDailyClientData" } } }, "required": [ "dailyData" ] }, "McpDailyClientData": { "type": "object", "description": "Per-day MCP client unique users for a library", "properties": { "date": { "type": "string", "format": "date", "description": "UTC date in `YYYY-MM-DD` format", "example": "2025-01-15" }, "uniqueUsersByClient": { "type": "object", "description": "Unique user count per MCP client identifier (e.g., `cursor`, `claude-code`, `windsurf`)", "additionalProperties": { "type": "integer" } }, "totalUniqueUsers": { "type": "integer", "description": "Total unique users across all clients for this library on this date" } }, "required": [ "date", "uniqueUsersByClient", "totalUniqueUsers" ] }, "TopicCount": { "type": "object", "description": "Topic with its lifetime request count", "properties": { "topic": { "type": "string", "description": "Normalized, lowercased topic string", "example": "routing" }, "count": { "type": "integer", "description": "Number of requests that referenced this topic" } }, "required": [ "topic", "count" ] }, "CountryCount": { "type": "object", "description": "Country with its lifetime request count", "properties": { "country": { "type": "string", "description": "ISO 3166-1 alpha-2 country code", "example": "US" }, "count": { "type": "integer", "description": "Number of requests originating from this country" } }, "required": [ "country", "count" ] }, "AddRepoRequest": { "type": "object", "description": "Request body for adding a Git repository", "required": [ "docsRepoUrl" ], "properties": { "docsRepoUrl": { "type": "string", "format": "uri", "description": "The repository URL" }, "gitToken": { "type": "string", "description": "Personal access token for private repositories. If not provided, the token from your OAuth connection at https://context7.com/add-library is used." }, "private": { "type": "boolean", "description": "Whether the repository is private" }, "skipVersionFiltering": { "type": "boolean", "description": "Skip filtering out version-specific documentation pages" } } }, "AddLibraryResponse": { "type": "object", "description": "Response after successfully submitting a library", "properties": { "libraryName": { "type": "string", "description": "The library identifier assigned — the URL path of the library on context7.com. `/owner/repo` for GitHub repositories, or `//` for other sources (e.g., `/vercel/next.js`, `/websites/uploadcare_com`). See [Library ID format](/api-guide#library-id-format)." }, "message": { "type": "string", "description": "Human-readable success message" } }, "required": [ "libraryName", "message" ] }, "SourceTypeStatus": { "type": "object", "description": "Whether a source type is enabled or disabled", "properties": { "enabled": { "type": "boolean", "description": "Whether this source type is enabled" } }, "required": [ "enabled" ] }, "PolicyResponse": { "type": "object", "description": "Complete teamspace policy configuration", "properties": { "sourceTypes": { "type": "object", "description": "Access settings for each documentation source type", "properties": { "public_repos": { "$ref": "#/components/schemas/SourceTypeStatus" }, "private_sources": { "$ref": "#/components/schemas/SourceTypeStatus" }, "confluence": { "$ref": "#/components/schemas/SourceTypeStatus" }, "uploaded_files": { "$ref": "#/components/schemas/SourceTypeStatus" }, "websites": { "$ref": "#/components/schemas/SourceTypeStatus" }, "llmstxt": { "$ref": "#/components/schemas/SourceTypeStatus" } }, "required": [ "public_repos", "private_sources", "confluence", "uploaded_files", "websites", "llmstxt" ] }, "libraryFilters": { "type": "object", "description": "Library access filters. Mode determines which sub-object is active.", "properties": { "mode": { "type": "string", "nullable": true, "enum": [ "quality", "select", null ], "description": "Filter mode: 'quality' for threshold-based filtering, 'select' for manual library selection" }, "quality": { "type": "object", "description": "Quality-mode settings (active when mode is 'quality')", "properties": { "requireVerified": { "type": "boolean", "description": "Restrict to verified libraries only" }, "minTrustScore": { "type": "integer", "nullable": true, "description": "Minimum trust score, 0-10" }, "maxAgeDays": { "type": "integer", "nullable": true, "description": "Maximum days since last update" }, "blockedLibraries": { "type": "array", "items": { "type": "string" }, "description": "Libraries excluded from results" }, "exceptedLibraries": { "type": "array", "items": { "type": "string" }, "description": "Libraries that bypass all quality filters, blocked list, and source type restrictions" }, "repoFilters": { "type": "object", "description": "Repo-specific quality filters", "properties": { "minStars": { "type": "integer", "nullable": true, "description": "Minimum GitHub stars required" } }, "required": [ "minStars" ] }, "websiteFilters": { "type": "object", "description": "Website-specific quality filters", "properties": { "minBacklinks": { "type": "integer", "nullable": true, "description": "Minimum number of backlinks required" }, "minReferringDomains": { "type": "integer", "nullable": true, "description": "Minimum number of referring domains required" }, "minOrganicTraffic": { "type": "integer", "nullable": true, "description": "Minimum monthly organic traffic required" } }, "required": [ "minBacklinks", "minReferringDomains", "minOrganicTraffic" ] } }, "required": [ "requireVerified", "minTrustScore", "maxAgeDays", "blockedLibraries", "exceptedLibraries", "repoFilters", "websiteFilters" ] }, "select": { "type": "object", "description": "Select-mode settings (active when mode is 'select')", "properties": { "allowedLibraries": { "type": "array", "items": { "type": "string" }, "description": "Libraries explicitly allowed" } }, "required": [ "allowedLibraries" ] } }, "required": [ "mode", "quality", "select" ] }, "accessibleLibraryCount": { "type": "integer", "description": "Number of public libraries currently accessible under these filters" } }, "required": [ "sourceTypes", "libraryFilters", "accessibleLibraryCount" ] }, "ListOperation": { "type": "object", "description": "Incremental add/remove operation on a list of library identifiers or domains. Use 'clear' to remove all entries at once.", "properties": { "add": { "type": "array", "items": { "type": "string" }, "description": "Identifiers to add — library paths (e.g. '/org/repo', '/org') or domains (e.g. 'stripe.com')" }, "remove": { "type": "array", "items": { "type": "string" }, "description": "Identifiers to remove — library paths (e.g. '/org/repo', '/org') or domains (e.g. 'stripe.com')" }, "clear": { "type": "boolean", "description": "Set to true to remove all entries. Cannot be used together with 'add' or 'remove'." } } }, "PatchPoliciesRequest": { "type": "object", "description": "Incremental policy update. All fields are optional — only provided fields are modified. At least one of 'sourceTypes' or 'libraryFilters' must be provided.", "minProperties": 1, "properties": { "sourceTypes": { "type": "object", "description": "Enable or disable specific source types. Both can be provided in one request, but the same type cannot appear in both arrays.", "properties": { "enable": { "type": "array", "items": { "type": "string", "enum": [ "public_repos", "private_sources", "confluence", "uploaded_files", "websites", "llmstxt" ] }, "description": "Source types to enable" }, "disable": { "type": "array", "items": { "type": "string", "enum": [ "public_repos", "private_sources", "confluence", "uploaded_files", "websites", "llmstxt" ] }, "description": "Source types to disable" } } }, "libraryFilters": { "type": "object", "description": "Update library access filters.", "properties": { "mode": { "type": "string", "nullable": true, "enum": [ "quality", "select", null ], "description": "Filter mode (null to clear)" }, "quality": { "type": "object", "description": "Update quality-mode settings.", "properties": { "requireVerified": { "type": "boolean", "description": "Restrict to verified libraries only" }, "minTrustScore": { "type": "integer", "nullable": true, "minimum": 0, "maximum": 10, "description": "Minimum trust score, 0-10 (null to clear)" }, "maxAgeDays": { "type": "integer", "nullable": true, "minimum": 1, "description": "Maximum age in days (null to clear)" }, "blockedLibraries": { "$ref": "#/components/schemas/ListOperation" }, "exceptedLibraries": { "$ref": "#/components/schemas/ListOperation" }, "repoFilters": { "type": "object", "description": "Update repo-specific quality filters.", "properties": { "minStars": { "type": "integer", "nullable": true, "minimum": 0, "description": "Minimum stars threshold (null to clear)" } } }, "websiteFilters": { "type": "object", "description": "Update website-specific quality filters.", "properties": { "minBacklinks": { "type": "integer", "nullable": true, "minimum": 0, "description": "Minimum backlinks threshold (null to clear)" }, "minReferringDomains": { "type": "integer", "nullable": true, "minimum": 0, "description": "Minimum referring domains threshold (null to clear)" }, "minOrganicTraffic": { "type": "integer", "nullable": true, "minimum": 0, "description": "Minimum organic traffic threshold (null to clear)" } } } } }, "select": { "type": "object", "description": "Update select-mode settings.", "properties": { "allowedLibraries": { "$ref": "#/components/schemas/ListOperation" } } } } } } }, "RedirectErrorResponse": { "allOf": [ { "$ref": "#/components/schemas/Error" }, { "type": "object", "properties": { "redirectUrl": { "type": "string", "description": "New location of the library" } } } ] } }, "responses": { "BadRequestError": { "description": "Bad Request - Invalid input parameters", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "validationError": { "summary": "Validation error", "value": { "error": "validation_error", "message": "Library name is required" } }, "invalidLibraryId": { "summary": "Invalid library ID format", "value": { "error": "invalid_library_id", "message": "Invalid library ID format. Expected: `/owner/repo` for GitHub repositories, or `//` for other sources (the URL path of the library on context7.com)" } } } } } }, "ForbiddenError": { "description": "Forbidden - Insufficient permissions or plan restrictions", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "accessDenied": { "summary": "Library not in allowed list", "value": { "error": "access_denied", "message": "Access denied: Library /owner/repo is not included in your allowed libraries" } }, "insufficientRole": { "summary": "Insufficient team role", "value": { "error": "forbidden", "message": "Only team owners and admins can add private repositories" } }, "planRequired": { "summary": "Plan upgrade required", "value": { "error": "forbidden", "message": "Private repositories require a pro plan or team. Upgrade at https://context7.com/plans" } } } } } }, "NotFoundError": { "description": "Not Found - Resource doesn't exist", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "libraryNotFound": { "summary": "Library not found", "value": { "error": "library_not_found", "message": "Library \"/owner/repo\" not found. Please check the library ID or your access permissions." } }, "tagNotFound": { "summary": "Version tag not found", "value": { "error": "tag_not_found", "message": "Tag \"v1.0.0\" not found for library \"/owner/repo\". Available tags: v2.0.0, v1.5.0" } }, "noSnippetsFound": { "summary": "No snippets found", "value": { "error": "no_snippets_found", "message": "Could not fetch documentation snippets from the library." } }, "teamNotFound": { "summary": "Team not found", "value": { "error": "team_not_found", "message": "Team not found or access denied" } }, "userNotFound": { "summary": "User not found", "value": { "error": "user_not_found", "message": "User not found" } }, "noLibrariesFound": { "summary": "No libraries matched search query", "value": { "error": "no_libraries_found", "message": "No libraries found for \"nonexistent-lib\". Try a different search term." } } } } } }, "InternalServerError": { "description": "Internal Server Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "error": "internal_error", "message": "An error occurred while processing your request" } } } }, "ServiceUnavailableError": { "description": "Service Unavailable - Search service is temporarily unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "error": "search_failed", "message": "Search failed: Service temporarily unavailable" } } } }, "AcceptedError": { "description": "Accepted - Library not yet finalized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "error": "library_not_finalized", "message": "Library /owner/repo not finalized yet." } } } }, "RedirectError": { "description": "Moved Permanently - Library has been redirected", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RedirectErrorResponse" }, "example": { "error": "library_redirected", "message": "Library /owner/repo has been redirected to this library: /new-owner/new-repo.", "redirectUrl": "/new-owner/new-repo" } } } }, "UnprocessableEntityError": { "description": "Unprocessable Entity - Library is too large or has no code", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "examples": { "tooLarge": { "summary": "Library too large", "value": { "error": "library_too_large", "message": "Library /owner/repo is too large to process." } }, "noCode": { "summary": "No code found", "value": { "error": "no_code_found", "message": "Library /owner/repo has no or too few snippets found in documentation files." } } } } } }, "UnauthorizedError": { "description": "Unauthorized - Invalid or missing API key", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "error": "invalid_api_key", "message": "Invalid API key. Please check your API key. API keys should start with 'ctx7sk' prefix." } } } }, "AddLibrarySuccess": { "description": "Library submitted successfully for processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddLibraryResponse" }, "example": { "libraryName": "/owner/repo", "message": "Repository submitted successfully" } } } }, "DuplicateError": { "description": "Conflict - Resource already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "error": "duplicate_repo", "message": "This private repository is already in your team" } } } }, "SpendingLimitError": { "description": "Payment Required - the teamspace's configured monthly spending limit has been reached. A teamspace owner or admin can raise the limit in billing settings, or the cap will reset at the start of the next billing month.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "error": "spending_limit_exceeded", "message": "Monthly spending limit of $5.00 reached for this teamspace. An owner or admin can raise the limit at https://context7.com/dashboard/billing, or the cap will reset at the start of next month." } } } }, "RateLimitError": { "description": "Too Many Requests - Rate limit exceeded", "headers": { "Retry-After": { "description": "Seconds until rate limit resets", "schema": { "type": "integer" } }, "RateLimit-Limit": { "description": "Request limit", "schema": { "type": "integer" } }, "RateLimit-Remaining": { "description": "Remaining requests", "schema": { "type": "integer" } }, "RateLimit-Reset": { "description": "Unix timestamp when limit resets", "schema": { "type": "integer" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "error": "rate_limit_exceeded", "message": "Rate limit exceeded. Please try again later." } } } }, "GatewayTimeoutError": { "description": "Gateway Timeout - Processing timed out waiting for logs", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" }, "example": { "error": "timeout", "message": "Request timed out. Please try again." } } } } } }, "tags": [ { "name": "Search", "description": "Search for libraries in the Context7 database" }, { "name": "Context", "description": "Retrieve documentation context for queries" }, { "name": "Refresh", "description": "Refresh existing libraries to fetch latest documentation" }, { "name": "Policies", "description": "Manage teamspace access policies and filters" }, { "name": "Add Library", "description": "Submit new libraries for documentation processing" }, { "name": "Metrics", "description": "Retrieve usage metrics for libraries" } ] }