POST
/
api
/
corpora
/
{corpus_id}
/
query
curl --request POST \
  --url https://api.ultravox.ai/api/corpora/{corpus_id}/query \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '{
  "query": "<string>",
  "maxResults": 123
}'
[
  {
    "content": "<string>",
    "score": 123,
    "citation": {
      "sourceId": "<string>",
      "documentId": "<string>",
      "publicUrl": "<string>",
      "title": "<string>"
    }
  }
]
Use the queryCorpus Tool

Any agents that you deploy should use the built-in queryCorpus tool.


This endpoint should be use for testing.

Authorizations

X-API-Key
string
header
required

API key

Path Parameters

corpus_id
string
required

Body

application/json

A request to query a corpus.

query
string

The query to run.

maxResults
integer

The maximum number of results to return.

Response

200 - application/json
content
string

The content of the retrieved chunk.

score
number

The score of this chunk, with higher scores indicating better matches.

citation
object

A citation for this chunk.