curl --request POST \
--url https://versuno.ai/api/public/brains/{id}/query \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "How do I set up dynamic routes?"
}
'import requests
url = "https://versuno.ai/api/public/brains/{id}/query"
payload = { "query": "How do I set up dynamic routes?" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'How do I set up dynamic routes?'})
};
fetch('https://versuno.ai/api/public/brains/{id}/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://versuno.ai/api/public/brains/{id}/query"
payload := strings.NewReader("{\n \"query\": \"How do I set up dynamic routes?\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://versuno.ai/api/public/brains/{id}/query",
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([
'query' => 'How do I set up dynamic routes?'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://versuno.ai/api/public/brains/{id}/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"How do I set up dynamic routes?\"\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://versuno.ai/api/public/brains/{id}/query")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"How do I set up dynamic routes?\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://versuno.ai/api/public/brains/{id}/query");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"query\": \"How do I set up dynamic routes?\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);{
"success": true,
"data": {
"objects": {
"chunks": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "chunk",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"container_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brain_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"page_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"canonical": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
],
"chunk_parts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "chunk_part",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"container_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brain_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "Dynamic segments are passed as the params prop...",
"relevancy_score": 0.82,
"metadata": {
"num": 2
},
"created_at": "<string>",
"updated_at": "<string>"
}
],
"pages": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "page",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"container_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brain_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"canonical": "<string>",
"metadata": {
"urlGroup": [
"<string>"
]
},
"created_at": "<string>",
"updated_at": "<string>"
}
]
},
"graph_tree": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"children": "<array>"
}
],
"graph_context": {
"relations": {}
}
},
"error": null,
"metadata": {
"query_latency_ms": 142,
"embedding_latency_ms": 88
}
}{
"error": "Wrong data: assetType is required"
}{
"error": "Invalid API key"
}Query a brain
Runs a semantic (RAG) search over a brain and returns the most relevant pages, chunks, and chunk parts, plus the graph relations between them.
This query runs under a shared Versuno service identity, not your API key’s personal scope. It can therefore resolve any public brain by ID. (The read endpoints, by contrast, use your own access and can also see your private brains.)
This endpoint is metered — each call counts against your brain-query usage. Running the interactive example below will consume quota.
Always returns HTTP 200; inspect success and error in the response envelope to detect failures.
curl --request POST \
--url https://versuno.ai/api/public/brains/{id}/query \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "How do I set up dynamic routes?"
}
'import requests
url = "https://versuno.ai/api/public/brains/{id}/query"
payload = { "query": "How do I set up dynamic routes?" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: 'How do I set up dynamic routes?'})
};
fetch('https://versuno.ai/api/public/brains/{id}/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://versuno.ai/api/public/brains/{id}/query"
payload := strings.NewReader("{\n \"query\": \"How do I set up dynamic routes?\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://versuno.ai/api/public/brains/{id}/query",
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([
'query' => 'How do I set up dynamic routes?'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://versuno.ai/api/public/brains/{id}/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"How do I set up dynamic routes?\"\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://versuno.ai/api/public/brains/{id}/query")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"How do I set up dynamic routes?\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://versuno.ai/api/public/brains/{id}/query");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"query\": \"How do I set up dynamic routes?\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);{
"success": true,
"data": {
"objects": {
"chunks": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "chunk",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"container_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brain_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"page_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"canonical": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
],
"chunk_parts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "chunk_part",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"container_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brain_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "Dynamic segments are passed as the params prop...",
"relevancy_score": 0.82,
"metadata": {
"num": 2
},
"created_at": "<string>",
"updated_at": "<string>"
}
],
"pages": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "page",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"container_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brain_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"canonical": "<string>",
"metadata": {
"urlGroup": [
"<string>"
]
},
"created_at": "<string>",
"updated_at": "<string>"
}
]
},
"graph_tree": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"children": "<array>"
}
],
"graph_context": {
"relations": {}
}
},
"error": null,
"metadata": {
"query_latency_ms": 142,
"embedding_latency_ms": 88
}
}{
"error": "Wrong data: assetType is required"
}{
"error": "Invalid API key"
}Authorizations
Versuno API key. Must be prefixed with Bearer. Format: Bearer uk_live_...
Path Parameters
ID of the brain to query.
Body
The natural-language query to search the brain with.
1 - 4000"How do I set up dynamic routes?"
Optional list of entity names to bias the search toward.
["routing", "app-router"]Maximum number of results to return (1–20, default 5).
1 <= x <= 205
Response
Query result envelope. Check success to determine if the query actually succeeded.
Result envelope for a brain query. Always returned with HTTP 200; check success and error.
Whether the query succeeded. Inspect this rather than the HTTP status.
true
Query result payload, or null when success is false.
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
chunk Hide child attributes
Hide child attributes
chunk_part The text content of this part.
"Dynamic segments are passed as the params prop..."
Similarity score against the query, 0–1.
0 <= x <= 10.82
Hide child attributes
Hide child attributes
page Hide child attributes
Hide child attributes
Map of object ID to its outgoing relations.
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Error message when success is false, otherwise null.
null
Was this page helpful?

