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

# Upload Prompt Test Cases

> 
Add test cases to a dataset using the legacy upload format. Use for bulk imports with input/output pairs.

Maximum 100 examples per request.



## OpenAPI

````yaml https://app.freeplay.ai/openapi.json post /api/v2/projects/{project_id}/datasets/id/{dataset_id}/test-cases
openapi: 3.1.0
info:
  title: Freeplay API
  version: 0.1.0
servers: []
security:
  - BearerAuth: []
paths:
  /api/v2/projects/{project_id}/datasets/id/{dataset_id}/test-cases:
    post:
      tags:
        - Prompt Datasets
      summary: Upload Prompt Test Cases
      description: >-

        Add test cases to a dataset using the legacy upload format. Use for bulk
        imports with input/output pairs.


        Maximum 100 examples per request.
      operationId: post_upload_test_cases
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
        - name: dataset_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                examples:
                  items:
                    $ref: '#/components/schemas/TestCaseUploadWithMedia'
                  title: Examples
                  type: array
              required:
                - examples
              title: TestCasesUploadRequest
              type: object
      responses:
        '201':
          content:
            application/json:
              schema:
                properties:
                  message:
                    title: Message
                    type: string
                required:
                  - message
                title: SimpleResponseWithMessage
                type: object
          description: 'SimpleResponseWithMessage(message: str)'
