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

# Get Run Turns

> Returns every turn from the run, ordered by `turn_number` ascending. Includes persona text, agent text, tool results, and flow events.

Returns every turn from the run, ordered by `turn_number` ascending. Includes:

* `persona` rows — the test caller's text
* `agent` rows — the agent's text, plus any `tool_calls` it issued in that turn
* `tool_result` rows — synthetic-or-real tool results injected back into the agent
* `flow_event` rows (flow agents only) — `flow_node_entered`, `flow_eval_decision`, `flow_tool_result` events mirrored from the flow runtime

Walking the turn list top-to-bottom is the canonical way to debug a failing assertion. Look for the moment the agent's transcript diverged from what your assertion expected.


## OpenAPI

````yaml GET /agent-eval/runs/{id}/turns
openapi: 3.1.0
info:
  title: Yappr API
  description: >
    Create and manage AI voice agents, purchase phone numbers, configure tools,
    and initiate calls — all via REST.
  version: 1.0.0
  contact:
    url: https://goyappr.com
servers:
  - url: https://api.goyappr.com
    description: Production
security:
  - apiKey: []
paths:
  /agent-eval/runs/{id}/turns:
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
          format: uuid
    get:
      tags:
        - Agent Eval
      summary: Get run turns
      description: >-
        Returns every turn from the run, ordered by `turn_number` ascending.
        Includes persona text, agent text, tool results, and flow events.
      operationId: getRunTurns
      responses:
        '200':
          description: Ordered list of turns
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/EvalRunTurn'
        '404':
          description: Not found
components:
  schemas:
    EvalRunTurn:
      type: object
      description: Append-only per-message row from an eval run. Ordered by `turn_number`.
      required:
        - id
        - run_id
        - turn_number
        - role
        - created_at
      properties:
        id:
          type: string
          format: uuid
        run_id:
          type: string
          format: uuid
        turn_number:
          type: integer
          minimum: 0
          description: Monotonic counter starting at 0 for the very first turn.
        role:
          type: string
          enum:
            - persona
            - agent
            - tool_result
            - flow_event
          description: >
            `persona` and `agent` are LLM-generated text turns. `tool_result`
            rows carry the synthetic-or-real tool result injected back into the
            agent. `flow_event` rows mirror the flow_node_entered /
            flow_eval_decision / flow_tool_result events emitted by flow agents
            during the run.
        text:
          type: string
          nullable: true
          description: >-
            Spoken (would-be-spoken) text. Always present for persona/agent
            rows.
        tool_calls:
          type: array
          nullable: true
          description: >-
            Tool invocations the agent issued in this turn. Mirrors the format
            used in call logs.
          items:
            type: object
            additionalProperties: true
        flow_event:
          type: object
          additionalProperties: true
          nullable: true
          description: Flow-event payload (only when `role='flow_event'`).
        model:
          type: string
          nullable: true
          description: Model that generated this turn (when role is persona/agent).
        input_tokens:
          type: integer
          default: 0
        output_tokens:
          type: integer
          default: 0
        cost_cents:
          type: integer
          default: 0
        latency_ms:
          type: integer
          nullable: true
        created_at:
          type: string
          format: date-time
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Your Yappr API key (e.g. `ypr_live_...`). Generate one in the dashboard
        under **Settings → API Keys**.

````