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

# Extraction

> Rebuild flat extracted_data keys as extractions before the legacy Extraction feature is retired on 18 September 2026.

<Warning>
  **`extracted_data` · flat keys → Rebuild as extractions — 18 September 2026.** Flat keys stop appearing in `extracted_data`.
</Warning>

Today you have one prose box describing several fields, which Bolna compiles into a JSON structure. Each field in that prose becomes one extraction.

## What to do

<Steps>
  <Step title="Create a category">
    Group the fields, for example `Call Details`.
  </Step>

  <Step title="Add one extraction per field">
    Name is the result key; set it to your current key to keep names stable. Question is the sentence describing that field, lifted from your prose. Answer type is pre-defined if you listed allowed values, free text otherwise. Set expected format for numbers, dates, booleans, emails, or patterns.
  </Step>

  <Step title="Test against a real past transcript">
    See [Verifying a migration](/docs/migrating-to-extractions/overview#verifying-a-migration).
  </Step>

  <Step title="Remove the old extraction task from the agent" />
</Steps>

<Note>
  **Keys are now stable.** The old feature let the model choose field names, so a key could appear or disappear between calls. The name you configure is the key you get on every call. If a call never covers the question, you get a low-confidence result rather than a missing key.
</Note>

## Before and after

<CodeGroup>
  ```json Before: flat, model-chosen keys theme={"system"}
  {
    "extracted_data": {
      "call_reason": "Wants to reschedule",
      "preferred_day": "Thursday",
      "callback_requested": "No"
    }
  }
  ```

  ```json After: names reused, path one level deeper theme={"system"}
  {
    "extracted_data": {
      "Call Details": {
        "call_reason": {
          "objective": "Reschedule",
          "confidence": 0.92, …
        },
        "preferred_day": {
          "subjective": "Thursday",
          "confidence": 0.874, …
        },
        "callback_requested": {
          "objective": "No",
          "confidence": 0.9, …
        }
      }
    }
  }
  ```
</CodeGroup>

`call_reason` and `callback_requested` moved from free text to pre-defined. Optional, but recommended: `"Wants to reschedule"` was whatever the model wrote that day; `"Reschedule"` is guaranteed to be one of your values.

## What changes in your code

| Before                               | After                                                                |
| ------------------------------------ | -------------------------------------------------------------------- |
| `d["extracted_data"]["call_reason"]` | `d["extracted_data"]["Call Details"]["call_reason"]["objective"]`    |
| Value is a string                    | Value is an object, so select `objective` or `subjective`            |
| Key may be missing on some calls     | Key always present; low confidence signals an uncovered question     |
| Free-text wording varies per call    | Pre-defined answers match your option values character for character |

Full detail on the result object is in [What the payload looks like](/docs/migrating-to-extractions/overview#what-the-payload-looks-like), and the complete list is in [Breaking changes](/docs/migrating-to-extractions/overview#breaking-changes).

## Other features

<CardGroup cols={3}>
  <Card title="Custom Analytics" icon="sliders" href="/docs/migrating-to-extractions/custom-analytics">
    `custom_extractions`
  </Card>

  <Card title="Agent Extraction" icon="robot" href="/docs/migrating-to-extractions/agent-extraction">
    `agent_extraction`
  </Card>

  <Card title="Call Summary" icon="file-lines" href="/docs/migrating-to-extractions/call-summary">
    `summary`
  </Card>
</CardGroup>

Email [support@bolna.ai](mailto:support@bolna.ai) to remove a legacy summarisation task, or with an `execution_id` for a payload that does not match this guide.

## Next Steps

<CardGroup cols={3}>
  <Card title="Using Extractions" icon="list-check" href="/docs/prompting/using-extractions">
    Configure extractions in the dashboard
  </Card>

  <Card title="Dispositions API" icon="code" href="/docs/api-reference/dispositions/overview">
    Manage extractions programmatically
  </Card>

  <Card title="Webhooks" icon="webhook" href="/docs/post-call/polling-call-status-webhooks">
    Receive extraction data in real-time
  </Card>
</CardGroup>
