curl --request POST \
--url https://context7.com/api/v2/teamspaces/{teamspaceId}/ask-sites/{siteKey}/verify \
--header 'Authorization: Bearer <token>'import requests
url = "https://context7.com/api/v2/teamspaces/{teamspaceId}/ask-sites/{siteKey}/verify"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://context7.com/api/v2/teamspaces/{teamspaceId}/ask-sites/{siteKey}/verify', 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}/ask-sites/{siteKey}/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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}/ask-sites/{siteKey}/verify"
req, _ := http.NewRequest("POST", 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.post("https://context7.com/api/v2/teamspaces/{teamspaceId}/ask-sites/{siteKey}/verify")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://context7.com/api/v2/teamspaces/{teamspaceId}/ask-sites/{siteKey}/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"verified": true,
"data": {
"siteKey": "ask_0123456789abcdef01234567",
"url": "https://docs.example.com",
"hostname": "docs.example.com",
"verification": {
"kind": "pending"
},
"indexStatus": {
"kind": "pending"
},
"verificationTag": "<meta name=\"context7-site-verification\" content=\"ask_0123456789abcdef01234567\">",
"snippet": "<string>",
"markdown": "<string>",
"endpoint": "https://context7.com/api/v2/ask?siteKey=ask_0123456789abcdef01234567"
}
}{
"error": "invalid_teamspace",
"message": "Invalid teamspace id"
}{
"error": "invalid_api_key",
"message": "Invalid API key. Please check your API key. API keys should start with 'ctx7sk' prefix."
}{
"error": "forbidden",
"message": "Only owners and admins can change this."
}{
"error": "no_site",
"message": "Site not found."
}{
"error": "site_changed",
"message": "The site changed during the check. Try again."
}{
"error": "internal_error",
"message": "An error occurred while processing your request"
}Verify an Ask site
Fetch the site’s URL and look for the verification tag in <head> and the note (with this site’s endpoint) in <body>; both are required. A site that does not verify is not an error: the response is 200 with verified: false and the reason in data.verification.reason. A verified site stays verified. Verification starts indexing the site into Context7 in the background; read data.indexStatus (or get the site) to follow it. Calling verify again after a failed index starts a new one. Owner or admin.
curl --request POST \
--url https://context7.com/api/v2/teamspaces/{teamspaceId}/ask-sites/{siteKey}/verify \
--header 'Authorization: Bearer <token>'import requests
url = "https://context7.com/api/v2/teamspaces/{teamspaceId}/ask-sites/{siteKey}/verify"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://context7.com/api/v2/teamspaces/{teamspaceId}/ask-sites/{siteKey}/verify', 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}/ask-sites/{siteKey}/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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}/ask-sites/{siteKey}/verify"
req, _ := http.NewRequest("POST", 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.post("https://context7.com/api/v2/teamspaces/{teamspaceId}/ask-sites/{siteKey}/verify")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://context7.com/api/v2/teamspaces/{teamspaceId}/ask-sites/{siteKey}/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"verified": true,
"data": {
"siteKey": "ask_0123456789abcdef01234567",
"url": "https://docs.example.com",
"hostname": "docs.example.com",
"verification": {
"kind": "pending"
},
"indexStatus": {
"kind": "pending"
},
"verificationTag": "<meta name=\"context7-site-verification\" content=\"ask_0123456789abcdef01234567\">",
"snippet": "<string>",
"markdown": "<string>",
"endpoint": "https://context7.com/api/v2/ask?siteKey=ask_0123456789abcdef01234567"
}
}{
"error": "invalid_teamspace",
"message": "Invalid teamspace id"
}{
"error": "invalid_api_key",
"message": "Invalid API key. Please check your API key. API keys should start with 'ctx7sk' prefix."
}{
"error": "forbidden",
"message": "Only owners and admins can change this."
}{
"error": "no_site",
"message": "Site not found."
}{
"error": "site_changed",
"message": "The site changed during the check. Try again."
}{
"error": "internal_error",
"message": "An error occurred while processing your request"
}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).
The site's public key, which is also its id.
^ask_[0-9a-f]{24}$Was this page helpful?