API Reference
Create and crawl a managed knowledge website
Create the existing website group and enqueue its first crawl. Prefer this for multi-page websites with later refresh/selection management. Default depth two, maximum ten; page budget defaults/maxes to five hundred. Optional propertyId from list_properties, otherwise global. Return website.websiteId and job.jobId; use get_knowledge_crawl until terminal status, then get_knowledge_website and get_knowledge_usage. 202 means queued, not indexed/active. After an ambiguous failure discover the website/job before retrying. Required permission: knowledge:write. Connected business only; no tenant override.
POST
/
knowledge
/
websites
Create and crawl a managed knowledge website
curl --request POST \
--url https://platform-api.visitoai.com/m2m/v1/knowledge/websites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"crawlDepth": 5,
"maxPages": 250,
"propertyId": "<string>"
}
'import requests
url = "https://platform-api.visitoai.com/m2m/v1/knowledge/websites"
payload = {
"url": "<string>",
"crawlDepth": 5,
"maxPages": 250,
"propertyId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', crawlDepth: 5, maxPages: 250, propertyId: '<string>'})
};
fetch('https://platform-api.visitoai.com/m2m/v1/knowledge/websites', 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://platform-api.visitoai.com/m2m/v1/knowledge/websites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'crawlDepth' => 5,
'maxPages' => 250,
'propertyId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://platform-api.visitoai.com/m2m/v1/knowledge/websites"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"crawlDepth\": 5,\n \"maxPages\": 250,\n \"propertyId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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))
}HttpResponse<String> response = Unirest.post("https://platform-api.visitoai.com/m2m/v1/knowledge/websites")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"crawlDepth\": 5,\n \"maxPages\": 250,\n \"propertyId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform-api.visitoai.com/m2m/v1/knowledge/websites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"crawlDepth\": 5,\n \"maxPages\": 250,\n \"propertyId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"website": {
"websiteId": "<string>",
"sourceId": "<string>",
"sourceType": "website",
"active": true,
"scope": "property",
"title": "<string>",
"url": "<string>",
"chunkCount": 1,
"rootUrl": "<string>",
"normalizedRootUrl": "<string>",
"crawlDepth": 5,
"maxPages": 250,
"status": "idle",
"defaultEnabled": true,
"selectionRules": [
{
"kind": "path",
"key": "<string>",
"enabled": true
}
],
"totalPages": 1,
"enabledPages": 1,
"activeTokens": 1,
"selectedTokens": 1,
"createdBy": {
"id": "<string>",
"displayName": "<string>",
"email": "<string>"
},
"propertyId": "<string>",
"propertyName": "<string>",
"currentGenerationId": "<string>",
"latestJob": {
"jobId": "<string>",
"status": "queued",
"progress": {
"phase": "queued",
"pagesDiscovered": 123,
"pagesProcessed": 123,
"chunksEmbedded": 123
},
"chunks": 123,
"url": "<string>",
"crawlDepth": 123,
"maxPages": 123,
"sourceId": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"websiteId": "<string>",
"websiteGenerationId": "<string>",
"createdAt": "<string>",
"startedAt": "<string>",
"completedAt": "<string>",
"updatedAt": "<string>",
"snapshotPages": 1
},
"pages": [
{
"sourceId": "<string>",
"url": "<string>",
"canonicalUrl": "<string>",
"path": "<string>",
"enabled": true,
"chunkCount": 1,
"tokens": 1,
"displayOrder": 1,
"updatedAt": "<string>"
}
],
"createdAt": "<string>",
"updatedAt": "<string>",
"lastCrawledAt": "<string>"
},
"job": {
"jobId": "<string>",
"status": "queued",
"progress": {
"phase": "queued",
"pagesDiscovered": 123,
"pagesProcessed": 123,
"chunksEmbedded": 123
},
"chunks": 123,
"url": "<string>",
"crawlDepth": 123,
"maxPages": 123,
"sourceId": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"websiteId": "<string>",
"websiteGenerationId": "<string>",
"createdAt": "<string>",
"startedAt": "<string>",
"completedAt": "<string>",
"updatedAt": "<string>",
"snapshotPages": 1
}
}Authorizations
Server-side tenant-scoped credential created from Build > API Keys.
Body
application/json
⌘I
Create and crawl a managed knowledge website
curl --request POST \
--url https://platform-api.visitoai.com/m2m/v1/knowledge/websites \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"crawlDepth": 5,
"maxPages": 250,
"propertyId": "<string>"
}
'import requests
url = "https://platform-api.visitoai.com/m2m/v1/knowledge/websites"
payload = {
"url": "<string>",
"crawlDepth": 5,
"maxPages": 250,
"propertyId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: '<string>', crawlDepth: 5, maxPages: 250, propertyId: '<string>'})
};
fetch('https://platform-api.visitoai.com/m2m/v1/knowledge/websites', 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://platform-api.visitoai.com/m2m/v1/knowledge/websites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'crawlDepth' => 5,
'maxPages' => 250,
'propertyId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://platform-api.visitoai.com/m2m/v1/knowledge/websites"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"crawlDepth\": 5,\n \"maxPages\": 250,\n \"propertyId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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))
}HttpResponse<String> response = Unirest.post("https://platform-api.visitoai.com/m2m/v1/knowledge/websites")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"crawlDepth\": 5,\n \"maxPages\": 250,\n \"propertyId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform-api.visitoai.com/m2m/v1/knowledge/websites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"crawlDepth\": 5,\n \"maxPages\": 250,\n \"propertyId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"website": {
"websiteId": "<string>",
"sourceId": "<string>",
"sourceType": "website",
"active": true,
"scope": "property",
"title": "<string>",
"url": "<string>",
"chunkCount": 1,
"rootUrl": "<string>",
"normalizedRootUrl": "<string>",
"crawlDepth": 5,
"maxPages": 250,
"status": "idle",
"defaultEnabled": true,
"selectionRules": [
{
"kind": "path",
"key": "<string>",
"enabled": true
}
],
"totalPages": 1,
"enabledPages": 1,
"activeTokens": 1,
"selectedTokens": 1,
"createdBy": {
"id": "<string>",
"displayName": "<string>",
"email": "<string>"
},
"propertyId": "<string>",
"propertyName": "<string>",
"currentGenerationId": "<string>",
"latestJob": {
"jobId": "<string>",
"status": "queued",
"progress": {
"phase": "queued",
"pagesDiscovered": 123,
"pagesProcessed": 123,
"chunksEmbedded": 123
},
"chunks": 123,
"url": "<string>",
"crawlDepth": 123,
"maxPages": 123,
"sourceId": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"websiteId": "<string>",
"websiteGenerationId": "<string>",
"createdAt": "<string>",
"startedAt": "<string>",
"completedAt": "<string>",
"updatedAt": "<string>",
"snapshotPages": 1
},
"pages": [
{
"sourceId": "<string>",
"url": "<string>",
"canonicalUrl": "<string>",
"path": "<string>",
"enabled": true,
"chunkCount": 1,
"tokens": 1,
"displayOrder": 1,
"updatedAt": "<string>"
}
],
"createdAt": "<string>",
"updatedAt": "<string>",
"lastCrawledAt": "<string>"
},
"job": {
"jobId": "<string>",
"status": "queued",
"progress": {
"phase": "queued",
"pagesDiscovered": 123,
"pagesProcessed": 123,
"chunksEmbedded": 123
},
"chunks": 123,
"url": "<string>",
"crawlDepth": 123,
"maxPages": 123,
"sourceId": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"websiteId": "<string>",
"websiteGenerationId": "<string>",
"createdAt": "<string>",
"startedAt": "<string>",
"completedAt": "<string>",
"updatedAt": "<string>",
"snapshotPages": 1
}
}