Index Document
curl --request POST \
--url https://api.wistx.ai/v1/indexing/documents \
--header 'Content-Type: application/json' \
--data '
{
"content_url": "<string>",
"name": "<string>",
"description": "<string>",
"tags": {},
"include_patterns": {},
"exclude_patterns": {}
}
'import requests
url = "https://api.wistx.ai/v1/indexing/documents"
payload = {
"content_url": "<string>",
"name": "<string>",
"description": "<string>",
"tags": {},
"include_patterns": {},
"exclude_patterns": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
content_url: '<string>',
name: '<string>',
description: '<string>',
tags: {},
include_patterns: {},
exclude_patterns: {}
})
};
fetch('https://api.wistx.ai/v1/indexing/documents', 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://api.wistx.ai/v1/indexing/documents",
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([
'content_url' => '<string>',
'name' => '<string>',
'description' => '<string>',
'tags' => [
],
'include_patterns' => [
],
'exclude_patterns' => [
]
]),
CURLOPT_HTTPHEADER => [
"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://api.wistx.ai/v1/indexing/documents"
payload := strings.NewReader("{\n \"content_url\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": {},\n \"include_patterns\": {},\n \"exclude_patterns\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.wistx.ai/v1/indexing/documents")
.header("Content-Type", "application/json")
.body("{\n \"content_url\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": {},\n \"include_patterns\": {},\n \"exclude_patterns\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wistx.ai/v1/indexing/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"content_url\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": {},\n \"include_patterns\": {},\n \"exclude_patterns\": {}\n}"
response = http.request(request)
puts response.read_body{
"resource_id": "res_abc123",
"status": "pending",
"progress": {
"percentage": 0,
"stage": "queued",
"message": "Documentation indexing queued"
},
"message": "Documentation indexing started"
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": "content_url is required"
},
"metadata": {
"request_id": "req_abc123",
"timestamp": 1704067200.0
}
}
{
"detail": "User ID not found"
}
{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "Indexing quota exceeded",
"details": {
"limit_type": "indexes_per_month",
"current": 3,
"limit": 3
}
},
"metadata": {
"request_id": "req_abc123",
"timestamp": 1704067200.0
}
}
{
"error": {
"code": "INDEXING_ERROR",
"message": "Failed to start documentation indexing",
"details": null
},
"metadata": {
"request_id": "req_abc123",
"timestamp": 1704067200.0
}
}
Indexing
Index Document
Index a single document file for user-specific search
POST
/
v1
/
indexing
/
documents
Index Document
curl --request POST \
--url https://api.wistx.ai/v1/indexing/documents \
--header 'Content-Type: application/json' \
--data '
{
"content_url": "<string>",
"name": "<string>",
"description": "<string>",
"tags": {},
"include_patterns": {},
"exclude_patterns": {}
}
'import requests
url = "https://api.wistx.ai/v1/indexing/documents"
payload = {
"content_url": "<string>",
"name": "<string>",
"description": "<string>",
"tags": {},
"include_patterns": {},
"exclude_patterns": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
content_url: '<string>',
name: '<string>',
description: '<string>',
tags: {},
include_patterns: {},
exclude_patterns: {}
})
};
fetch('https://api.wistx.ai/v1/indexing/documents', 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://api.wistx.ai/v1/indexing/documents",
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([
'content_url' => '<string>',
'name' => '<string>',
'description' => '<string>',
'tags' => [
],
'include_patterns' => [
],
'exclude_patterns' => [
]
]),
CURLOPT_HTTPHEADER => [
"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://api.wistx.ai/v1/indexing/documents"
payload := strings.NewReader("{\n \"content_url\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": {},\n \"include_patterns\": {},\n \"exclude_patterns\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.wistx.ai/v1/indexing/documents")
.header("Content-Type", "application/json")
.body("{\n \"content_url\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": {},\n \"include_patterns\": {},\n \"exclude_patterns\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wistx.ai/v1/indexing/documents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"content_url\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": {},\n \"include_patterns\": {},\n \"exclude_patterns\": {}\n}"
response = http.request(request)
puts response.read_body{
"resource_id": "res_abc123",
"status": "pending",
"progress": {
"percentage": 0,
"stage": "queued",
"message": "Documentation indexing queued"
},
"message": "Documentation indexing started"
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": "content_url is required"
},
"metadata": {
"request_id": "req_abc123",
"timestamp": 1704067200.0
}
}
{
"detail": "User ID not found"
}
{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "Indexing quota exceeded",
"details": {
"limit_type": "indexes_per_month",
"current": 3,
"limit": 3
}
},
"metadata": {
"request_id": "req_abc123",
"timestamp": 1704067200.0
}
}
{
"error": {
"code": "INDEXING_ERROR",
"message": "Failed to start documentation indexing",
"details": null
},
"metadata": {
"request_id": "req_abc123",
"timestamp": 1704067200.0
}
}
Index a single document file (PDF, DOCX, Markdown, TXT) for user-specific search
curl --request POST \
--url https://api.wistx.ai/v1/indexing/documents \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"content_url": "https://docs.example.com",
"name": "Example Documentation",
"description": "Product documentation",
"tags": ["docs", "api"],
"include_patterns": ["/docs/", "/api/"],
"exclude_patterns": ["/admin/", "/private/"]
}'
import requests
api_key = "YOUR_API_KEY"
url = "https://api.wistx.ai/v1/indexing/documentation"
response = requests.post(
url,
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
},
json={
"content_url": "https://docs.example.com",
"name": "Example Documentation",
"description": "Product documentation",
"tags": ["docs", "api"],
"include_patterns": ["/docs/", "/api/"],
"exclude_patterns": ["/admin/", "/private/"]
}
)
data = response.json()
print(f"Documentation indexing started: {data['resource_id']}")
const apiKey = "YOUR_API_KEY";
const url = "https://api.wistx.ai/v1/indexing/documentation";
const response = await fetch(url, {
method: "POST",
headers: {
"Authorization": `Bearer ${apiKey}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
content_url: "https://docs.example.com",
name: "Example Documentation",
description: "Product documentation",
tags: ["docs", "api"],
include_patterns: ["/docs/", "/api/"],
exclude_patterns: ["/admin/", "/private/"]
})
});
const data = await response.json();
console.log(`Documentation indexing started: ${data.resource_id}`);
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
apiKey := "YOUR_API_KEY"
url := "https://api.wistx.ai/v1/indexing/documentation"
payload := map[string]interface{}{
"content_url": "https://docs.example.com",
"name": "Example Documentation",
"description": "Product documentation",
"tags": []string{"docs", "api"},
"include_patterns": []string{"/docs/", "/api/"},
"exclude_patterns": []string{"/admin/", "/private/"},
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("Documentation indexing started: %v\n", result["resource_id"])
}
require 'net/http'
require 'json'
require 'uri'
api_key = "YOUR_API_KEY"
url = URI("https://api.wistx.ai/v1/indexing/documentation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer #{api_key}"
request["Content-Type"] = "application/json"
request.body = {
content_url: "https://docs.example.com",
name: "Example Documentation",
description: "Product documentation",
tags: ["docs", "api"],
include_patterns: ["/docs/", "/api/"],
exclude_patterns: ["/admin/", "/private/"]
}.to_json
response = http.request(request)
data = JSON.parse(response.body)
puts "Documentation indexing started: #{data['resource_id']}"
<?php
$apiKey = "YOUR_API_KEY";
$url = "https://api.wistx.ai/v1/indexing/documentation";
$data = [
"content_url" => "https://docs.example.com",
"name" => "Example Documentation",
"description" => "Product documentation",
"tags" => ["docs", "api"],
"include_patterns" => ["/docs/", "/api/"],
"exclude_patterns" => ["/admin/", "/private/"]
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer " . $apiKey,
"Content-Type: application/json"
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
echo "Documentation indexing started: " . $data['resource_id'];
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.OutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
public class IndexDocumentation {
public static void main(String[] args) throws Exception {
String apiKey = "YOUR_API_KEY";
URL url = new URL("https://api.wistx.ai/v1/indexing/documentation");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Authorization", "Bearer " + apiKey);
conn.setRequestProperty("Content-Type", "application/json");
conn.setDoOutput(true);
JsonObject payload = new JsonObject();
payload.addProperty("content_url", "https://docs.example.com");
payload.addProperty("name", "Example Documentation");
payload.addProperty("description", "Product documentation");
Gson gson = new Gson();
String[] tags = {"docs", "api"};
String[] includePatterns = {"/docs/", "/api/"};
String[] excludePatterns = {"/admin/", "/private/"};
payload.add("tags", gson.toJsonTree(tags));
payload.add("include_patterns", gson.toJsonTree(includePatterns));
payload.add("exclude_patterns", gson.toJsonTree(excludePatterns));
try (OutputStream os = conn.getOutputStream()) {
byte[] input = gson.toJson(payload).getBytes("utf-8");
os.write(input, 0, input.length);
}
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
System.out.println(response.toString());
}
}
Request Parameters
string
required
Documentation website URL to crawl and index.
string
Custom name for the resource.
string
Description of the documentation.
array[string]
Tags for categorization.
array[string]
URL patterns to include (e.g.,
["/docs/", "/api/"]).array[string]
URL patterns to exclude (e.g.,
["/admin/", "/private/"]).Response
{
"resource_id": "res_abc123",
"status": "pending",
"progress": {
"percentage": 0,
"stage": "queued",
"message": "Documentation indexing queued"
},
"message": "Documentation indexing started"
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": "content_url is required"
},
"metadata": {
"request_id": "req_abc123",
"timestamp": 1704067200.0
}
}
{
"detail": "User ID not found"
}
{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "Indexing quota exceeded",
"details": {
"limit_type": "indexes_per_month",
"current": 3,
"limit": 3
}
},
"metadata": {
"request_id": "req_abc123",
"timestamp": 1704067200.0
}
}
{
"error": {
"code": "INDEXING_ERROR",
"message": "Failed to start documentation indexing",
"details": null
},
"metadata": {
"request_id": "req_abc123",
"timestamp": 1704067200.0
}
}