Skip to main content
POST
Permission Required: project:edit-tests
Create a new test case in your project. The shape of test depends on test_type; this endpoint accepts the same verification / discovery / task variants returned by Get Test.
By default, requests that include shared collection steps inline are rejected with 400. Pass shared_collection_steps_mode=drop to silently drop the inline steps (they will be resolved from the shared step collection at run time).

Query Parameters

include_shared_collection_steps
boolean
default:"true"
Whether shared collection steps are expanded inline in the response.
shared_collection_steps_mode
string
default:"error"
How to handle shared collection items that contain inline steps: error (reject) or drop (silently strip the inline steps).

Request Body

test
TestCase
required
Test definition. id may be omitted to have one generated. version is ignored on create. See Get Test for the detailed shape.
Expected results for verification steps. Use expected_results to give a step one or more independent checks. It accepts:
  • a single string — one result,
  • a list of strings — one result per element,
  • a list of { "expected": "..." } objects (forward-compatible form).
One element is exactly one result; newlines inside a string are not split. The legacy finish_condition (single string) is still accepted as an alias for a single result and is ignored when expected_results is present.
folder_path
string
Folder path to place the test in (e.g. "regression/smoke"). null or "/" places it at the project root. Mutually exclusive with folder_id.
folder_id
string
Pre-resolved folder UUID. Mutually exclusive with folder_path.

Test-level time budget

The runtime budget is configured on the test itself, not on individual steps or players. There is no per-run override surface — to change the budget, edit the test (or create a new version).
Test typeAllowed fieldsDefaultNotes
verificationmax_seconds19800 (5.5h)min_seconds is rejected — verification has no minimum runtime.
discoverymin_seconds, max_seconds360010800 (1h–3h)Both bounds optional; defaults apply when omitted.
taskmin_seconds, max_seconds019800 (0–5.5h)Both bounds optional; defaults apply when omitted.
For discovery and task the server validates min_seconds <= max_seconds against the effective budget — i.e. caller-supplied values after defaults are applied. Supplying just one bound that conflicts with the default for the other (e.g. min_seconds: 14400 on a discovery create with no max_seconds) is rejected with 400; either supply the other bound explicitly, or pick a value that fits inside the default range. The hard upper bound for any single run is 5.5h (19800 seconds).

Response

Returns the newly created test with status 201. The response shape is identical to Get Test.

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.

Query Parameters

include_shared_collection_steps
boolean
default:true

Whether shared collection steps are expanded inline in the response

shared_collection_steps_mode
enum<string>
default:error

How to treat shared collection items with inline steps

Available options:
error,
drop

Body

application/json
test
object
required

Full test case body. Shape varies by test_type (verification, discovery, task); see the docs page for the exact shape.

folder_path
string | null

Folder path placement. "/" or null = root. Mutually exclusive with folder_id.

folder_id
string<uuid>

Folder UUID placement. Mutually exclusive with folder_path.

Response

Test created

Full test case body. Shape varies by test_type (verification, discovery, task); see the docs page for the exact shape.

id
string<uuid>
project_id
string
name
string
version
integer
tags
string[]
incident_auto_approve
boolean
test_type
enum<string>
Available options:
verification,
discovery,
task
quarantined
boolean
testrail
object | null
source
enum<string>
Available options:
repository,
bot
min_seconds
integer

Test-level minimum runtime in seconds. Allowed for discovery and task only; sending this on a verification test is rejected with 400. Defaults when omitted: discovery=3600 (1h), task=0. Must be ≤ max_seconds (validated against the effective budget after defaults are applied).

Required range: 0 <= x <= 19800
max_seconds
integer

Test-level maximum runtime in seconds. Hard ceiling for any single run is 19800 (5.5h). Defaults when omitted: verification=19800 (5.5h), discovery=10800 (3h), task=19800 (5.5h).

Required range: 0 <= x <= 19800
players_by_key
object
player_order
string[]