---
title: "Create Test Run"
method: POST
path: "/api/v2/projects/{project_id}/test-runs"
tags: ["Test Runs"]
---

# Create Test Run

`POST /api/v2/projects/{project_id}/test-runs`

## Path parameters

- `project_id` string, required

## Request body

- object
  - `dataset_name` string, required
  - `include_outputs` boolean, nullable
  - `test_run_name` string, nullable
  - `test_run_description` string, nullable
  - `flavor_name` string, nullable
  - `target_evaluation_ids` string[], nullable

## Response `201`

TestRunWithTestCasesInfo(test_run_id: str, test_run_name: str, test_run_description: str, test_cases: Optional[list[server.api_routes.test_runs_api_v2.TestCaseInfo]], trace_test_cases: Optional[list[server.api_routes.test_runs_api_v2.TraceTestCaseInfo]])

- object
  - `test_run_id` string, required
  - `test_run_name` string, required
  - `test_run_description` string, required
  - `test_cases` TestCaseInfo[], nullable, required
    - `id` string, uuid, required
    - `values` object, required
    - `output` string, nullable, required
    - `output_message` union, required
      - union
        - UserMessageInfo
          - `content` union[], required
            - union
              - …
          - `role` 'user'
        - SystemMessageInfo
          - `content` string, required
          - `role` 'system'
        - DeveloperMessageInfo
          - `content` string, required
          - `role` 'developer'
        - AssistantMessageInfo
          - `content` union[], required
            - union
              - …
          - `role` 'assistant'
      - UserMessage
        - `content` union, required
          - string
          - union[]
            - union
              - …
        - `role` 'user'
      - AssistantMessage
        - `content` union, required
          - string
          - union[]
            - union
              - …
        - `role` 'assistant'
      - SystemMessage
        - `content` string, required
        - `role` 'system'
      - DeveloperMessage
        - `content` string, required
        - `role` 'developer'
    - `history` union[], nullable, required
      - union
        - union
          - UserMessageInfo
            - `content` union[], required
              - …
            - `role` 'user'
          - SystemMessageInfo
            - `content` string, required
            - `role` 'system'
          - DeveloperMessageInfo
            - `content` string, required
            - `role` 'developer'
          - AssistantMessageInfo
            - `content` union[], required
              - …
            - `role` 'assistant'
        - UserMessage
          - `content` union, required
            - string
            - union[]
              - …
          - `role` 'user'
        - AssistantMessage
          - `content` union, required
            - string
            - union[]
              - …
          - `role` 'assistant'
        - SystemMessage
          - `content` string, required
          - `role` 'system'
        - DeveloperMessage
          - `content` string, required
          - `role` 'developer'
    - `metadata` object, nullable, required
  - `trace_test_cases` TraceTestCaseInfo[], nullable, required
    - `test_case_id` string, required
    - `input` union, required
      - boolean
      - integer
      - number
      - string
      - object
      - JSONValue[]
    - `output` union, required
      - boolean
      - integer
      - number
      - string
      - object
      - JSONValue[]
    - `custom_metadata` object, nullable
    - `test_case_type` 'trace'

---

[API](https://skmtc.net/freeplay/apis/freeplay-api.md) · [All operations](https://skmtc.net/freeplay/apis/freeplay-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/freeplay/freeplay-api/revisions/69c553220183/schema)
