Skip to main content
Search is the retrieval call that ranks a collection’s documents by relevance to a query. It lives at the documents sub-resource — a GET on the collection’s documents with the query as a filter.

Shape

Search is a GET on the documents sub-resource with the query as a query parameter. With no query it’s a plain date-sorted catalog listing; with a query it’s a ranked vector retrieval (hybrid and keyword are coming soon). The collection is addressed by slug (customer-facing), not uuid. A collection with no searchable sources returns 422 (see Errors).

Basic vs Advanced

A search can be as simple as a plain natural-language question, or as rich as a source-scoped, filtered, paginated retrieval call. Choose the tab that matches how much control you need.
A basic search sends only the query. The collection’s settings decide how many results come back (top_k, default 5) and how they are ranked (retrieval_type).

Reconstructing a Document

Search and listing share one endpoint — the presence of query decides the behavior. Omit query to get a plain, date-ordered listing instead of a ranked search. During indexing, a transcription or file is split into multiple chunks. To retrieve every chunk that belongs to a single record — for example to reassemble one full transcript — omit query and filter by record_id:
Without a query, results come back in date order rather than by relevance score, and the request is not billed as a search event. Each chunk carries chunk_index and chunk_total, so you can order the chunks (chunk_index ascending) and reassemble the complete document text. Because a collection’s sources can be stored across multiple regions, a fan-out search may return the same chunk once per region (duplicate id values with different region values). Deduplicate by id before sorting by chunk_index, otherwise reassembled text repeats sections.
page[size] is echoed in the response meta but does not limit how many chunks are returned — top_k governs the array length. To retrieve every chunk of a record, set top_k high enough to cover chunk_total (up to the maximum of 50) rather than relying on pagination.
When copying curl examples that use bracketed keys like filter[...] or page[...], pass --globoff (curl otherwise treats [ and ] as glob/range syntax and the request fails before it is sent).

Errors

Search errors are returned in the standard Telnyx error envelope with a numeric code:
A 400 is returned for malformed requests — for example filtering on a non-filterable field such as region or score.

Billing

Each ranked search (a request with a query parameter) counts as one billable search event. Browsing a collection’s documents without a query (catalog listing) is free. See Pricing for rates.