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

# Export eval run results

> Returns the eval run metadata plus the full array of evaluation
items (one per scored trace) as a downloadable JSON document.
The `Content-Disposition` header is set to `attachment` so
browsers offer a file save dialog. Tenant-scoped — cross-tenant
access returns 404.




## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/eval-runs/{id}/export
openapi: 3.1.0
info:
  title: TruLayer API
  version: 0.1.0
  description: |
    Trace ingestion, evaluation, query, and feedback API for TruLayer AI.

    ### Authentication

    Two auth schemes coexist: SDK API keys (`Authorization: Bearer tl_...`)
    and Clerk session JWTs (dashboard). Routes marked "requires Clerk auth"
    in their summary are unreachable via API key.

    ### Roles (TRU-234)

    Dashboard requests carry one of three organization roles: `owner`,
    `member`, `viewer`. Endpoints enforce role allowlists, not rank
    comparisons. See `docs/security.md` for the full role-permission
    matrix.

    - **owner** — full control including billing, member management,
      destructive deletes on failure-rules/model-routes/webhooks/eval-rules,
      control-loop execution, and DLQ resolution.
    - **member** — read + write (ingest, feedback, evals, API keys,
      projects, failure-rules, model-routes, webhooks).
    - **viewer** — read-only dashboard access plus compliance read access
      to `/v1/audit-log` and `/v1/dlq`.
servers:
  - url: https://api.trulayer.ai
    description: Production
  - url: http://localhost:8080
    description: Local development
security:
  - BearerAuth: []
tags:
  - name: health
  - name: ingest
  - name: traces
  - name: metrics
  - name: feedback
  - name: evals
  - name: eval-rules
  - name: control
  - name: apikeys
  - name: model-routes
  - name: datasets
  - name: search
  - name: anomaly
  - name: webhooks
  - name: failure-rules
  - name: eval-runs
  - name: ci
  - name: otlp
  - name: billing
  - name: deprecations
  - name: audit
  - name: failures
  - name: projects
  - name: compliance
  - name: dsr
  - name: policies
  - name: members
paths:
  /v1/eval-runs/{id}/export:
    get:
      tags:
        - eval-runs
      summary: Export eval run results
      description: |
        Returns the eval run metadata plus the full array of evaluation
        items (one per scored trace) as a downloadable JSON document.
        The `Content-Disposition` header is set to `attachment` so
        browsers offer a file save dialog. Tenant-scoped — cross-tenant
        access returns 404.
      operationId: exportEvalRun
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Eval run export
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvalRunExportResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    EvalRunExportResponse:
      type: object
      required:
        - run
        - items
      description: |
        Full eval run payload suitable for download. The `run` field
        carries the run metadata; `items` is the set of evaluation
        rows that were produced by this run (one per scored trace).
      properties:
        run:
          $ref: '#/components/schemas/EvalRun'
        items:
          type: array
          items:
            $ref: '#/components/schemas/EvalRunExportItem'
    EvalRun:
      type: object
      required:
        - id
        - tenant_id
        - dataset_id
        - eval_version_id
        - status
        - item_count
        - completed_count
        - created_at
      properties:
        id:
          type: string
          format: uuid
        tenant_id:
          type: string
          format: uuid
        dataset_id:
          type: string
          format: uuid
        eval_version_id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - pending
            - running
            - completed
            - failed
        item_count:
          type: integer
        completed_count:
          type: integer
        started_at:
          type: string
          format: date-time
          nullable: true
        completed_at:
          type: string
          format: date-time
          nullable: true
        error_message:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
    EvalRunExportItem:
      type: object
      required:
        - id
        - trace_id
        - metric_name
        - evaluator_type
        - status
        - created_at
      properties:
        id:
          type: string
          format: uuid
        trace_id:
          type: string
          format: uuid
        metric_name:
          type: string
        evaluator_type:
          type: string
        status:
          type: string
        score:
          type: number
          nullable: true
        label:
          type: string
          nullable: true
        reasoning:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: SDK API key (`tl_...`) or Clerk session JWT

````