curl --request PATCH \
--url https://context7.com/api/v2/teamspaces/{teamspaceId}/sites/{siteId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"hosting": "on",
"slug": "<string>",
"analyticsUrl": "<string>",
"customDomain": "<string>",
"customDomainPath": "<string>",
"customDomainRouting": "dns",
"branch": "<string>",
"docsPath": "<string>",
"context7Index": true,
"improveSchedule": "off",
"pullRequestReview": {
"enabled": true,
"response": "comment"
},
"codeWatch": {
"enabled": true,
"repositories": [
"<string>"
]
},
"buildFixSchedule": "off"
}'
import requests
url = "https://context7.com/api/v2/teamspaces/{teamspaceId}/sites/{siteId}"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
payload = {
"hosting": "on",
"slug": "<string>",
"analyticsUrl": "<string>",
"customDomain": "<string>",
"customDomainPath": "<string>",
"customDomainRouting": "dns",
"branch": "<string>",
"docsPath": "<string>",
"context7Index": True,
"improveSchedule": "off",
"pullRequestReview": {
"enabled": True,
"response": "comment"
},
"codeWatch": {
"enabled": True,
"repositories": [
"<string>"
]
},
"buildFixSchedule": "off"
}
response = requests.request("PATCH", url, headers=headers, json=payload)
print(response.text)
const response = await fetch('https://context7.com/api/v2/teamspaces/{teamspaceId}/sites/{siteId}', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"hosting": "on",
"slug": "<string>",
"analyticsUrl": "<string>",
"customDomain": "<string>",
"customDomainPath": "<string>",
"customDomainRouting": "dns",
"branch": "<string>",
"docsPath": "<string>",
"context7Index": true,
"improveSchedule": "off",
"pullRequestReview": {
"enabled": true,
"response": "comment"
},
"codeWatch": {
"enabled": true,
"repositories": [
"<string>"
]
},
"buildFixSchedule": "off"
})
});
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://context7.com/api/v2/teamspaces/{teamspaceId}/sites/{siteId}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_POSTFIELDS => '{
"hosting": "on",
"slug": "<string>",
"analyticsUrl": "<string>",
"customDomain": "<string>",
"customDomainPath": "<string>",
"customDomainRouting": "dns",
"branch": "<string>",
"docsPath": "<string>",
"context7Index": true,
"improveSchedule": "off",
"pullRequestReview": {
"enabled": true,
"response": "comment"
},
"codeWatch": {
"enabled": true,
"repositories": [
"<string>"
]
},
"buildFixSchedule": "off"
}',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer <token>',
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "https://context7.com/api/v2/teamspaces/{teamspaceId}/sites/{siteId}"
payload := strings.NewReader("{\n \"hosting\": \"on\",\n \"slug\": \"<string>\",\n \"analyticsUrl\": \"<string>\",\n \"customDomain\": \"<string>\",\n \"customDomainPath\": \"<string>\",\n \"customDomainRouting\": \"dns\",\n \"branch\": \"<string>\",\n \"docsPath\": \"<string>\",\n \"context7Index\": true,\n \"improveSchedule\": \"off\",\n \"pullRequestReview\": {\n \"enabled\": true,\n \"response\": \"comment\"\n },\n \"codeWatch\": {\n \"enabled\": true,\n \"repositories\": [\n \"<string>\"\n ]\n },\n \"buildFixSchedule\": \"off\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://context7.com/api/v2/teamspaces/{teamspaceId}/sites/{siteId}"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"hosting\": \"on\",\n \"slug\": \"<string>\",\n \"analyticsUrl\": \"<string>\",\n \"customDomain\": \"<string>\",\n \"customDomainPath\": \"<string>\",\n \"customDomainRouting\": \"dns\",\n \"branch\": \"<string>\",\n \"docsPath\": \"<string>\",\n \"context7Index\": true,\n \"improveSchedule\": \"off\",\n \"pullRequestReview\": {\n \"enabled\": true,\n \"response\": \"comment\"\n },\n \"codeWatch\": {\n \"enabled\": true,\n \"repositories\": [\n \"<string>\"\n ]\n },\n \"buildFixSchedule\": \"off\"\n}"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'uri'
require 'net/http'
url = URI('https://context7.com/api/v2/teamspaces/{teamspaceId}/sites/{siteId}')
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = url.scheme == 'https'
request = Net::HTTP::Patch.new(url)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = '{
"hosting": "on",
"slug": "<string>",
"analyticsUrl": "<string>",
"customDomain": "<string>",
"customDomainPath": "<string>",
"customDomainRouting": "dns",
"branch": "<string>",
"docsPath": "<string>",
"context7Index": true,
"improveSchedule": "off",
"pullRequestReview": {
"enabled": true,
"response": "comment"
},
"codeWatch": {
"enabled": true,
"repositories": [
"<string>"
]
},
"buildFixSchedule": "off"
}'
response = http.request(request)
puts response.read_body