Skip to main content
Test CasesUpdate Test Case
TestMu AI
StatusCommunityBlog
Test Cases

Update Test Case

Update a test case including its steps, metadata, and dynamic fields. This endpoint replaces the separate Test Steps APIs (POST /api/v1/test-steps and PUT /api/v1/test-steps/{test_step_id}). The snapshot_id from the GET response must be included in the request body.

PUT
/api/v2/test-cases
Update Test Case
curl --request PUT \
--url "https://test-manager-api.lambdatest.com/api/v2/test-cases" \
--header "Authorization: Basic <encoded-value>" \
--header "Content-Type: application/json" \
--data '{
"id": "sample_test_case_id",
"project_id": "sample_project_id",
"title": "Sample Test Case Title",
"description": "<p>Updated test case description</p>",
"type": "",
"preconditions": "Sample preconditions",
"status": "",
"priority": "Medium",
"automation_status": "Not Automated",
"external_id": "TC-1",
"attachments": [],
"dynamic_fields": [
{
"field_id": "sample_field_id_1",
"value": "1234567"
},
{
"field_id": "sample_field_id_2",
"value": "Yes"
}
],
"tags": [
"regression",
"smoke"
],
"commit_message": "Updated test case",
"snapshot_id": "sample_snapshot_id",
"step_events": [
{
"test_step_info_id": "sample_step_id_1",
"step_type": "step",
"operation": "MODIFY",
"description": "<p>Updated step 1 description</p>",
"outcome": "<p>Updated step 1 expected outcome</p>",
"attachments": []
},
{
"test_step_info_id": "sample_step_id_2",
"step_type": "step",
"operation": "MODIFY",
"description": "<p>Updated step 2 description</p>",
"outcome": "<p>Updated step 2 expected outcome</p>",
"attachments": []
},
{
"test_step_info_id": "custom-new-step-id",
"step_type": "step",
"operation": "ADD",
"description": "<p>New step description</p>",
"outcome": "<p>New step expected outcome</p>",
"attachments": [],
"parent_step_info_id": "sample_step_id_2"
},
{
"bdd_info_id": "custom-d8689042-a678-4d0f-890a-5acf64e5236a",
"step_type": "bdd_scenario",
"operation": "ADD",
"test_step_info_id": "custom-d8689042-a678-4d0f-890a-5acf64e5236a",
"bdd_data": "Given user is on login page\\nWhen user enters valid credentials\\nThen user is logged in"
}
],
"override": false
}'
{
"message": "Test case updated successfully",
"type": "Success",
"data": {
"snapshot_id": "sample_snapshot_id"
}
}

Authorizations

Authorizationstringheaderrequired

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json
idstringrequired

The test case ID to update.

project_idstringrequired

The project ID the test case belongs to.

titlestring
descriptionstring
typestring
preconditionsstring
statusstring
prioritystring
automation_statusstring
external_idstring
attachmentsarray
dynamic_fieldsarray
tagsarray
commit_messagestringrequired
snapshot_idstringrequired

Required. Must be taken from the GET /api/v2/test-cases/{test_case_id} response.

step_eventsarray
overrideboolean

Response

application/json

OK

messagestring
Example: "Test case updated successfully"
typestring
Example: "Success"
dataobject
data.snapshot_idstring
Example: "sample_snapshot_id"
Update Test Case
curl --request PUT \
--url "https://test-manager-api.lambdatest.com/api/v2/test-cases" \
--header "Authorization: Basic <encoded-value>" \
--header "Content-Type: application/json" \
--data '{
"id": "sample_test_case_id",
"project_id": "sample_project_id",
"title": "Sample Test Case Title",
"description": "<p>Updated test case description</p>",
"type": "",
"preconditions": "Sample preconditions",
"status": "",
"priority": "Medium",
"automation_status": "Not Automated",
"external_id": "TC-1",
"attachments": [],
"dynamic_fields": [
{
"field_id": "sample_field_id_1",
"value": "1234567"
},
{
"field_id": "sample_field_id_2",
"value": "Yes"
}
],
"tags": [
"regression",
"smoke"
],
"commit_message": "Updated test case",
"snapshot_id": "sample_snapshot_id",
"step_events": [
{
"test_step_info_id": "sample_step_id_1",
"step_type": "step",
"operation": "MODIFY",
"description": "<p>Updated step 1 description</p>",
"outcome": "<p>Updated step 1 expected outcome</p>",
"attachments": []
},
{
"test_step_info_id": "sample_step_id_2",
"step_type": "step",
"operation": "MODIFY",
"description": "<p>Updated step 2 description</p>",
"outcome": "<p>Updated step 2 expected outcome</p>",
"attachments": []
},
{
"test_step_info_id": "custom-new-step-id",
"step_type": "step",
"operation": "ADD",
"description": "<p>New step description</p>",
"outcome": "<p>New step expected outcome</p>",
"attachments": [],
"parent_step_info_id": "sample_step_id_2"
},
{
"bdd_info_id": "custom-d8689042-a678-4d0f-890a-5acf64e5236a",
"step_type": "bdd_scenario",
"operation": "ADD",
"test_step_info_id": "custom-d8689042-a678-4d0f-890a-5acf64e5236a",
"bdd_data": "Given user is on login page\\nWhen user enters valid credentials\\nThen user is logged in"
}
],
"override": false
}'
{
"message": "Test case updated successfully",
"type": "Success",
"data": {
"snapshot_id": "sample_snapshot_id"
}
}