struct field that defines exactly what data you want returned in structured_data. This guide explains how struct works and how the API resolves and casts types.
How struct works
Each key in struct becomes a field in the response’s structured_data, and its value tells the agent what to find. You can pass either a plain-English description or an object with description and type:
"company's primary Instagram handle" returns better results than "social".
Type casting
The API automatically handles type casting with intelligent type preservation.Resolution priority
Type resolution follows this priority:- Explicit type definitions in
struct(highest) - Original input types from the request body (e.g.,
target_company,lead_info,data) - Inferred types from example values in
struct - String (default)
Supported types
The
"dict" type returns a stringified JSON value, not a nested typed object. Parse it client-side with json.loads() (Python) or JSON.parse() (JavaScript).Examples
Type override — explicittype in struct overrides the original input type: