curl --request POST \
--url https://cloud.onyx.app/api/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"sources": [],
"document_sets": [
"<string>"
],
"tags": [
{
"tag_key": "<string>",
"tag_value": "<string>"
}
],
"time_cutoff": "2023-11-07T05:31:56Z",
"persona_id": 123,
"provider": "<string>",
"model": "<string>",
"skip_query_expansion": false,
"message_history": [
{
"message": "<string>"
}
]
}
'import requests
url = "https://cloud.onyx.app/api/search"
payload = {
"query": "<string>",
"sources": [],
"document_sets": ["<string>"],
"tags": [
{
"tag_key": "<string>",
"tag_value": "<string>"
}
],
"time_cutoff": "2023-11-07T05:31:56Z",
"persona_id": 123,
"provider": "<string>",
"model": "<string>",
"skip_query_expansion": False,
"message_history": [{ "message": "<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({
query: '<string>',
sources: [],
document_sets: ['<string>'],
tags: [{tag_key: '<string>', tag_value: '<string>'}],
time_cutoff: '2023-11-07T05:31:56Z',
persona_id: 123,
provider: '<string>',
model: '<string>',
skip_query_expansion: false,
message_history: [{message: '<string>'}]
})
};
fetch('https://cloud.onyx.app/api/search', 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://cloud.onyx.app/api/search",
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' => '<string>',
'sources' => [
],
'document_sets' => [
'<string>'
],
'tags' => [
[
'tag_key' => '<string>',
'tag_value' => '<string>'
]
],
'time_cutoff' => '2023-11-07T05:31:56Z',
'persona_id' => 123,
'provider' => '<string>',
'model' => '<string>',
'skip_query_expansion' => false,
'message_history' => [
[
'message' => '<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://cloud.onyx.app/api/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"sources\": [],\n \"document_sets\": [\n \"<string>\"\n ],\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"persona_id\": 123,\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"skip_query_expansion\": false,\n \"message_history\": [\n {\n \"message\": \"<string>\"\n }\n ]\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://cloud.onyx.app/api/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"sources\": [],\n \"document_sets\": [\n \"<string>\"\n ],\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"persona_id\": 123,\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"skip_query_expansion\": false,\n \"message_history\": [\n {\n \"message\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.onyx.app/api/search")
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 \"query\": \"<string>\",\n \"sources\": [],\n \"document_sets\": [\n \"<string>\"\n ],\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"persona_id\": 123,\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"skip_query_expansion\": false,\n \"message_history\": [\n {\n \"message\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"citation_id": 123,
"title": "<string>",
"content": "<string>",
"link": "<string>",
"source_type": "<string>",
"updated_at": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Search
Run Onyx’s internal search and get back ranked document sections, with no LLM answer generated.
This is the same multi-stage retrieval pipeline the chat Search action uses: query expansion, hybrid retrieval, reranking and section merging. Results are ordered most relevant first and are always filtered by the calling user’s document permissions.
curl --request POST \
--url https://cloud.onyx.app/api/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"sources": [],
"document_sets": [
"<string>"
],
"tags": [
{
"tag_key": "<string>",
"tag_value": "<string>"
}
],
"time_cutoff": "2023-11-07T05:31:56Z",
"persona_id": 123,
"provider": "<string>",
"model": "<string>",
"skip_query_expansion": false,
"message_history": [
{
"message": "<string>"
}
]
}
'import requests
url = "https://cloud.onyx.app/api/search"
payload = {
"query": "<string>",
"sources": [],
"document_sets": ["<string>"],
"tags": [
{
"tag_key": "<string>",
"tag_value": "<string>"
}
],
"time_cutoff": "2023-11-07T05:31:56Z",
"persona_id": 123,
"provider": "<string>",
"model": "<string>",
"skip_query_expansion": False,
"message_history": [{ "message": "<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({
query: '<string>',
sources: [],
document_sets: ['<string>'],
tags: [{tag_key: '<string>', tag_value: '<string>'}],
time_cutoff: '2023-11-07T05:31:56Z',
persona_id: 123,
provider: '<string>',
model: '<string>',
skip_query_expansion: false,
message_history: [{message: '<string>'}]
})
};
fetch('https://cloud.onyx.app/api/search', 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://cloud.onyx.app/api/search",
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' => '<string>',
'sources' => [
],
'document_sets' => [
'<string>'
],
'tags' => [
[
'tag_key' => '<string>',
'tag_value' => '<string>'
]
],
'time_cutoff' => '2023-11-07T05:31:56Z',
'persona_id' => 123,
'provider' => '<string>',
'model' => '<string>',
'skip_query_expansion' => false,
'message_history' => [
[
'message' => '<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://cloud.onyx.app/api/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"sources\": [],\n \"document_sets\": [\n \"<string>\"\n ],\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"persona_id\": 123,\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"skip_query_expansion\": false,\n \"message_history\": [\n {\n \"message\": \"<string>\"\n }\n ]\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://cloud.onyx.app/api/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"sources\": [],\n \"document_sets\": [\n \"<string>\"\n ],\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"persona_id\": 123,\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"skip_query_expansion\": false,\n \"message_history\": [\n {\n \"message\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.onyx.app/api/search")
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 \"query\": \"<string>\",\n \"sources\": [],\n \"document_sets\": [\n \"<string>\"\n ],\n \"tags\": [\n {\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\"\n }\n ],\n \"time_cutoff\": \"2023-11-07T05:31:56Z\",\n \"persona_id\": 123,\n \"provider\": \"<string>\",\n \"model\": \"<string>\",\n \"skip_query_expansion\": false,\n \"message_history\": [\n {\n \"message\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"citation_id": 123,
"title": "<string>",
"content": "<string>",
"link": "<string>",
"source_type": "<string>",
"updated_at": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}read:search), which basic includes, so any signed-in user has it.
A limited Personal Access Token needs the Search — Read scope.DISABLE_VECTOR_DB set (Onyx Lite) answer with 501.Authorizations
Authorization header with Bearer token
Body
The query to search for.
1 - 2048Restrict results to these connector source types.
ingestion_api, slack, web, google_drive, gmail, github, gitbook, gitlab, guru, bookstack, outline, confluence, jira, slab, productboard, file, coda, canvas, notion, zulip, linear, hubspot, document360, gong, google_sites, zendesk, loopio, box, dropbox, sharepoint, teams, salesforce, discourse, axero, clickup, mediawiki, wikipedia, asana, s3, r2, google_cloud_storage, oci_storage, xenforo, not_applicable, discord, freshdesk, fireflies, egnyte, airtable, highspot, drupal_wiki, imap, bitbucket, testrail, braintrust, lumapps, mock_connector, user_file, craft_file Restrict results to documents in these document sets, by name.
Restrict results to documents carrying all of these metadata tags.
Show child attributes
Show child attributes
ISO 8601 timestamp. Only documents updated on or after this moment are returned. Timestamps without a timezone are treated as UTC.
Search as this Agent: its document sets, attached documents and search start date are applied on top of the other filters, and its LLM is used unless provider/model say otherwise.
Name of the LLM provider to use for query expansion and section selection. Must be sent together with model, and the caller must have access to the provider.
Model to use from provider. Must be sent together with provider.
When true, the query is run as written instead of being rewritten and expanded first.
Preceding conversation turns, used to interpret a query that depends on earlier context. Defaults to query on its own.
Show child attributes
Show child attributes
Response
Successful Response
Show child attributes
Show child attributes
Was this page helpful?