> ## 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.

# Retrieve voice AI execution debug bundle API

> Fetch everything needed to debug one call in a single request via the Bolna API: the execution, per-turn latency with the structured transcript, and the pipeline logs.

Returns what the dashboard's **Debugging** view shows for one call, in a single response. Use it when you want to find out why a call was slow, dropped or went off script without stitching together [Get execution](/docs/api-reference/executions/get_execution.md), the per-turn latency and [Get raw logs](/docs/api-reference/executions/get_execution_raw_logs.md) yourself. The [Bolna MCP server](/docs/mcp-server.md) uses it for its `get_execution_debug` tool.

## Sections

| Section | What's in it |
| - | - |
| `execution` | The call's status and error, provider and numbers, timestamps, duration, cost and usage breakdowns, `telephony_data`, `latency_data`, `context_details`, extractions, `summary`, tool calls, transfers and retries |
| `progression` | `call_start_at`, the latency analytics for each turn, and the structured transcript: user and agent messages, function calls and call events such as transfers and hangups |
| `logs` | The pipeline logs for the call (transcriber, LLM, synthesizer and function calls), followed by one `webhook` entry with the call's webhook deliveries. Webhook deliveries are included for calls from the last 14 days |

Pass `include` to fetch only some sections, for example `?include=execution,logs`. Leave it out to get all three. Any other value returns `400`.

## Reading LLM requests

Every LLM request resends the full prompt and the conversation so far, so in `logs` each `llm` request after the first carries only the text it adds. Its `data_shared_prefix_chars` says how many leading characters it shares with the previous request. To rebuild the full text of each request:

```python theme={"system"}
full_requests, previous = [], None
for row in bundle["logs"] or []:
    if row.get("component") == "llm" and row.get("type") == "request":
        text = row["data"]
        if "data_shared_prefix_chars" in row:
            text = previous[: row["data_shared_prefix_chars"]] + text
        full_requests.append(text)
        previous = text
```

The first request is always whole: it is the exact prompt that ran, with variables filled in.

The bundle is trimmed for size. For the full data, use [Get execution](/docs/api-reference/executions/get_execution.md) and [Get raw logs](/docs/api-reference/executions/get_execution_raw_logs.md).

## When a section is missing

One section never fails the whole response. A section that doesn't exist for this call, or that fails to load, comes back `null`, and `unavailable` names it with the reason:

```json theme={"system"}
{
  "execution_id": "4c06b4d1-4096-4561-919a-4f94539c8d4a",
  "unavailable": { "progression": "not_available" },
  "execution": { "id": "4c06b4d1-4096-4561-919a-4f94539c8d4a", "status": "completed" },
  "progression": null,
  "logs": []
}
```

| Reason | Meaning |
| - | - |
| `not_available` | There is no data for this section on this call |
| `error` | The section failed to load. Retry, or fetch the same data from its own endpoint |


## OpenAPI

````yaml GET /executions/{execution_id}/debug
openapi: 3.1.0
info:
  title: Bolna API
  description: >-
    Use and leverage Bolna Voice AI using APIs through HTTP requests from any
    language in your applications and workflows.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.bolna.ai
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: SIP trunks
    description: >-
      Bring-your-own-carrier SIP trunks, their gateways, carrier IPs and
      numbers.
paths:
  /executions/{execution_id}/debug:
    get:
      description: >-
        Retrieve everything needed to debug one execution in a single response,
        trimmed to fit an AI assistant's tool result. Returns what the
        dashboard's Debugging view shows.
      parameters:
        - in: path
          name: execution_id
          required: true
          schema:
            type: string
            format: uuid
          description: The unique `execution_id`
        - in: query
          name: include
          required: false
          schema:
            type: string
            example: execution,logs
          description: >-
            Comma-separated sections to return, from `execution`, `progression`
            and `logs`. Omit to return all three. Any other value returns `400`.
      responses:
        '200':
          description: Debug bundle for the execution
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExecutionDebugBundle'
        '400':
          description: >-
            `include` names a section other than `execution`, `progression` or
            `logs`
          content:
            application/json:
              example:
                message: >-
                  include must be a comma-separated subset of execution,
                  progression, logs
        '404':
          description: No execution with this `execution_id` that your account can read
          content:
            application/json:
              example:
                message: Agent execution not found
