Skip to main content
POST
Permission required: project:operate-runs. TestRail must be enabled and configured for the project, with TestRail case mappings for the results you want to export.
Export one nunu multiplayer run, several runs from the same project, or the completed runs in a test-plan execution. The export uses your project’s saved TestRail connection and suite configuration. Results spanning multiple suites create a TestRail plan; a single suite creates a TestRail run.

Request body

Supply exactly one source: multiplayer_run_id, multiplayer_run_ids, or test_plan_execution_id. Unknown fields are rejected.
string
Export one run. nunu multiplayer run ID from List Runs. Do not use a job ID or per-player run ID.
string[]
Export several runs together into one TestRail entry. 1 to 100 unique multiplayer run IDs from List Runs, all in the same project.
string (uuid)
Execution ID from List Test Plan Executions, not the test-plan definition ID. Only completed runs in the execution are exported.
string
Optional. Name for the created TestRail run or plan, replacing the generated nunu.ai name. Must contain 1 to 250 characters after trimming whitespace.
boolean
default:"true"
Optional. Close the created TestRail run or plan after results are submitted. Set to false to leave it open.
boolean
default:"true"
Optional. Create a new TestRail entry even when the test-plan execution was already exported. Set to false to return the existing TestRail links instead. Run exports always create a new entry.

Existing exports and retries

Every call creates a new TestRail entry by default. To avoid duplicating a test-plan export, send force_new_run: false: if the execution already has a saved TestRail export, the response includes already_exported: true and the existing IDs and links. No results are submitted again; runs_processed is empty and total_test_cases is 0. Concurrent exports of the same execution return 409 while an export is in progress. An export performed before the execution finishes contains only the runs completed at that time.
Do not blindly retry after a timeout: the remote entry may already exist. Inspect TestRail before submitting another export, or use force_new_run: false for test-plan executions.

Response

The response is the export result directly, without a data or result wrapper. It includes success, export_type, export_trigger, export_strategy, runs_processed, and total_test_cases. Depending on the suite configuration, the result includes testrail_run_id and testrail_run_url, or testrail_plan_id and testrail_plan_url. Names and export_duration_ms may also be present. Inspect optional skipped_cases and warnings for omitted cases or other export issues. Warning fields use snake_case, including run_id and test_version_id. Missing sources and sources belonging to another project both return 404, including when any ID in multiplayer_run_ids is not found in the project. Invalid input returns 400; missing permissions or a disabled TestRail integration returns 403.

Using MCP

The matching MCP tool is export_testrail_run. It accepts the same body fields and returns the same export result, with identical duplicate-export behavior. Both API and MCP exports use a manual trigger; callers cannot select the internal automatic completion trigger. For global MCP, the run or test-plan execution IDs you supply identify the owning project, so project_id is not required even when your credentials can access several projects. You may still pass it, in which case it is checked against the project that owns the source: a value that does not match returns a project_scope_mismatch error naming both projects. Project-scoped MCP uses the project from its context. MCP accepts authorized user or API-key credentials; this HTTP endpoint accepts API keys. Both require project:operate-runs. Example global MCP tool arguments:
The legacy POST /api/v1/runs/export/testrail endpoint accepts project API keys only and infers the project from the key. Organization API keys must use /api/v1/project/{projectId}/runs/export/testrail.

Authorizations

X-Api-Key
string
header
required

API key for authentication

Path Parameters

projectId
string
required

The project ID. You can copy it from the project settings page or the project URL in the dashboard.

Body

application/json

Supply exactly one source: multiplayer_run_id, multiplayer_run_ids, or test_plan_execution_id. Uses the saved project TestRail integration and a manual export trigger. Unknown fields are rejected.

multiplayer_run_id
string
required

nunu multiplayer run ID from List Runs. Not a job ID or a per-player run ID.

Minimum string length: 1
custom_run_name
string

Optional. Name for the created TestRail run or plan. Leading and trailing whitespace is trimmed. Defaults to a generated nunu.ai name.

Required string length: 1 - 250
close_run_on_completion
boolean
default:true

Optional. Close the created TestRail run or plan after results are submitted. Set false to leave it open.

force_new_run
boolean
default:true

Optional. Create a new TestRail entry even if a test-plan execution was already exported. Set false to return the existing links with already_exported: true instead.

Response

Export completed, or existing test-plan export returned

success
boolean
required
export_type
enum<string>
required

This endpoint accepts single_run or test_plan sources.

Available options:
single_run,
test_plan,
multiple_runs
export_trigger
enum<string>
required

Always manual for this endpoint.

Available options:
manual,
auto
export_strategy
enum<string>
required
Available options:
single_suite,
multi_suite_plan
runs_processed
string[]
required

nunu multiplayer run IDs processed by this export. Empty when already_exported is true.

total_test_cases
number
required

Number of aggregated TestRail cases. Zero when returning an existing export.

already_exported
boolean

True when an existing test-plan export is returned without creating a new remote entry.

export_duration_ms
number
skipped_cases
number[]

TestRail case IDs skipped during export.

warnings
object[]
error
string
error_code
string
testrail_run_id
number
testrail_run_name
string
testrail_run_url
string
testrail_plan_id
number
testrail_plan_name
string
testrail_plan_url
string