components:
  schemas:
    TestCaseUploadWithMedia:
      properties:
        inputs:
          additionalProperties:
            $ref: '#/components/schemas/InputVariable'
          title: Inputs
          type: object
        history:
          default: null
          title: History
          items:
            discriminator:
              mapping:
                assistant:
                  $ref: '#/components/schemas/AssistantMessage'
                developer:
                  $ref: '#/components/schemas/DeveloperMessage'
                system:
                  $ref: '#/components/schemas/SystemMessage'
                user:
                  $ref: '#/components/schemas/UserMessage'
              propertyName: role
            oneOf:
              - $ref: '#/components/schemas/UserMessage'
              - $ref: '#/components/schemas/SystemMessage'
              - $ref: '#/components/schemas/DeveloperMessage'
              - $ref: '#/components/schemas/AssistantMessage'
          type:
            - array
            - 'null'
        output:
          default: null
          title: Output
          type:
            - string
            - 'null'
        metadata:
          default: null
          title: Metadata
          additionalProperties:
            type: string
          type:
            - object
            - 'null'
        media_inputs:
          default: null
          title: Media Inputs
          additionalProperties:
            discriminator:
              mapping:
                base64:
                  $ref: '#/components/schemas/MediaInputBase64'
                url:
                  $ref: '#/components/schemas/MediaInputUrl'
              propertyName: type
            oneOf:
              - $ref: '#/components/schemas/MediaInputUrl'
              - $ref: '#/components/schemas/MediaInputBase64'
          type:
            - object
            - 'null'
        output_message:
          anyOf:
            - discriminator:
                mapping:
                  assistant:
                    $ref: '#/components/schemas/AssistantMessage'
                  developer:
                    $ref: '#/components/schemas/DeveloperMessage'
                  system:
                    $ref: '#/components/schemas/SystemMessage'
                  user:
                    $ref: '#/components/schemas/UserMessage'
                propertyName: role
              oneOf:
                - $ref: '#/components/schemas/UserMessage'
                - $ref: '#/components/schemas/SystemMessage'
                - $ref: '#/components/schemas/DeveloperMessage'
                - $ref: '#/components/schemas/AssistantMessage'
            - type: 'null'
          default: null
          title: Output Message
      required:
        - inputs
      title: TestCaseUploadWithMedia
      type: object
    InputVariable:
      anyOf:
        - type: string
        - type: integer
        - type: boolean
        - type: number
        - additionalProperties:
            $ref: '#/components/schemas/InputVariable'
          type: object
        - items:
            $ref: '#/components/schemas/InputVariable'
          type: array
    AssistantMessage:
      properties:
        content:
          anyOf:
            - type: string
            - items:
                discriminator:
                  mapping:
                    audio:
                      $ref: '#/components/schemas/AudioBlock'
                    file:
                      $ref: '#/components/schemas/FileBlock'
                    image:
                      $ref: '#/components/schemas/ImageBlock'
                    text:
                      $ref: '#/components/schemas/TextBlock'
                    tool_call:
                      $ref: '#/components/schemas/ToolCallBlock'
                    tool_result:
                      $ref: '#/components/schemas/ToolResultBlock'
                  propertyName: type
                oneOf:
                  - $ref: '#/components/schemas/TextBlock'
                  - $ref: '#/components/schemas/ToolResultBlock'
                  - $ref: '#/components/schemas/ToolCallBlock'
                  - $ref: '#/components/schemas/ImageBlock'
                  - $ref: '#/components/schemas/AudioBlock'
                  - $ref: '#/components/schemas/FileBlock'
              type: array
          title: Content
        role:
          const: assistant
          default: assistant
          title: Role
          type: string
      required:
        - content
      title: AssistantMessage
      type: object
    DeveloperMessage:
      properties:
        content:
          title: Content
          type: string
        role:
          const: developer
          default: developer
          title: Role
          type: string
      required:
        - content
      title: DeveloperMessage
      type: object
    SystemMessage:
      properties:
        content:
          title: Content
          type: string
        role:
          const: system
          default: system
          title: Role
          type: string
      required:
        - content
      title: SystemMessage
      type: object
    UserMessage:
      properties:
        content:
          anyOf:
            - type: string
            - items:
                discriminator:
                  mapping:
                    audio:
                      $ref: '#/components/schemas/AudioBlock'
                    file:
                      $ref: '#/components/schemas/FileBlock'
                    image:
                      $ref: '#/components/schemas/ImageBlock'
                    text:
                      $ref: '#/components/schemas/TextBlock'
                    tool_call:
                      $ref: '#/components/schemas/ToolCallBlock'
                    tool_result:
                      $ref: '#/components/schemas/ToolResultBlock'
                  propertyName: type
                oneOf:
                  - $ref: '#/components/schemas/TextBlock'
                  - $ref: '#/components/schemas/ToolResultBlock'
                  - $ref: '#/components/schemas/ToolCallBlock'
                  - $ref: '#/components/schemas/ImageBlock'
                  - $ref: '#/components/schemas/AudioBlock'
                  - $ref: '#/components/schemas/FileBlock'
              type: array
          title: Content
        role:
          const: user
          default: user
          title: Role
          type: string
      required:
        - content
      title: UserMessage
      type: object
    MediaInputBase64:
      properties:
        type:
          const: base64
          title: Type
          type: string
        data:
          title: Data
          type: string
        content_type:
          title: Content Type
          type: string
      required:
        - type
        - data
        - content_type
      title: MediaInputBase64
      type: object
    MediaInputUrl:
      properties:
        type:
          const: url
          title: Type
          type: string
        url:
          title: Url
          type: string
      required:
        - type
        - url
      title: MediaInputUrl
      type: object
    AudioBlock:
      properties:
        media_id:
          format: uuid
          title: Media Id
          type: string
        type:
          const: audio
          default: audio
          title: Type
          type: string
      required:
        - media_id
      title: AudioBlock
      type: object
    FileBlock:
      properties:
        media_id:
          format: uuid
          title: Media Id
          type: string
        filename:
          default: null
          title: Filename
          type:
            - string
            - 'null'
        type:
          const: file
          default: file
          title: Type
          type: string
      required:
        - media_id
      title: FileBlock
      type: object
    ImageBlock:
      properties:
        media_id:
          format: uuid
          title: Media Id
          type: string
        type:
          const: image
          default: image
          title: Type
          type: string
      required:
        - media_id
      title: ImageBlock
      type: object
    TextBlock:
      properties:
        text:
          title: Text
          type: string
        type:
          const: text
          default: text
          title: Type
          type: string
      required:
        - text
      title: TextBlock
      type: object
    ToolCallBlock:
      properties:
        id:
          title: Id
          type: string
        name:
          title: Name
          type: string
        arguments:
          $ref: '#/components/schemas/JSONValue'
        thought_signature:
          default: null
          title: Thought Signature
          type:
            - string
            - 'null'
        type:
          const: tool_call
          default: tool_call
          title: Type
          type: string
      required:
        - id
        - name
        - arguments
      title: ToolCallBlock
      type: object
    ToolResultBlock:
      properties:
        tool_call_id:
          title: Tool Call Id
          type: string
        content:
          anyOf:
            - type: string
            - items:
                discriminator:
                  mapping:
                    audio:
                      $ref: '#/components/schemas/AudioBlock'
                    file:
                      $ref: '#/components/schemas/FileBlock'
                    image:
                      $ref: '#/components/schemas/ImageBlock'
                    text:
                      $ref: '#/components/schemas/TextBlock'
                    tool_call:
                      $ref: '#/components/schemas/ToolCallBlock'
                    tool_result:
                      $ref: '#/components/schemas/ToolResultBlock'
                  propertyName: type
                oneOf:
                  - $ref: '#/components/schemas/TextBlock'
                  - $ref: '#/components/schemas/ToolResultBlock'
                  - $ref: '#/components/schemas/ToolCallBlock'
                  - $ref: '#/components/schemas/ImageBlock'
                  - $ref: '#/components/schemas/AudioBlock'
                  - $ref: '#/components/schemas/FileBlock'
              type: array
          title: Content
        type:
          const: tool_result
          default: tool_result
          title: Type
          type: string
      required:
        - tool_call_id
        - content
      title: ToolResultBlock
      type: object
    JSONValue:
      anyOf:
        - type: boolean
        - type: integer
        - type: number
        - type: string
        - additionalProperties:
            $ref: '#/components/schemas/JSONValue'
          type: object
        - items:
            $ref: '#/components/schemas/JSONValue'
          type: array
        - type: 'null'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````