curl --request POST \
--url https://api.vainona.ai/v1/namespaces/{ns}/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filters": {},
"rank_by": [
null
],
"top_k": 500,
"cursor": "<string>",
"include": {
"attributes": [
"<string>"
],
"answers": [
"<string>"
],
"state": true
},
"answers": "any",
"consistency": "strong"
}
'import requests
url = "https://api.vainona.ai/v1/namespaces/{ns}/query"
payload = {
"filters": {},
"rank_by": [None],
"top_k": 500,
"cursor": "<string>",
"include": {
"attributes": ["<string>"],
"answers": ["<string>"],
"state": True
},
"answers": "any",
"consistency": "strong"
}
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({
filters: {},
rank_by: [null],
top_k: 500,
cursor: '<string>',
include: {attributes: ['<string>'], answers: ['<string>'], state: true},
answers: 'any',
consistency: 'strong'
})
};
fetch('https://api.vainona.ai/v1/namespaces/{ns}/query', 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.vainona.ai/v1/namespaces/{ns}/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([
'filters' => [
],
'rank_by' => [
null
],
'top_k' => 500,
'cursor' => '<string>',
'include' => [
'attributes' => [
'<string>'
],
'answers' => [
'<string>'
],
'state' => true
],
'answers' => 'any',
'consistency' => 'strong'
]),
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://api.vainona.ai/v1/namespaces/{ns}/query"
payload := strings.NewReader("{\n \"filters\": {},\n \"rank_by\": [\n null\n ],\n \"top_k\": 500,\n \"cursor\": \"<string>\",\n \"include\": {\n \"attributes\": [\n \"<string>\"\n ],\n \"answers\": [\n \"<string>\"\n ],\n \"state\": true\n },\n \"answers\": \"any\",\n \"consistency\": \"strong\"\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://api.vainona.ai/v1/namespaces/{ns}/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filters\": {},\n \"rank_by\": [\n null\n ],\n \"top_k\": 500,\n \"cursor\": \"<string>\",\n \"include\": {\n \"attributes\": [\n \"<string>\"\n ],\n \"answers\": [\n \"<string>\"\n ],\n \"state\": true\n },\n \"answers\": \"any\",\n \"consistency\": \"strong\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vainona.ai/v1/namespaces/{ns}/query")
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 \"filters\": {},\n \"rank_by\": [\n null\n ],\n \"top_k\": 500,\n \"cursor\": \"<string>\",\n \"include\": {\n \"attributes\": [\n \"<string>\"\n ],\n \"answers\": [\n \"<string>\"\n ],\n \"state\": true\n },\n \"answers\": \"any\",\n \"consistency\": \"strong\"\n}"
response = http.request(request)
puts response.read_body{
"rows": [
{
"id": "<string>",
"revision": 1,
"attributes": {},
"answers": {},
"state": {}
}
],
"next_cursor": "<string>",
"more": true,
"usage": {
"bytes_written": 1,
"bytes_scanned": 1,
"judgment_units": 1,
"tokens_evaluated": 1
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Filter, rank and page documents
See §6.8. A query whose estimated scan exceeds 4 GB is refused with
too_large and the estimate, and is not billed. Filtering or ranking on
an on_read judgment is invalid_request.
curl --request POST \
--url https://api.vainona.ai/v1/namespaces/{ns}/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filters": {},
"rank_by": [
null
],
"top_k": 500,
"cursor": "<string>",
"include": {
"attributes": [
"<string>"
],
"answers": [
"<string>"
],
"state": true
},
"answers": "any",
"consistency": "strong"
}
'import requests
url = "https://api.vainona.ai/v1/namespaces/{ns}/query"
payload = {
"filters": {},
"rank_by": [None],
"top_k": 500,
"cursor": "<string>",
"include": {
"attributes": ["<string>"],
"answers": ["<string>"],
"state": True
},
"answers": "any",
"consistency": "strong"
}
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({
filters: {},
rank_by: [null],
top_k: 500,
cursor: '<string>',
include: {attributes: ['<string>'], answers: ['<string>'], state: true},
answers: 'any',
consistency: 'strong'
})
};
fetch('https://api.vainona.ai/v1/namespaces/{ns}/query', 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.vainona.ai/v1/namespaces/{ns}/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([
'filters' => [
],
'rank_by' => [
null
],
'top_k' => 500,
'cursor' => '<string>',
'include' => [
'attributes' => [
'<string>'
],
'answers' => [
'<string>'
],
'state' => true
],
'answers' => 'any',
'consistency' => 'strong'
]),
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://api.vainona.ai/v1/namespaces/{ns}/query"
payload := strings.NewReader("{\n \"filters\": {},\n \"rank_by\": [\n null\n ],\n \"top_k\": 500,\n \"cursor\": \"<string>\",\n \"include\": {\n \"attributes\": [\n \"<string>\"\n ],\n \"answers\": [\n \"<string>\"\n ],\n \"state\": true\n },\n \"answers\": \"any\",\n \"consistency\": \"strong\"\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://api.vainona.ai/v1/namespaces/{ns}/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filters\": {},\n \"rank_by\": [\n null\n ],\n \"top_k\": 500,\n \"cursor\": \"<string>\",\n \"include\": {\n \"attributes\": [\n \"<string>\"\n ],\n \"answers\": [\n \"<string>\"\n ],\n \"state\": true\n },\n \"answers\": \"any\",\n \"consistency\": \"strong\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vainona.ai/v1/namespaces/{ns}/query")
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 \"filters\": {},\n \"rank_by\": [\n null\n ],\n \"top_k\": 500,\n \"cursor\": \"<string>\",\n \"include\": {\n \"attributes\": [\n \"<string>\"\n ],\n \"answers\": [\n \"<string>\"\n ],\n \"state\": true\n },\n \"answers\": \"any\",\n \"consistency\": \"strong\"\n}"
response = http.request(request)
puts response.read_body{
"rows": [
{
"id": "<string>",
"revision": 1,
"attributes": {},
"answers": {},
"state": {}
}
],
"next_cursor": "<string>",
"more": true,
"usage": {
"bytes_written": 1,
"bytes_scanned": 1,
"judgment_units": 1,
"tokens_evaluated": 1
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {}
}
}Authorizations
An organization API key. Keys carry a role (read_write or
read_only) and may be restricted to a namespace prefix such as
acme/*, or to one namespace such as acme/prod/tenant_1. A prefix
matches on a / boundary: acme/prod/tenant_1* covers
acme/prod/tenant_1 and everything under acme/prod/tenant_1/,
never acme/prod/tenant_12.
Path Parameters
The namespace name, with any / sent as %2F.
Up to 256 bytes. / separates levels of the hierarchy, as in acme/prod/tenant_123.
1 - 256^[A-Za-z0-9._:/-]+$Body
[field, op, value], ["And" | "Or", [filters]] or ["Not", filter].
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
Show child attributes
Show child attributes
One field and a direction. Ties are broken by id.
Show child attributes
Show child attributes
1 <= x <= 1000The previous page's next_cursor. Valid for 10 minutes; pins the manifest so pages are consistent.
Show child attributes
Show child attributes
fresh_only excludes rows whose included answers are not fresh.
any, fresh_only eventual may serve a cached manifest up to 60 seconds old.
strong, eventual