Update Test Group Tests (v1)
Method & Path
PUT /api/v1/workspace/:workspaceId/labs/test-groups/:testGroupId/tests
Actual backend path: /v1/workspace/:workspaceId/labs/test-groups/:testGroupId/tests
Description
Replace all tests in a test group with a new set of tests. This removes all existing tests and adds the new ones.
Authentication
Required: JWT token in Authorization header
Required Permissions:
labs.manage
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token: Bearer <token> |
Content-Type | string | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace identifier (MongoDB ObjectId) |
testGroupId | string | Yes | Test group identifier (MongoDB ObjectId) |
Request Body
{
"testIds": [285899, 285897, 285895, 285896, 285893]
}
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
testIds | array | Yes | Array of test IDs (positive integers) |
Response 200 OK
{
"success": true
}
Common Errors
- 400 Bad Request: Invalid request body, validation errors, or one or more tests not found
- 401 Unauthorized: Missing or invalid authentication token
- 403 Forbidden: Insufficient permissions (requires
labs.manage) - 404 Not Found: Workspace or test group not found
- 500 Internal Server Error: Server error
Notes
- This operation replaces all existing tests in the group
- All tests in
testIdsmust exist in the workspace - Empty array is allowed (removes all tests from the group)