Skip to content

Search an agent's documents

POST
/voice/agents/{agent_id}/documents/search

SPENDS NOTHING billable. The chunks the agent would retrieve for query. Voice binds form fields, so the body is re-encoded as form data.

Authorizations

Parameters

Path Parameters

agent_id
required

Voice agent id.

string
>= 1 characters

Voice agent id.

Header Parameters

X-Target-Org-Id
Any of:
string

Request Body required

Voice binds query and top_k as FORM fields beside org_id and agent_id; the router re-encodes this body as form data.

object
query
required
string
>= 1 characters
top_k
integer
default: 5 >= 1 <= 50

Responses

200

Successful Response

object
data
required

One voice object - a collection, an agent, a route, a chat.

Open-shaped: voice adds fields to these bodies on its own release cadence and a dropped-or-added key must not be a 500 in this service.

object
key
additional properties
any
pagination
Any of:
object
has_next
required

Whether there are more pages

boolean
limit
required

Items per page

integer
next_cursor
Any of:
string
notes
Any of:
Array<string>
page
required

Current page number (1-indexed)

integer
total
required

Total number of items

integer
total_available
Any of:
integer
total_is_lower_bound
Any of:
boolean

422

Validation Error

object
detail
Array<object>
object
loc
required
Array
msg
required
string
type
required
string