curl --request POST \
--url https://context7.com/api/v2/teamspaces/{teamspaceId}/libraries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source": "github",
"docsRepoUrl": "https://github.com/vercel/next.js"
}
'{
"libraryName": "/owner/repo",
"message": "Repository submitted successfully"
}Add a library
Submit a source for parsing; source selects its kind. Any member can add a public source; it does not join the teamspace. A private source (private: true, Confluence, Notion) joins this teamspace and needs the owner or admin role. The call returns once the parse has started (up to about 30 seconds); poll the library details for its state.
curl --request POST \
--url https://context7.com/api/v2/teamspaces/{teamspaceId}/libraries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source": "github",
"docsRepoUrl": "https://github.com/vercel/next.js"
}
'{
"libraryName": "/owner/repo",
"message": "Repository submitted successfully"
}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.
Path Parameters
Teamspace id (uuid).
Body
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
The library source. File uploads (PDF, DOCX, files, OpenAPI files) are not available here; upload them in the dashboard.
git is any other Git host (self-hosted).
github, gitlab, bitbucket, git Repository URL.
"https://github.com/acme/docs"
Add as a private source of this teamspace. Needs the owner or admin role and a paid plan. The token comes from gitToken, or from the GitHub, GitLab or Bitbucket account connected in the dashboard. git needs gitToken.
Personal access token for a private repository.
Keep pages that look version-specific (private repositories).
Generate documentation from the source code (private repositories).
Response
Library submitted successfully for processing
Response after successfully submitting a library
The library identifier assigned — the URL path of the library on context7.com. /owner/repo for GitHub repositories, or /<source>/<id> for other sources (e.g., /vercel/next.js, /websites/uploadcare_com). See Library ID format.
Human-readable success message
Only for websites: the version the URL was added as, when it is a version of an existing library. Request it as <libraryName>/<version>.
Was this page helpful?