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

# Export evaluation items to a file

> Export all evaluation items for a single evaluation as a downloadable file.

The evaluation is specified by `evaluation_id` in the request body. `export_format`
selects CSV, JSON, or JSONL; for CSV the per-item `data` and `files` fields are
flattened into individual columns and metric-like result columns are expanded.
`export_method` controls delivery: `direct` returns the file contents inline in the
response, while `signed_url` uploads the file to object storage and returns a
pre-signed download URL. Requesting `signed_url` in an environment where object
storage is not configured fails with a 501, so use `direct` there instead. Set
`include_archived=true` to include archived items in the export. This endpoint reads
items only and does not modify the evaluation.



## OpenAPI

````yaml https://api.dev-sgp.scale.com/openapi-versions/v5/openapi.json post /v5/evaluation-items/export
openapi: 3.1.0
info:
  title: EGP API V5
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
paths:
  /v5/evaluation-items/export:
    post:
      tags:
        - Evaluation Items
      summary: Export evaluation items to a file
      description: >-
        Export all evaluation items for a single evaluation as a downloadable
        file.


        The evaluation is specified by `evaluation_id` in the request body.
        `export_format`

        selects CSV, JSON, or JSONL; for CSV the per-item `data` and `files`
        fields are

        flattened into individual columns and metric-like result columns are
        expanded.

        `export_method` controls delivery: `direct` returns the file contents
        inline in the

        response, while `signed_url` uploads the file to object storage and
        returns a

        pre-signed download URL. Requesting `signed_url` in an environment where
        object

        storage is not configured fails with a 501, so use `direct` there
        instead. Set

        `include_archived=true` to include archived items in the export. This
        endpoint reads

        items only and does not modify the evaluation.
      operationId: POST-V5-/v5/evaluation-items/export
      parameters:
        - name: x-selected-account-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account ID Header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EvaluationItemsExportRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvaluationItemsExportResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    EvaluationItemsExportRequest:
      properties:
        export_method:
          $ref: '#/components/schemas/ExportMethod'
          description: >-
            The method for exporting evaluation items. `signed_url` returns a
            pre-signed URL, while `direct` returns the raw content.
          default: direct
        export_format:
          $ref: '#/components/schemas/ExportFormat'
          description: >-
            The format of the exported evaluation items. `json` returns a single
            JSON array, while `jsonl` returns one JSON object per line.
          default: csv
        evaluation_id:
          type: string
          title: Evaluation Id
          description: The ID of the evaluation to export items from.
        include_archived:
          type: boolean
          title: Include Archived
          description: If true, include archived evaluation items in the export.
          default: false
      type: object
      required:
        - evaluation_id
      title: EvaluationItemsExportRequest
    EvaluationItemsExportResponse:
      properties:
        filename:
          type: string
          title: Filename
          description: The name of the exported file
        signed_url:
          title: Signed Url
          description: >-
            Pre-signed URL to download the file from object storage, if
            applicable
          type: string
        content:
          title: Content
          description: The raw file content as bytes, used when direct download is enabled
          type: string
          contentMediaType: application/octet-stream
      type: object
      required:
        - filename
      title: EvaluationItemsExportResponse
      description: >-
        Response model for exporting evaluation items.

        This class represents the response when users export evaluation items.

        It contains either a signed URL to download the exported data from
        object storage,

        or the actual content bytes when direct download is used (in
        environments where object storage is not configured).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ExportMethod:
      type: string
      enum:
        - signed_url
        - direct
      title: ExportMethod
    ExportFormat:
      type: string
      enum:
        - json
        - jsonl
        - csv
      title: ExportFormat
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          title: Error Type
          type: string
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````