components:
  schemas:
    ExecutionDebugBundle:
      type: object
      properties:
        execution_id:
          type: string
          format: uuid
          description: The execution this bundle is for
        unavailable:
          type: object
          description: >-
            Sections that came back `null`, each with the reason.
            `not_available` means there is no data for that section on this
            call; `error` means it failed to load.
          additionalProperties:
            type: string
            enum:
              - not_available
              - error
          example:
            progression: not_available
        execution:
          type: object
          nullable: true
          description: >-
            The execution, keeping only fields that help debug a call (status,
            `error_message`, provider and numbers, timestamps,
            `conversation_duration`, `total_cost`, `cost_breakdown`,
            `usage_breakdown`, `telephony_data`, `latency_data`,
            `context_details`, extractions, `summary`, `tool_call_logs`,
            `transfer_call_data`, retries). Empty fields are dropped and the
            prose `transcript` is left out. Present only when requested.
          additionalProperties: true
        progression:
          type: object
          nullable: true
          description: >-
            Per-turn latency and the structured transcript. Present only when
            requested.
          properties:
            call_start_at:
              type: string
              description: When the call started
            turns:
              type: array
              description: >-
                Latency analytics for each turn that has them, in milliseconds.
                Fields without a value are dropped.
              items:
                $ref: '#/components/schemas/ExecutionDebugTurn'
            transcript:
              type: array
              description: >-
                The call in order, as user and agent messages, function calls
                and call events
              items:
                $ref: '#/components/schemas/ExecutionDebugTranscriptItem'
        logs:
          type: array
          nullable: true
          description: >-
            The call's pipeline logs in order, followed by one `webhook` entry
            with its webhook deliveries (calls from the last 14 days only).
            Present only when requested.
          items:
            $ref: '#/components/schemas/ExecutionDebugLog'
    ExecutionDebugTurn:
      type: object
      properties:
        sequence_id:
          type: integer
        turn_id:
          type: integer
        asr_end_to_user_end_ms:
          type: number
          description: >-
            Silence after the caller stopped speaking before the transcript was
            final
        llm_start_to_asr_end_ms:
          type: number
          description: Time from the final transcript to the LLM starting
        llm_duration_ms:
          type: number
          description: How long the LLM streamed, first token to last
        tts_start_to_llm_start_ms:
          type: number
          description: Time from the LLM starting to text-to-speech starting
        tts_start_to_llm_end_ms:
          type: number
          description: >-
            Gap between the LLM finishing and text-to-speech starting. Negative
            when speech started before the LLM finished
        agent_speech_to_tts_start_ms:
          type: number
          description: Time from text-to-speech starting to the agent starting to speak
        agent_speech_to_tts_first_audio_ms:
          type: number
          description: Time from the first synthesized audio to the agent starting to speak
    ExecutionDebugTranscriptItem:
      type: object
      properties:
        kind:
          type: string
          enum:
            - message
            - function_call
            - event
        role:
          type: string
          enum:
            - user
            - agent
          description: Who spoke (`message` rows)
        text:
          type: string
          description: What was said (`message` rows)
        interrupted:
          type: boolean
          description: Whether the message was interrupted
        message_category:
          type: string
          description: Tag for scripted agent speech, such as a hangup or transfer message
        not_sent_to_agent:
          type: boolean
          description: >-
            Present and `true` when the caller's speech was transcribed but not
            passed to the LLM
        ts_exact:
          type: boolean
          description: >-
            Present and `false` when the row's time was estimated for ordering
            rather than measured
        tool_name:
          type: string
          description: The tool that was called (`function_call` rows)
        status:
          type: string
          description: Outcome of the tool call (`function_call` rows)
        response_status_code:
          type: integer
          description: HTTP status the tool's API returned (`function_call` rows)
        tool_latency_ms:
          type: number
          description: How long the tool call took (`function_call` rows)
        label:
          type: string
          description: What happened, such as a transfer or hangup (`event` rows)
        ts:
          type: string
          description: When it happened (`function_call` and `event` rows)
        ts_ms:
          type: number
          description: When it happened, in milliseconds (`function_call` and `event` rows)
    ExecutionDebugLog:
      type: object
      properties:
        created_at:
          type: string
          description: Time of the log entry
        component:
          type: string
          description: >-
            The pipeline component, such as `transcriber`, `llm`, `synthesizer`
            or `webhook`
          example: llm
        type:
          type: string
          enum:
            - request
            - response
        provider:
          type: string
          description: The provider or model
        data:
          description: >-
            The log content. For every `llm` request after the first that shares
            a prefix with the previous request, only the text after that prefix.
            For the `webhook` entry, the list of webhook deliveries.
          oneOf:
            - type: string
            - type: array
              items:
                type: object
        data_shared_prefix_chars:
          type: integer
          description: >-
            Set on delta-encoded `llm` requests. The full request is the
            previous request's full text up to this many characters, followed by
            `data`.
        latency:
          type: number
          description: Latency of this step, when recorded
        tool_name:
          type: string
          description: The tool, on function-call rows
        reasoning_content:
          type: string
          description: The model's reasoning summary, when the provider returns one
        rag_info:
          type: object
          description: Knowledge base retrieval details, when the agent used one
        graph_routing_info:
          type: object
          description: Graph agent routing details, when the agent is a graph agent
        status:
          type: string
          description: >-
            Webhook delivery status on the `webhook` entry (`success`, `no_data`
            or `not_configured`)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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