Skip to main content
POST
/
query
/
document-search
Handle Search Request
curl --request POST \
  --url https://cloud.onyx.app/api/query/document-search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "message": "<string>",
  "search_type": "keyword",
  "retrieval_options": {
    "chunks_above": 123,
    "chunks_below": 123,
    "full_doc": false,
    "run_search": "auto",
    "real_time": true,
    "filters": {
      "source_type": [
        "ingestion_api"
      ],
      "document_set": [
        "<string>"
      ],
      "time_cutoff": "2023-11-07T05:31:56Z",
      "tags": [
        {
          "tag_key": "<string>",
          "tag_value": "<string>"
        }
      ]
    },
    "enable_auto_detect_filters": true,
    "offset": 123,
    "limit": 123,
    "dedupe_docs": false
  },
  "evaluation_type": "agentic",
  "chunks_above": 123,
  "chunks_below": 123,
  "full_doc": false,
  "recency_bias_multiplier": 1,
  "rerank_settings": {
    "rerank_model_name": "<string>",
    "rerank_api_url": "<string>",
    "rerank_provider_type": "cohere",
    "num_rerank": 123,
    "rerank_api_key": "<string>",
    "disable_rerank_for_streaming": false
  }
}
'
{
  "top_documents": [
    {
      "document_id": "<string>",
      "chunk_ind": 123,
      "semantic_identifier": "<string>",
      "blurb": "<string>",
      "source_type": "ingestion_api",
      "boost": 123,
      "hidden": true,
      "metadata": {},
      "match_highlights": [
        "<string>"
      ],
      "db_doc_id": 123,
      "content": "<string>",
      "link": "<string>",
      "score": 0,
      "is_relevant": true,
      "relevance_explanation": "<string>",
      "updated_at": "2023-11-07T05:31:56Z",
      "primary_owners": [
        "<string>"
      ],
      "secondary_owners": [
        "<string>"
      ],
      "is_internet": false
    }
  ],
  "llm_indices": [
    123
  ],
  "pagination": {
    "offset": 123,
    "limit": 123,
    "returned_count": 123,
    "has_more": true,
    "next_offset": 123
  }
}

Authorizations

Authorization
string
header
required

Authorization header with Bearer token

Body

application/json
message
string
required
search_type
enum<string>
required
Available options:
keyword,
semantic,
internet
retrieval_options
RetrievalDetails · object
required
evaluation_type
enum<string>
required
Available options:
agentic,
basic,
skip,
unspecified
chunks_above
integer | null
chunks_below
integer | null
full_doc
boolean
default:false
recency_bias_multiplier
number
default:1
rerank_settings
RerankingDetails · object

Response

Successful Response

top_documents
SavedSearchDocWithContent · object[]
required
llm_indices
integer[]
required
pagination
DocumentSearchPagination · object
required