Read part of a value by handle
POST /Platform/dtypes/get-content
Read part of a value by handle. Select with path and/or
range and get it verbatim ("get me /rows/12", "pages 3-5"), or
add query to search within the selection, or hql to query
it as a table; give at least one of the four. Results carry locators (pdf pages, audio windows, tree
pointers) for a narrower next call. This is THE way to read a PDF's
text (find a value, quote a line, answer a question about it);
get_media only shows a rendered page.
To filter, group, sort or count the rows of a list (beyond finding
a few rows), pass hql instead of query: the list at
path is queried as a table; a grep misses values on the
second line of a cell.
Body parameters
ref: str. The handle (or, in a chat, the tool_call_id of a result).path: optional str. Scope inside atree: a glob with predicates (patients[*][species=cat].invoices[*][paid=false]), list indexes (rows[3],rows[1,4,7]) or a JSON pointer (/items/3). A path matching nothing is answered with the top-level keys. A path to a multi-line text reads it as text: whole if it fitsmax_chars, else its numbered first lines and the call for the next ones; addrangefor lines orqueryto search inside it. Hits inside such a text print as<line>: <text> # <path>: pass that path and line back aspathandrange. Printed paths are always paths in the whole value, even whenrangescoped the search. Text, PDFs, recordings and tables have no paths and refusepath: read them byrangeor search them byquery.range: optional Union[str, List[float]].[start, end], also written5,"2-3"or"8-"(open end); other forms are refused with an example. Units by type, 1-based inclusive: pdf pages (thepage, line:labels), audio seconds, text/file lines; for a tree, 0-based inclusive items of the list atpath(or the top-level list), as in theindices a-ba preview names. Whenpathpoints at a long text inside a result (a page's text, a message body),rangeis its lines:path="/text", range=[40, 120]. A range is never read as the whole value: one outside it is answered with the lines or pages that exist; one running past the end is read to the end. Lines overmax_charsare left out whole, and the answer ends with the call that reads the next ones.query: optional str. What to search for. Ingrepmode a literal substring, and also a case-insensitive regex when it looks like one (no flag).mode: optional "auto" or "grep" or "bm25" or "similarity" or "hybrid" or 1 more. Search strategy:grepexact line match;bm25keywords;similarityvector;hybridsemantic + lexical (whatautoruns, orbm25on a very large value;mode_usedsays which ran);matchfor "find every ..." and "is there any ..." questions: a model checks the passages, the flagged ones come first, then the closest by ranking, and the first line counts flagged of checked. It is not proof that nothing else matches and costs small model calls that grow with the value's size; use it when the other modes miss. Other modes are refused.max_chars: optional int. Max characters of content returned.context: optional int.greponly: lines before and after each match (likegrep -C;0= matched lines only). On a tree, grep matches onekey: valueline per leaf, tagged# <pointer>, not the JSON preview; for whole matching records usebm25orhybrid.as_handle: optional bool. Return the selection as a new handle inderived_handle, to pass a subset of a large result to a tool without copying it (path="rows[*][status=active]"-> a handle of only those rows). For one pointer, skip this and pass<ref id="<hash>" path="/rows/3"/>as the argument value; it resolves on every surface. Nothing is created for a refused selection or a search without a match. Withhql, the result rows are held (read them again atpath="/rows").hql: optional str. Filter, group, sort or count the rows of the list atpath: the HQL steps after the source, which is always this value (where, explode, group by, aggregates, having, order by, offset, limit, select). Example:hql="explode due_date | due_date <= '1/6/2026' | group by client | count(*) as n | limit 30". It takes no query, range or search mode.headers_path: optional str. Withhql, for rows that are lists: the path of the list that names their columns (/result/headers).
Returns
GetContentResponse
handle: str. Resolved handle; pass it back to read more narrowly.slices: optional str. Selected content with locators where the type has them.derived_handle: optional str or null. Handle of the stored selection when as_handle was set.mode_used: optional "grep" or "bm25" or "similarity" or "hybrid" or "match" or null. Search mode actually used: whatautoresolved to, else the mode requested. Null for a read without a query.rows: optional List[dict] or null. With hql: the result rows, one object per row keyed by column name. Null with as_handle (the rows are in derived_handle).columns: optional List[dict] or null. With hql: the result columns in order, each with name, kind (text, number, bool, date, datetime, phone) and the dtype a typed kind maps to.total_rows: optional int or null. With hql: rows the query produced before offset/limit.
Example request
curl -X POST "https://api.hilus.ai/Platform/dtypes/get-content" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'