POST
/
search
/
retrieve
cURL
curl --request POST \
  --url https://api.usecortex.ai/search/retrieve \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --header 'accept: <accept>' \
  --data '{
  "query": "<string>",
  "tenant_id": "<string>",
  "sub_tenant_id": "<string>",
  "max_chunks": 123,
  "alpha": 0.8,
  "recency_bias": 0.5
}'
{
  "results": [
    {
      "content": "<string>",
      "source_id": "<string>",
      "score": 123,
      "metadata": {}
    }
  ]
}

Sample Request

curl --location 'https://api.usecortex.ai/search/retrieve' \
  --header 'Authorization: Bearer {API_KEY}' \
  --header 'accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "query": "{SEARCH_QUERY}",
    "tenant_id": "{TENANT_ID}",
    "sub_tenant_id": "{SUB_TENANT_ID}",
    "max_chunks": {MAX_CHUNKS},
    "alpha": {ALPHA},
    "recency_bias": {RECENCY_BIAS}
  }'

Response

Returns a JSON object containing relevant content chunks from your indexed sources based on the search query.
{
  "results": [
    {
      "content": "This is a relevant text chunk from your indexed content...",
      "source_id": "CortexDoc123456789",
      "score": 0.95,
      "metadata": {
        "source_title": "Document Title",
        "source_type": "document",
        "timestamp": "2024-01-15T10:30:00Z",
        "url": "https://example.com/document.pdf"
      }
    },
    {
      "content": "Another relevant chunk of content...",
      "source_id": "CortexDoc987654321",
      "score": 0.87,
      "metadata": {
        "source_title": "Another Document",
        "source_type": "webpage",
        "timestamp": "2024-01-14T15:45:00Z",
        "url": "https://example.com/webpage"
      }
    }
  ]
}
Note: This endpoint returns search results without AI-generated answers. For conversational Q&A with AI-generated responses, use the /search/qna endpoint instead.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Authorization
string
required

Bearer token (your API key)

Content-Type
string
default:application/json
required

Request content type

accept
string
default:application/json
required

Response content type

Body

application/json

Response

200
application/json

Successful search results

The response is of type object.