Skip to main content

Update Test Group (v1)

Method & Path

PATCH /api/v1/workspace/:workspaceId/labs/test-groups/:testGroupId

Actual backend path: /v1/workspace/:workspaceId/labs/test-groups/:testGroupId

Description

Update an existing test group.

Authentication

Required: JWT token in Authorization header

Required Permissions:

  • labs.manage

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token: Bearer <token>
Content-TypestringYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier (MongoDB ObjectId)
testGroupIdstringYesTest group identifier (MongoDB ObjectId)

Request Body

{
"testGroupTitle": "Updated Liver Functions+",
"testGroupDefaultPrice": 20.00
}

Body Parameters

ParameterTypeRequiredDescription
testGroupTitlestringNoTest group title (1-500 characters)
testGroupDefaultPricenumberNoDefault price for the test group (nullable)

Response 200 OK

{
"testGroup": {
"id": "507f1f77bcf86cd799439011",
"workspaceId": "507f1f77bcf86cd799439012",
"testGroupId": 5196,
"testGroupTitle": "Updated Liver Functions+",
"testGroupDefaultPrice": 20.00,
"testGroupAccountId": 382,
"deletedAt": null,
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T11:00:00Z"
}
}

Common Errors

  • 400 Bad Request: Invalid request body or validation errors
  • 401 Unauthorized: Missing or invalid authentication token
  • 403 Forbidden: Insufficient permissions (requires labs.manage)
  • 404 Not Found: Workspace or test group not found
  • 422 Unprocessable Entity: Validation errors
  • 500 Internal Server Error: Server error