Skip to main content
POST
/
tests
curl -X POST "https://nunu.ai/api/v1/tests" \
  -H "X-Api-Key: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "test": {
      "name": "Sanity smoke",
      "test_type": "verification",
      "tags": ["smoke"],
      "incident_auto_approve": false,
      "quarantined": false,
      "testrail": null,
      "players_by_key": {
        "1": {
          "name": "P1",
          "agent_config_id": null,
          "game_funcs_config_id": null,
          "items_by_key": {
            "1": {
              "type": "step",
              "goal": "Reach the main menu",
              "finish_condition": "main menu is visible",
              "min_seconds": 0,
              "max_seconds": 60,
              "screenshots": 1,
              "pause_game": false,
              "performance_monitoring": false,
              "hint_manual": []
            }
          },
          "item_order": ["1"]
        }
      },
      "player_order": ["1"]
    },
    "folder_path": "regression/smoke"
  }'
{
  "id": "a5060a07-d386-4269-98ce-b33fb894201e",
  "project_id": "test",
  "name": "Sanity smoke",
  "version": 0,
  "tags": ["smoke"],
  "incident_auto_approve": false,
  "test_type": "verification",
  "quarantined": false,
  "testrail": null,
  "source": "repository",
  "players_by_key": { "...": "..." },
  "player_order": ["1"]
}

Documentation Index

Fetch the complete documentation index at: https://api-docs.nunu.ai/llms.txt

Use this file to discover all available pages before exploring further.

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.
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.

Response

Returns the newly created test with status 201. The response shape is identical to Get Test.
curl -X POST "https://nunu.ai/api/v1/tests" \
  -H "X-Api-Key: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "test": {
      "name": "Sanity smoke",
      "test_type": "verification",
      "tags": ["smoke"],
      "incident_auto_approve": false,
      "quarantined": false,
      "testrail": null,
      "players_by_key": {
        "1": {
          "name": "P1",
          "agent_config_id": null,
          "game_funcs_config_id": null,
          "items_by_key": {
            "1": {
              "type": "step",
              "goal": "Reach the main menu",
              "finish_condition": "main menu is visible",
              "min_seconds": 0,
              "max_seconds": 60,
              "screenshots": 1,
              "pause_game": false,
              "performance_monitoring": false,
              "hint_manual": []
            }
          },
          "item_order": ["1"]
        }
      },
      "player_order": ["1"]
    },
    "folder_path": "regression/smoke"
  }'
{
  "id": "a5060a07-d386-4269-98ce-b33fb894201e",
  "project_id": "test",
  "name": "Sanity smoke",
  "version": 0,
  "tags": ["smoke"],
  "incident_auto_approve": false,
  "test_type": "verification",
  "quarantined": false,
  "testrail": null,
  "source": "repository",
  "players_by_key": { "...": "..." },
  "player_order": ["1"]
}

Authorizations

X-Api-Key
string
header
required

API key for authentication

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
source
enum<string>
Available options:
repository,
bot
players_by_key
object
player_order
string[]