List Docs7 sites
curl --request GET \
--url https://context7.com/api/v2/teamspaces/{teamspaceId}/sites \
--header 'Authorization: Bearer <token>'import requests
url = "https://context7.com/api/v2/teamspaces/{teamspaceId}/sites"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://context7.com/api/v2/teamspaces/{teamspaceId}/sites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://context7.com/api/v2/teamspaces/{teamspaceId}/sites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://context7.com/api/v2/teamspaces/{teamspaceId}/sites"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://context7.com/api/v2/teamspaces/{teamspaceId}/sites")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://context7.com/api/v2/teamspaces/{teamspaceId}/sites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repoUrl": "<string>",
"docsPath": "<string>",
"hosting": "off",
"platformHostname": "acme-docs.docs7.io",
"customDomainStatus": "none",
"context7Index": true,
"improveSchedule": "off",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"repositoryId": "<string>",
"installationId": 123,
"branch": "<string>",
"defaultBranch": "<string>",
"analyticsUrl": "<string>",
"workerName": "<string>",
"customDomain": "<string>",
"customDomainPath": "<string>",
"customDomainRouting": "dns",
"customHostnameId": "<string>",
"customDomainError": "<string>",
"customDomainRecords": [
{
"purpose": "domain_ownership",
"type": "CNAME",
"name": "<string>",
"value": "<string>"
}
],
"context7LibraryName": "/acme/docs",
"pullRequestReview": {
"enabled": true,
"response": "comment"
},
"codeWatch": {
"enabled": true,
"repositories": [
{
"repositoryId": "<string>",
"repoUrl": "<string>"
}
]
},
"buildFixSchedule": "off",
"snippetSchedule": "off"
}
],
"localSites": [
{
"source": "local",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"platformHostname": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"hosting": "on",
"workerName": "<string>",
"customDomain": "<string>",
"customDomainPath": "<string>",
"customDomainRouting": "<string>",
"customHostnameId": "<string>",
"customDomainStatus": "none",
"customDomainError": "<string>",
"customDomainRecords": [
{
"purpose": "domain_ownership",
"type": "CNAME",
"name": "<string>",
"value": "<string>"
}
]
}
],
"configuration": {
"hostingZone": "<string>",
"customDomainCnameTarget": "<string>"
}
}{
"error": "invalid_id",
"message": "Invalid site id."
}{
"error": "unauthorized",
"message": "Authentication required."
}{
"error": "forbidden",
"message": "You do not have permission to do this."
}{
"error": "not_found",
"message": "Site not found."
}{
"error": "internal_error",
"message": "Internal server error."
}Docs7 Sites
List Docs7 sites
The teamspace’s Docs7 sites. GitHub sites are in data, sites deployed with the docs7 deploy CLI in localSites. Any member.
GET
/
v2
/
teamspaces
/
{teamspaceId}
/
sites
List Docs7 sites
curl --request GET \
--url https://context7.com/api/v2/teamspaces/{teamspaceId}/sites \
--header 'Authorization: Bearer <token>'import requests
url = "https://context7.com/api/v2/teamspaces/{teamspaceId}/sites"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://context7.com/api/v2/teamspaces/{teamspaceId}/sites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://context7.com/api/v2/teamspaces/{teamspaceId}/sites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://context7.com/api/v2/teamspaces/{teamspaceId}/sites"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://context7.com/api/v2/teamspaces/{teamspaceId}/sites")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://context7.com/api/v2/teamspaces/{teamspaceId}/sites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"repoUrl": "<string>",
"docsPath": "<string>",
"hosting": "off",
"platformHostname": "acme-docs.docs7.io",
"customDomainStatus": "none",
"context7Index": true,
"improveSchedule": "off",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"repositoryId": "<string>",
"installationId": 123,
"branch": "<string>",
"defaultBranch": "<string>",
"analyticsUrl": "<string>",
"workerName": "<string>",
"customDomain": "<string>",
"customDomainPath": "<string>",
"customDomainRouting": "dns",
"customHostnameId": "<string>",
"customDomainError": "<string>",
"customDomainRecords": [
{
"purpose": "domain_ownership",
"type": "CNAME",
"name": "<string>",
"value": "<string>"
}
],
"context7LibraryName": "/acme/docs",
"pullRequestReview": {
"enabled": true,
"response": "comment"
},
"codeWatch": {
"enabled": true,
"repositories": [
{
"repositoryId": "<string>",
"repoUrl": "<string>"
}
]
},
"buildFixSchedule": "off",
"snippetSchedule": "off"
}
],
"localSites": [
{
"source": "local",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>",
"platformHostname": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"hosting": "on",
"workerName": "<string>",
"customDomain": "<string>",
"customDomainPath": "<string>",
"customDomainRouting": "<string>",
"customHostnameId": "<string>",
"customDomainStatus": "none",
"customDomainError": "<string>",
"customDomainRecords": [
{
"purpose": "domain_ownership",
"type": "CNAME",
"name": "<string>",
"value": "<string>"
}
]
}
],
"configuration": {
"hostingZone": "<string>",
"customDomainCnameTarget": "<string>"
}
}{
"error": "invalid_id",
"message": "Invalid site id."
}{
"error": "unauthorized",
"message": "Authentication required."
}{
"error": "forbidden",
"message": "You do not have permission to do this."
}{
"error": "not_found",
"message": "Site not found."
}{
"error": "internal_error",
"message": "Internal server error."
}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.
Was this page helpful?