> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sixtyfour.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Struct & Type Casting

> How the struct field shapes API responses and how Sixtyfour casts values to the types you expect.

[People Intelligence](/api-reference/endpoint/people-intelligence) and [Company Intelligence](/api-reference/endpoint/company-intelligence) accept a `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`:

```json theme={null}
{
  "struct": {
    "email": "The individual's email address",
    "num_employees": {"description": "Approximate employee count", "type": "int"}
  }
}
```

The agent uses these descriptions to guide its research. Be specific — `"company's primary Instagram handle"` returns better results than `"social"`.

[QA Agent](/api-reference/endpoint/qa-agent) accepts string descriptions only and returns those extra fields as strings; the typed objects and casting rules below do not apply to it.

## Type casting

The API automatically handles type casting with intelligent type preservation.

### Resolution priority

Type resolution follows this priority:

1. **Explicit type definitions** in `struct` (highest)
2. **Original input types** from the request body (e.g., `target_company`, `lead_info`, `data`)
3. **Inferred types** from example values in `struct`
4. **String** (default)

### Supported types

| Type | Example values |
| - | - |
| `"str"` or `"string"` | `"Pacific View Studios"` |
| `"int"` or `"integer"` | `50`, `1000` |
| `"float"` | `95.5`, `3.14` |
| `"bool"` or `"boolean"` | `true`, `false` |
| `"list"` | `["item1", "item2"]` |
| `"list[str]"` | `["item1", "item2"]` |
| `"list[int]"` | `[1, 2, 3]` |
| `"list[float]"` | `[1.5, 2.7, 3.14]` |
| `"list[bool]"` or `"list[boolean]"` | `[true, false]` |
| `"dict"` | `"{\"key\": \"value\"}"` (stringified JSON) |

<Note>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).</Note>

<Note>There is no image type. A field whose description asks for an image (a headshot, a logo, a screenshot) is an ordinary string field whose value is a permanent image URL hosted by Sixtyfour — see [Image fields](/api-reference/endpoint/people-intelligence#image-fields).</Note>

### Examples

**Type override** — explicit `type` in `struct` overrides the original input type:

```json theme={null}
{
  "lead_info": {"age": 30, "is_active": true},
  "struct": {
    "age": {"type": "str"},
    "location": "Current location"
  }
}
// Output: {"age": "30", "is_active": true, "location": "New York"}
```

**Explicit type definition** — useful when you want predictable shapes:

```json theme={null}
{
  "struct": {
    "age": {"description": "Person's age", "type": "int"},
    "is_verified": {"description": "Status", "type": "bool"}
  }
}
// Output: {"age": 30, "is_verified": true}
```

**Type inference from values** — types are inferred from the example values you pass:

```json theme={null}
{
  "struct": {
    "score": 95.5,
    "active": false,
    "count": 42
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.