Skip to main content
PATCH
/
tests
/
{testId}
curl -X PATCH "https://nunu.ai/api/v1/tests/a5060a07-d386-4269-98ce-b33fb894201e" \
  -H "X-Api-Key: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "expected_version": 4,
    "patch": { "name": "Sanity smoke v2", "tags": ["smoke", "regression"] }
  }'
{
  "id": "a5060a07-d386-4269-98ce-b33fb894201e",
  "project_id": "test",
  "name": "Sanity smoke v2",
  "version": 5,
  "tags": ["smoke", "regression"],
  "test_type": "verification",
  "...": "..."
}

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
Apply a partial update to a test case. Updates are protected by an optimistic version check — supply the version you fetched from Get Test as expected_version. If the test has been modified since, the update fails with a 409 Conflict and the latest version is returned so the caller can rebase. The patch field is deep-merged into the current test body. To replace a list (e.g. tags or player_order), include the full new list — arrays are replaced, not merged.

Path Parameters

testId
string
required
The test ID (UUID)

Query Parameters

include_shared_collection_steps
boolean
default:"true"
Whether shared collection steps are expanded inline in the response.

Request Body

expected_version
integer
required
The version returned by the most recent Get Test. Must be a non-negative integer.
patch
object
required
Partial test body. Object fields are deep-merged; arrays are replaced wholesale. Cannot change the test id.
shared_collection_steps_mode
string
default:"error"
How to handle shared collection items that contain inline steps in the patch: error (reject) or drop (silently strip the inline steps).
folder_path
string
New folder placement. null or "/" moves the test to the project root. Mutually exclusive with folder_id. Omit both fields to leave folder unchanged.
folder_id
string
Pre-resolved folder UUID. Mutually exclusive with folder_path.

Response

Returns the updated test (same shape as Get Test) on success. On version conflict, returns 409 with:
{
  "error": "version conflict",
  "expected_version": 3,
  "latest_version": 5
}
curl -X PATCH "https://nunu.ai/api/v1/tests/a5060a07-d386-4269-98ce-b33fb894201e" \
  -H "X-Api-Key: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "expected_version": 4,
    "patch": { "name": "Sanity smoke v2", "tags": ["smoke", "regression"] }
  }'
{
  "id": "a5060a07-d386-4269-98ce-b33fb894201e",
  "project_id": "test",
  "name": "Sanity smoke v2",
  "version": 5,
  "tags": ["smoke", "regression"],
  "test_type": "verification",
  "...": "..."
}

Authorizations

X-Api-Key
string
header
required

API key for authentication

Path Parameters

testId
string<uuid>
required

The test ID (UUID)

Query Parameters

include_shared_collection_steps
boolean
default:true

Whether shared collection steps are expanded inline

Body

application/json
expected_version
integer
required

Version returned by the most recent Get Test.

Required range: x >= 0
patch
object
required

Partial test body. Object fields are deep-merged; arrays are replaced wholesale.

shared_collection_steps_mode
enum<string>
default:error
Available options:
error,
drop
folder_path
string | null
folder_id
string<uuid>

Response

Test updated

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[]